I'm not able to make proguard work in my app. When I do minify enabled as true, textinputlayout in layout screens are working fine but I have an alertdialog which contains one inflated XML , that XML is not getting inflated (that XML contains one textinputlayout. Please help guys. Here is code snippet.
PS: I'm posting using mobile app, please don't go bashing for not proper alignment. I really need help.
Build.gradle entries-->
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguardandroid.txt'), 'proguard-rules.pro' signingConfig
signingConfigs.release
}
}
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile project(':volley-1.0.0')
compile project(':photoview-1.2.4')
compile project(':calligraphy-2.2.0') }
TextInputLayout in XML screen -->
<android.support.design.widget.TextInputLayout
android:id="@+id/pin_login_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:hint="Please enter PIN"
android:inputType="numberPassword"
android:maxLength="4"
android:textSize="24sp"/>
</android.support.design.widget.TextInputLayout>
Alert dialog code -->
AlertDialog.Builder builder = new AlertDialog.Builder(getContext(), R.style.AlertDialogStyle);
final TextInputLayout otpWrapper = (TextInputLayout) (LayoutInflater.from(getContext())).inflate(R.layout.single_edit_text_material, null);
otpWrapper.setHint("Please enter OTP");
otpWrapper.getEditText().setSingleLine(true);
otpWrapper.getEditText().setInputType(InputType.TYPE_CLASS_NUMBER);
setEditTextMaxLength(otpWrapper.getEditText(), 6);
builder.setView(otpWrapper); builder.setNegativeButton("Cancel", null);
builder.setPositiveButton("Submit", new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialog, int which) {
}
});
builder.setCancelable(false); final AlertDialog d = builder.create();
d.setCanceledOnTouchOutside(false); d.show();
single_edit_text_material.xml -->
<android.support.design.widget.TextInputLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/wrapper" android:layout_width="match_parent"
android:layout_height="wrap_content" android:paddingEnd="8dp"
android:paddingStart="8dp" android:paddingTop="8dp">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.TextInputLayout>
Edit : The dialog is getting popped up with textinputlayout in working condition when proguard is not enabled but when I enable the proguard the dialog is getting popped up but textinputlayout is not there only ok button is there. There is no error in android monitor