0

I have an accessibility function within my app that allows the textSize to be increased based on the user preference. However when the text gets to a certain size it is no longer fully visible within its view. How do I increase the view so it automatically wraps around my text value

Initial sized value

Then I increase the size of the text

enter image description here

This is the result:

enter image description here

Is there a way to automatically expand the container the text is in?

<FrameLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:layout_weight="1">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/plu_entry"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="16dp"
                    android:background="@color/light_grey"
                    android:gravity="center"
                    android:padding="16dp"
                    style="@style/Text.Black.HelveticaBold"
                    android:textSize="24sp"
                    tools:text="36512"/>

                <LinearLayout style="@style/PluButtonContainer">

                    <Button
                        android:id="@+id/seven"
                        style="@style/PluButton"
                        android:text="7"/>

                    <Button
                        android:id="@+id/eight"
                        style="@style/PluButton"
                        android:text="8"/>

                    <Button
                        android:id="@+id/nine"
                        style="@style/PluButton"
                        android:text="9"/>

                </LinearLayout>

                <LinearLayout style="@style/PluButtonContainer">

                    <Button
                        android:id="@+id/four"
                        style="@style/PluButton"
                        android:text="4"/>

                    <Button
                        android:id="@+id/five"
                        style="@style/PluButton"
                        android:text="5"/>

                    <Button
                        android:id="@+id/six"
                        style="@style/PluButton"
                        android:text="6"/>

                </LinearLayout>

                <LinearLayout style="@style/PluButtonContainer">

                    <Button
                        android:id="@+id/one"
                        style="@style/PluButton"
                        android:text="1"/>

                    <Button
                        android:id="@+id/two"
                        style="@style/PluButton"
                        android:text="2"/>

                    <Button
                        android:id="@+id/three"
                        style="@style/PluButton"
                        android:text="3"/>

                </LinearLayout>

                <LinearLayout style="@style/PluButtonContainer">

                    <Button
                        style="@style/PluButton"
                        android:visibility="invisible"/>

                    <Button
                        android:id="@+id/zero"
                        style="@style/PluButton"
                        android:text="0"/>

                    <ImageButton
                        android:id="@+id/backspace"
                        style="@style/PluButton"
                        android:src="@drawable/ic_backspace_white_48dp"/>

                </LinearLayout>

            </LinearLayout>

        </FrameLayout>
Brummerly
  • 25
  • 1
  • 7

0 Answers0