I use in my Android app, xml files to render the UI.
In my xml files I use Google's MaterialButton
from com.google.android.material.button
to render a button at the bottom of a screen.
More specifically I define it in a ConstraintLayout
like this:
<com.google.android.material.button.MaterialButton
android:id="@+id/continue_button"
style="@style/MyTheme.MaterialComponents.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:padding="16dp"
android:text="@string/continue"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
I notice that Android Studio (I'm using Android Studio Electric Eel | 2022.1.1) reports this Layout Validation
warning:
The button continue_button is too wide
The button MaterialButton is wider than 320dp in 4 preview configurations. Material Design recommends buttons to be no wider than 320d
Questions:
- What does this warning actually mean? I'm not sure where I can find these "preview configurations" it's mentioning.
- How can I resolve this warning?