Fix crash on KitKat when opening the manual entry dialog

This commit is contained in:
Jakob Nixdorf 2018-11-09 12:21:45 +01:00
parent b9d8a9fb14
commit 2d389d6113
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC
2 changed files with 7 additions and 1 deletions

View file

@ -24,6 +24,7 @@ package org.shadowice.flocke.andotp.View;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.support.v7.app.AppCompatDelegate;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
@ -52,6 +53,8 @@ import java.util.concurrent.Callable;
public class ManualEntryDialog {
public static void show(final MainActivity callingActivity, Settings settings, final EntriesCardAdapter adapter) {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
ViewGroup container = callingActivity.findViewById(R.id.main_content);
View inputView = callingActivity.getLayoutInflater().inflate(R.layout.dialog_manual_entry, container, false);
@ -153,6 +156,10 @@ public class ManualEntryDialog {
});
final Button expandButton = inputView.findViewById(R.id.dialog_expand_button);
// Dirty fix for the compound drawable to avoid crashes on KitKat
expandButton.setCompoundDrawablesWithIntrinsicBounds(null, null, callingActivity.getResources().getDrawable(R.drawable.ic_arrow_down_accent), null);
final ExpandableLinearLayout expandLayout = inputView.findViewById(R.id.dialog_expand_layout);
expandButton.setOnClickListener(new View.OnClickListener() {

View file

@ -126,7 +126,6 @@
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ic_arrow_down_accent"
android:textAlignment="viewStart"
android:text="@string/label_advanced"/>