Skip to main content

Posts

Showing posts from July, 2018

InDesign: Seven ways in which indexing could be improved

Enable character formatting of entriesEnable selection of multiple entries for deletionMake the existing entries searchable in the dialog box for creating a new entry (add find field)Make the new entry dialog box expandable so more of the existing entries can be viewed at once (rather than scrolled)Add option to expand all references/topicsFix shortcut bugDevelop innovative ways to automate indexing (e.g. add entries by bulk searching)

InDesign: Workarounds for Indexing Bug (macOS)

Bug If you regularly use InDesign for indexing you might be aware of a long-standing bug whereby having used the entry type "For Next No. of Pages" entries made afterwards using the shortcut of dragging out a topic to the new entry icon at the bottom of the Indexing window, or created using an alt-click of the new entry icon repeats the same page range no matter how many times you open and reset to "Current Page" and then keeps repeating this behaviour.
Workaround To reset the Indexing shortcuts and make them forget the page range do the following:
Use shortcut in usual way.When extended page range appears open the entry, select "Current Page" and press OK.You'll notice that the page range doesn't immediately update and remains as a range.Do not press the sync button, instead re-open the entry and press OK again. You should now be able to use the indexing shortcuts as normal (until the next entry of a page range, after which you'll need to rep…

Android: Toolbar, Action Bar and Menu Items (including Spinner)

It's very easy to drag out a Toolbar when designing your interface but you can't just drop buttons into it. There is a more mystical way of construction to enter into. Toolbars hold a menu. The main toolbar that you see when you create an empty app is assigned Action Bar status in the onCreate method.
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); You will also notice its menu being "inflated" later in the onCreateMenuOptionsMenu method.
getMenuInflater().inflate(R.menu.menu_main, menu); The setting of the Toolbar as an Action Bar enables the following:
Once you set the toolbar as an activity's app bar, you have access to the various utility methods provided by the v7 appcompat support library's ActionBar class. This approach lets you do a number of useful things, like hide and show the app bar.

To use the ActionBar utility methods, call the activity's getSupportActionBar() method. This method returns a referen…

Android: Adding and referencing an XML resource

Adding an XML resource Inside your res folder is a values folder you can right-click on this and create a New > Values resource file. Inside this, for the purpose of creating a simple list of strings, we can simply place tags and strings in an identical way to that in which we find in the strings.xml file:
<resources><string name="app_name">DraggingView</string></resources> If we want to create an array however, whether that be an integer or string array we must first identify the array as such by additional level of nesting:
<resources> <string-array name="font_sizes"> <item value="10">"10"</item> <item value="15">"15"</item> <item value="20">"20"</item> </string-array> </resources> Referencing the XML resource To then reference that resource within your java code, we can write simply: R…

Android: Popup menu

This example uses a Basic Activity type app with a round button (FloatingActionButton) that hovers over the bottom right of the interface.
Creating the popup menu To create the popup menu it is necessary to first instantiate and then add items before adding a listener (OnMenuItemClickListener) to identify the item clicked. It is also necessary to know the view from which the menu will originate. FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); final PopupMenu menu = new PopupMenu(this, fab); menu.getMenu().add("Add Image"); menu.getMenu().add("Add Text"); menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { // insert your code here Log.d("menu title: ", item.getTitle().toString()); ret…

Android: Drag and drop a view onto another view

Understanding the Drag and the Drop In enabling a user to perform a drop and drag action you have a view that is being dragged and a view that is being dragged to. The listener that will activate the drag, e.g. a long press, is attached to the view that will be dragged. While the view that is being dragged to has the drag listener attached to it. A single view can be dragged onto many different views if those views each have drag listeners set and ready to respond positively. Likewise multiple views can be dragged onto the same view that is being dragged to.
View Being Dragged To Starting with the view being dragged to, which is an essential if you are going to be able to drop your draggable view anywhere, we have the following code. (See below for further explanation.) // A view is identified from the layout file within which other views can be dragged (mainView) RelativeLayout mainView = findViewById(R.id.mainView); mainView.setOnDragListener(new View.OnDragListener() { @Overr…

Life in the Real World: PDF to EPUB Conversion Using Google Docs

Did you know that you can convert a PDF into a range of formats simply by uploading to Google Docs? These currently include Word (.docx), Open Document Format (.odt), Rich Text Format (.rtf), Plain Text (.txt), Web Page (.html, zipped), and yes EPUB (.epub).

With your mind suitably blown, let's get down to the practicalities. The first of which is that when you upload a PDF to Google Docs it is going to need a bit of cleanup. How much cleanup depends on the complexity of the document but a basic PDF with headings, word breaks, running heads,  footnotes and blockquotes you'll find needs the running heads removed, the spaces between pages deleted, the word break hyphens removed, blockquotes re-indented, some merged lines separated, footnotes re-activated, etc. But at least italics will be retained.
A licence to print money Once you've done the clean up, then you can download the file as an EPUB by simply selecting File > Download As > EPUB Publication. And there insta…