Android Code Snippet Font Resizer: Responsive label and Popup Menu or xCustomListView Menu called from ACToolBar icon

Examples to change the font size of a text inside a label, adapting it and the ScrollView.
With my correction to StringUtils.MeasureMultilineTextHeight(...) because it didn't quite calculate correctly.
Rotating the device maintains the values and measurements.

It gets the value of the primary color declared in the Manifest Editor to color the system StatusBar afterwards.

textsize.jpg


TextSize example. Popup Menu version.
  • Clicking on the PopUp Menu item closes it
  • The Popup Menu hangs from a Label on the ACToolBar indicating the current font size
  • It could also hang from a hidden view created with the Designer

TextSize_xCustomListView.jpg


TextSize_xCustomListView. xCustomListView version.
  • xCustomListView with elevation
  • When clicking on the xCustomListView Menu item, it is not hidden
  • It is hidden when clicking on the transparent panel that captures the event in the rest of the Activity or on the icon of the ACToolBar that called it


Dependencies: AppCompat, JavaObject, Phone, StringUtils, (xCustomListView), XmlLayoutBuilder, XUI. Optional: Drawer B4X

I accept corrections and suggestions.

Regards.
 

Attachments

  • TextSize.zip
    65.1 KB · Views: 102
  • TextSize_xCustomListView.zip
    70.8 KB · Views: 100
Last edited:
Top