PojavLauncher icon indicating copy to clipboard operation
PojavLauncher copied to clipboard

New feature: button's text size changing + text size in DIP instead of SP

Open BlueGradientHorizon opened this issue 2 years ago • 1 comments

What this PR adds / changes / implements:

  • Adds textSize field to ControlData class

  • Changes one of the ControlData constructors so it sets the text size to 14 DIP by default.

  • Adds several methods to the Tools class for converting PX, DP, and SP screen units between themselves. They are not currently in use, but may be needed in the future (really idk why i added it, maybe i planned to use it somewhere but forgot where exactly).

  • Implements text size section in dialog_control_button_setting.xml after size section so user can dynamically change it, the same way like he changes opacity or corner radius button properties.

  • Sets the min and max values of textSize's SeekBar to 8 and 24 respectively. At this moment, values are hardcoded.

  • Impements setDPText() method in class EditControlPopup for displaying current text size according to its SeekBar and implements its ChangeListener.

  • Adds string "Text size" to strings.xml with name customctrl_text_size.

BlueGradientHorizon avatar Dec 24 '22 21:12 BlueGradientHorizon

Hello, and thank you for this PR :smile: At first glance the PR seems good and fits the general code style, I'll take a deeper look at it later.

However, using SP is important, as it scales properly for users who need a bigger front size. (accessibility settings) DO NOT use anything not backed by the SP unit when it comes to fonts.

Mathias-Boulay avatar Dec 25 '22 11:12 Mathias-Boulay

Forgotten by everyone, go into the void...

BlueGradientHorizon avatar Mar 09 '24 20:03 BlueGradientHorizon

No, not really.

Mathias-Boulay avatar Mar 09 '24 21:03 Mathias-Boulay