Is using dimension as even number recommended or does it improve performance?
For example:
android:layout_width="22dp" Over
android:layout_height="21dp" Material design guideline too has more even numbered dps and sps than odd numbered.
Is using dimension as even number recommended or does it improve performance?
For example:
android:layout_width="22dp" Over
android:layout_height="21dp" Material design guideline too has more even numbered dps and sps than odd numbered.
Setting dimension as even number does not affect performance but it is recommended in google material design to use for even spacing. , For example, - if all of your spacing are a multiple of 8 dp you follow the material design.
Another good example of Google material design is the aspect ratio - the there are recommended aspect ratios for your UI :
The following aspect ratios are recommended for use across your UI: 16:9, 3:2, 4:3, 1:1, 3:4, and 2:3
But, if you can avoid using fixed sizes on your views and use constraintLayout instead this would be the best option for you.
why is that you ask? - because different devices having a different screen size and when you put fixed size on some view your layout may not be responsive to all screen sizes.
It does not have to do anything with performance.
I am always trying to follow 8, 16, 32 size values. Also size like 32-8 also counts. Don't think that it is good practice to use side padding 15dp instead 16dp or 25dp when you can use 24dp. But there is always exceptions depending on design.