From 706d1aadd833f6fa60de8ac308c62919adf45dc4 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Fri, 30 Aug 2024 09:49:48 +1000 Subject: [PATCH] fixing up clear data dialog Removing unused code --- .../securesms/SessionDialogBuilder.kt | 24 +------------------ .../reactions/ReactionRecipientsAdapter.java | 3 --- .../main/res/layout/dialog_clear_all_data.xml | 5 ++-- app/src/main/res/values/colors.xml | 4 ---- app/src/main/res/values/dimens.xml | 1 + 5 files changed, 4 insertions(+), 33 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/SessionDialogBuilder.kt b/app/src/main/java/org/thoughtcrime/securesms/SessionDialogBuilder.kt index 8d40dd2785..f780c80870 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/SessionDialogBuilder.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/SessionDialogBuilder.kt @@ -46,27 +46,7 @@ class SessionDialogBuilder(val context: Context) { .apply { orientation = VERTICAL } .also(dialogBuilder::setCustomTitle) - // Maximum height of the dialog. This comes into play in the Open URL dialog where we - // might have a a very, very long URL (which we provide a ScrollView for) - but without - // limiting the height of the dialog, the WRAP_CONTENT part can allow the dialog to be - // super tall! - // Note: I eye-balled this DP value for the max dialog height to make it match the - // height of regular not-scrollable dialogs. - val maxHeightInDp = 137 - val scale = context.resources.displayMetrics.density - val maxHeightInPx = (maxHeightInDp * scale + 0.5f).toInt() - - val contentView = LinearLayout(context).apply { - orientation = VERTICAL - - // Limit the max height of the dialog to the above value - viewTreeObserver.addOnGlobalLayoutListener { - if (height > maxHeightInPx) { - layoutParams.height = maxHeightInPx - requestLayout() - } - } - } + private val contentView = LinearLayout(context).apply { orientation = VERTICAL } private val buttonLayout = LinearLayout(context) @@ -157,8 +137,6 @@ class SessionDialogBuilder(val context: Context) { fun cancelButton(listener: (() -> Unit) = {}) = button(android.R.string.cancel, R.string.AccessibilityId_cancel) { listener() } - fun copyUrlButton(listener: (() -> Unit) = {}) = button(android.R.string.copyUrl, R.string.AccessibilityId_copy) { listener() } - fun button( @StringRes text: Int, @StringRes contentDescriptionRes: Int = text, diff --git a/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionRecipientsAdapter.java b/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionRecipientsAdapter.java index 08a9077a86..37bd7e4695 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionRecipientsAdapter.java +++ b/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionRecipientsAdapter.java @@ -62,9 +62,6 @@ final class ReactionRecipientsAdapter extends RecyclerView.Adapter