I have xml like this
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="34dp"
android:layout_marginEnd="34dp"
android:textColorHint="@color/grey_40"
android:theme="@style/EditText.Black">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/edit_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:inputType="phone"
android:textColor="@android:color/black"
android:fontFamily="@font/poppinsregular"/>
</com.google.android.material.textfield.TextInputLayout>
And Then 2 theme style, Black and white, as you can see i'm using black theme to default for my textinputlayout, but now i need to change it to red on this code :
private void checklogin(){
nomor_handphone = findViewById(R.id.edit_phone);
if(!nomor_handphone.getText().toString().equals("1234567890")){
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
//code for change theme from @style/EditText.Black to @style/EditText.Red
}
}, 2000);
}
Can you help me ?