Search code examples
androidraspberry-pi3android-thingstext-size

How to change text size on Android Things?


I developed an application on AT_v0.3 developer version, Raspberry PI 3. The application on AT_v1.0 stable version size of text and other items are bigger and they are not visible.

Also, there is no option for sizes in the settings menu on AT_v1.0. So, is there a way to fix it without re-design the layouts?


Solution

  • There are many changes that may have to be made to your applications between the third developer preview and the stable version. In addition to APIs, you may need to update your layouts.

    In a TextView, if the font size is too large or small, you can modify the XML contents to specify a specific font size:

    <TextView
        android:id="@+id/text_view_id"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:textSize="14sp"
        android:text="@string/hello" />
    

    You can also use a custom theme in order to modify a number of Textview elements to adjust them all to the same extent.