- Experimental autoscale for control buttons.
- [Custom control] Implements dynamic position.
This commit is contained in:
khanhduytran0 2020-11-20 06:10:42 +07:00
parent d6417c7b5a
commit 8651abc104
9 changed files with 225 additions and 170 deletions

View file

@ -1104,8 +1104,8 @@ public class BaseMainActivity extends LoggableActivity implements OnTouchListene
protected Button findButton(int id) {
Button button = (Button) findViewById(id);
button.setWidth((int) Tools.dpToPx(this, Tools.pxToDp(this, button.getWidth()) * LauncherPreferences.PREF_BUTTONSIZE));
button.setHeight((int) Tools.dpToPx(this, Tools.pxToDp(this, button.getHeight()) * LauncherPreferences.PREF_BUTTONSIZE));
button.setWidth((int) (button.getWidth() * LauncherPreferences.PREF_BUTTONSIZE));
button.setHeight((int) (button.getHeight() * LauncherPreferences.PREF_BUTTONSIZE));
button.setOnTouchListener(this);
button.setFocusable(false);
button.setFocusableInTouchMode(false);