I want to use TextInputEditText and TextInputLayout in my app, but it will not work with Theme.AppCompat.Light.NoActionBar. But if I set it to Theme.MaterialComponents.Light.NoActionBar, it will work without any issues, but this will destroy all of my styles in app.
Usage in XML:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nameLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/reg_edit_text_style"
app:errorEnabled="true"
android:hint="@string/name">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/nameEt"
android:layout_width="match_parent"
android:nextFocusDown="@id/lastNameEt"
android:inputType="text"
style="@style/reg_edit_text_inner_style"/>
</com.google.android.material.textfield.TextInputLayout>
In build.gradle:
implementation 'com.google.android.material:material:1.1.0-alpha07'
implementation 'androidx.appcompat:appcompat:1.0.2'
Error:
Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:240)
at com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:215)
at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:143)