I'm trying to make a custom keyboard for an android app so I'm trying to make the text on the buttons as readable as possible. I want the text to be big on the button, but setting the textSize attribute doesn't work, as it makes the text not fit. Is there a way to make the text take up a bigger part of the button, so that it can be large while still fitting on the button? Description of problem here
I tried to change the text size but it constrains the bounds of where the text can go.
Here is the xml file I'm trying to achieve this in: (accessLettersButton is the id of the button that I'm trying to do this for.)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="naturaldeductionapp.DeductionFragment">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/deductionLineRecyclerView"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</HorizontalScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="@+id/accessLettersButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_marginVertical="0dp"
android:layout_weight="1"
android:backgroundTint="#FF6565"
android:includeFontPadding="false"
android:text="ABC"
android:textColor="#000000"
android:textSize="16sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/leftBracketButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_marginVertical="0dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="("
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/rightBracketButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_marginVertical="0dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text=")"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/clearButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_marginVertical="0dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="C"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/backspaceButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#AAAAAA"
android:text="⌫"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="@+id/universalButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="∀"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/negationButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="¬"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/conjunctionButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="∧"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/exitEnterButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="e⏎"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/suppositionButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#AAAAAA"
android:text="p."
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="@+id/existentialButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="∃"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/contradictionButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="⊥"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/disjunctionButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="∨"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/arrowUpButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="↑"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/enterButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#AAAAAA"
android:text="⏎"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="@+id/conditionalButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="→"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/biconditionalButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="↔"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/arrowLeftButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="←"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/arrowDownButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#ABABAB"
android:text="↓"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
<Button
android:id="@+id/arrowRightButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="1dp"
android:layout_weight="1"
android:backgroundTint="#AAAAAA"
android:text="→"
android:textColor="#000000"
android:textSize="24sp"
app:cornerRadius="5dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>