imageView.getDrawable().setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY);
Original source: http://stackoverflow.com/questions/10114420/applying-colorfilter-to-imageview-with-shapeddrawable
A few things that mingles my mind during my code projects. Feel free to take note or use it for your own good wherever is appropriate.
imageView.getDrawable().setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY);
The whole point is to make touch controls 48x48 dp minimum so that user won't miss the target when touching the control.Why 48dp?
On average, 48dp translate to a physical size of about 9mm (with some variability). This is comfortably in the range of recommended target sizes (7-10 mm) for touchscreen objects and users will be able to reliably and accurately target them with their fingers.If you design your elements to be at least 48dp high and wide you can guarantee that:
- your targets will never be smaller than the minimum recommended target size of 7mm regardless of what screen they are displayed on.
- you strike a good compromise between overall information density on the one hand, and targetability of UI elements on the other.
"Don't ever let another thread access arrayList item while another is iterating over it"
public Cursor query (String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy)
mDb.query(DATABASE_TABLE, new String[]{KEY_ROWID, KEY_TITLE}, null, null, null, null,"null LIMIT 1000");