mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 15:19:53 +01:00
Android UI - Icon Drawables
@@ -1,3 +1,5 @@
|
|||||||
|
## Java
|
||||||
|
|
||||||
#### Thread safety
|
#### Thread safety
|
||||||
* Classes should be immutable where possible
|
* Classes should be immutable where possible
|
||||||
* Classes that may be used by multiple threads must be thread-safe
|
* Classes that may be used by multiple threads must be thread-safe
|
||||||
@@ -31,3 +33,13 @@
|
|||||||
* Use dedicated lock objects rather than `synchronized`
|
* Use dedicated lock objects rather than `synchronized`
|
||||||
* Don't call into other classes while holding locks
|
* Don't call into other classes while holding locks
|
||||||
* Don't start database transactions while holding locks
|
* Don't start database transactions while holding locks
|
||||||
|
|
||||||
|
## Android UI
|
||||||
|
|
||||||
|
#### Icon Drawables
|
||||||
|
|
||||||
|
* Use `app:srcCompat` instead of `android:src` to define drawables in XML files
|
||||||
|
* Use `setImageResource()` to set icons instead of `setImageDrawable()`
|
||||||
|
* If you need to set a drawable directly, but can't use `setImageResource()`, use `VectorDrawableCompat.create()` to get the drawable
|
||||||
|
* Don't use vector(-only) drawables for notification icons (unless that's supported now)
|
||||||
|
* Test icon display on API < 21
|
||||||
Reference in New Issue
Block a user