Monday, November 10, 2014

Show multiple lines of title in Android ActionBar

To show multiple lines of title in Android ActionBar, one of the most common solution is to assign some of the text in SubTitle. Here we have another approach:

Basically we get the TextView object of the title in ActionBar, set it's max lines attribute to 2:

int titleId = Resources.getSystem().getIdentifier("action_bar_title","id","android");
TextView title = (TextView) findViewById(titleId);
title.setSingleLine(false);
title.setMaxLines(2);
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);

Then we can set a long title to the ActionBar where the text will be displayed as two lines:

getActionBar().setTitle("... your long title here ...");

Tuesday, November 4, 2014

ArcGIS: Query for a simplified feature set

To query a simplified feature set using QueryTask, you can set the "MaxAllowableOffset" property through

          com.esri.core.tasks.ags.query.Query.setMaxAllowableOffset( )

or if you're using ArcGIS Android SDK version 10.2.4 already, then it should be:

          com.esri.core.tasks.ags.query.QueryParameters.setMaxAllowableOffset( )



Sync multiple git repo at once

Use the following command in Linux will do the job:  ls -d RepoNames* | xargs -I{} git -C {} pull