Many improvements and bug fixes

Close #114
This commit is contained in:
topjohnwu
2017-02-21 03:30:37 +08:00
parent 8eba05ed4a
commit a3f0ef8e77
33 changed files with 304 additions and 212 deletions

View File

@@ -93,8 +93,9 @@ public class AlertDialogBuilder extends AlertDialog.Builder {
positive.setText(text);
positiveListener = listener;
positive.setOnClickListener((v) -> {
if (positiveListener != null)
if (positiveListener != null) {
positiveListener.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
}
dialog.dismiss();
});
return this;
@@ -112,8 +113,9 @@ public class AlertDialogBuilder extends AlertDialog.Builder {
negative.setText(text);
negativeListener = listener;
negative.setOnClickListener((v) -> {
if (negativeListener != null)
if (negativeListener != null) {
negativeListener.onClick(dialog, DialogInterface.BUTTON_NEGATIVE);
}
dialog.dismiss();
});
return this;
@@ -131,8 +133,9 @@ public class AlertDialogBuilder extends AlertDialog.Builder {
neutral.setText(text);
neutralListener = listener;
neutral.setOnClickListener((v) -> {
if (neutralListener != null)
if (neutralListener != null) {
neutralListener.onClick(dialog, DialogInterface.BUTTON_NEUTRAL);
}
dialog.dismiss();
});
return this;

View File

@@ -3,7 +3,6 @@ package com.topjohnwu.magisk.components;
import android.app.Activity;
import android.support.annotation.StringRes;
import android.support.design.widget.Snackbar;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
@@ -34,8 +33,7 @@ public class SnackbarMaker {
private static void setup(Snackbar snack) {
TextView text = ButterKnife.findById(snack.getView(), android.support.design.R.id.snackbar_text);
text.setMaxLines(2);
text.setEllipsize(TextUtils.TruncateAt.START);
text.setMaxLines(Integer.MAX_VALUE);
}
}