eluleci/FlatUI — pull request #21 by michalbrz (2014-07-05 13:52:13+00:00)
Title: Fix for issue #18 "Strange Issue on Consecutive Activity Opening". Chang...

...e naming of size variables and introducing new variables, so pixel size calculation is not done in relation to the same variable, what caused size to continuously increase when going back and opening application again.

Bug was caused by FlatUI.initDefaultValues(this), (usually used in onCreate, I suppose) where values are calculated in relation to themselves, like
Attributes.DEFAULT_SIZE = (int) dipToPx(context, Attributes.DEFAULT_SIZE);
Attributes.DEFAULT_SIZE is not always created from scratch when user leaves app and launches it again. That causes Attributes.DEFAULT_SIZE to increase every time app is launched - the bigger screen density the higher that growth.
I introduced Attributes.DEFAULT_SIZE_PX and Attributes.DEFAULT_SIZE_DP, so base value is always in dp and PX will be calculated in relation to it.