StaggeredGridView thingsList = (StaggeredGridView)findViewById(R.id.grid_view);
thingsList.setAdapter(listAdapter);
thingsList.setOnItemClickListener(this);
As I had earlier extended from ListActivity, I could get a few features out of the box: such as a default TextView to show on empty. Now, even after calling an explicit setEmptyView method, I was not able to get the desired result. So had to work around by adding a TextView on a FlowLayout that would only show when the grid was empty. But other than this the other changes (listener etc) were minimal.
Font Changes
While the Roboto font is a fine one, I was getting bored of seeing it, as it is the default in almost all apps. So, decided to replace it with a sans-serif open source font.
Typeface typeface = Typeface.createFromAsset( getResources().getAssets(), "SourceSansPro-Regular.otf");
((TextView)findViewById(R.id.datePurchValue)).setTypeface(typeface);
((TextView)findViewById(R.id.priceValue)).setTypeface(typeface);
((TextView)findViewById(R.id.descValue)).setTypeface(typeface);
Also, added a few icons to spruce up the view screen. The base icons are from www.icons4android.com
A New Launcher Icon!
And finally, I created a new launcher icon using using Roman Nurik's Android Asset Studio. The launcher icon is also displayed in the About screen of the app.
Bug Fixes
Along with the new enhancements, a bug related to images was fixed. The images though were stored in a directory created by Thingse, were still referring to their original location. Any delete of the original image would throw a NullPointerException and cause the app to crash. I fixed this by pointing to the right location and also hid the images directory where Thingse stores the captured/selected images from gallery apps. This was done by starting the directory name with a "." (dot) and additionally adding a "nomedia" file in the directory.
No comments :
Post a Comment
Leave a Comment...