From a08a4a976cc1468f383a9b8d77d99937bf395a89 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Tue, 5 Apr 2022 17:04:40 +0600 Subject: [PATCH] 168-Fix_popup_icon_size_issue issue: https://gitlab.e.foundation/e/os/backlog/-/issues/168 icons of popup view should be in 24dp. convert extra width & height into padding for popup view icons --- .../sourceforge/opencamera/ui/PopupView.java | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/net/sourceforge/opencamera/ui/PopupView.java b/app/src/main/java/net/sourceforge/opencamera/ui/PopupView.java index 96435786e..875dc0385 100644 --- a/app/src/main/java/net/sourceforge/opencamera/ui/PopupView.java +++ b/app/src/main/java/net/sourceforge/opencamera/ui/PopupView.java @@ -1251,7 +1251,7 @@ public class PopupView extends LinearLayout { actual_max_per_row = Math.min(actual_max_per_row, max_buttons_per_row); int button_width_dp = total_width_dp/actual_max_per_row; boolean use_scrollview = false; - final int min_button_width_dp = 48; // needs to be at least 48dp to avoid Google Play pre-launch accessibility report warnings + final int min_button_width_dp = 24; // needs to be at least 48dp to avoid Google Play pre-launch accessibility report warnings if( button_width_dp < min_button_width_dp && max_buttons_per_row == 0 ) { button_width_dp = min_button_width_dp; use_scrollview = true; @@ -1277,6 +1277,13 @@ public class PopupView extends LinearLayout { if( MyDebug.LOG ) Log.d(TAG, "addButtonOptionsToPopup time 2.05: " + (System.nanoTime() - debug_time)); + int padding_dp = 0; + if (button_width_dp > min_button_width_dp) { + padding_dp = button_width_dp - min_button_width_dp; + padding_dp /= 2; + } + final int imageButtonPadding = (int) (padding_dp * scale + 0.5f); + for(int button_indx=0;button_indx