From 132ff01750736313c9755c6cce309e45d261033e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sun, 25 Oct 2020 13:26:45 +0000 Subject: [PATCH] Fix custom dc --- .../src/main/java/org/telegram/ui/LoginActivity.java | 4 ++++ .../src/main/java/tw/nekomimi/nekogram/BottomBuilder.kt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index 4cb8a8db9..56107c29f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -860,6 +860,10 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No return Unit.INSTANCE; + } else { + + builder.dismiss(); + } } diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/BottomBuilder.kt b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/BottomBuilder.kt index e4c1effc5..4691d70d2 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/BottomBuilder.kt +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/BottomBuilder.kt @@ -248,7 +248,7 @@ class BottomBuilder(val ctx: Context) { } @JvmOverloads - fun addButton(text: String, red: Boolean = false, left: Boolean = false, listener: ((TextView) -> Unit)): TextView { + fun addButton(text: String, noAutoDismiss: Boolean = false, left: Boolean = false, listener: ((TextView) -> Unit)): TextView { return TextView(ctx).apply { @@ -262,7 +262,7 @@ class BottomBuilder(val ctx: Context) { setText(text) typeface = AndroidUtilities.getTypeface("fonts/rmedium.ttf") (if (left) buttonsView else rightButtonsView).addView(this, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, Gravity.TOP or Gravity.LEFT)) - setOnClickListener { dismiss();listener(this) } + setOnClickListener { if (!noAutoDismiss) dismiss();listener(this) } }