Skip to content

Material Widget Preview Problem #1096

@Ben-ADFA

Description

@Ben-ADFA

Ref. 3375

From Ahiung Lim (@ahiunglim) on Telegram (via DM):
User specifications: Realme GT Neo 3 Android 14

"Ben, I found a troublesome bug in the preview feature related to material widget.

so, its the textinputlayout with the edittext, normally we do this"

<com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Your Hint">
        
            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/your_edittext"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
        
        </com.google.android.material.textfield.TextInputLayout>

"so after pressing the preview mode, then going back to layout mode, it will convert the widget into this:"

<LinearLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:hint="Your Hint">

   <android.view.ViewGroup>

    <androidx.appcompat.widget.AppCompatEditText
     android:id="@+id/your_edittext"
     android:layout_width="match_parent"
     android:layout_height="wrap_content" />

    <LinearLayout>

     <androidx.appcompat.widget.AppCompatImageButton />

     <TextView />

    </LinearLayout>

    <LinearLayout>

     <TextView />

     <android.view.ViewGroup>

      <androidx.appcompat.widget.AppCompatImageButton />

     </android.view.ViewGroup>

     <androidx.appcompat.widget.AppCompatImageButton />

    </LinearLayout>

   </android.view.ViewGroup>

  </LinearLayout>

"it wont cause trouble on the compile time, but it will crash on app run."

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions