From d14f2a098c6b4ea8a2e5bc8024f686b90b75f1d3 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Mon, 9 Nov 2020 19:48:38 +0900 Subject: [PATCH] Fix context leak due to static textview in settings --- .../settings/SettingsPreferencesFragment.java | 5 ++--- .../main/res/layout/pref_custom_folder.xml | 20 +++++++------------ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java index 4c6b6359..25defbd7 100644 --- a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java @@ -35,7 +35,6 @@ import static awais.instagrabber.utils.Utils.settingsHelper; public class SettingsPreferencesFragment extends BasePreferencesFragment { private static final String TAG = "SettingsPrefsFrag"; - private static AppCompatTextView customPathTextView; private boolean isLoggedIn; @Override @@ -293,9 +292,9 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment { } public static class SaveToCustomFolderPreference extends Preference { - + private AppCompatTextView customPathTextView; private final OnSelectFolderButtonClickListener onSelectFolderButtonClickListener; - private String key; + private final String key; public SaveToCustomFolderPreference(final Context context, final OnSelectFolderButtonClickListener onSelectFolderButtonClickListener) { super(context); diff --git a/app/src/main/res/layout/pref_custom_folder.xml b/app/src/main/res/layout/pref_custom_folder.xml index 03a6aa5c..c994d057 100644 --- a/app/src/main/res/layout/pref_custom_folder.xml +++ b/app/src/main/res/layout/pref_custom_folder.xml @@ -8,8 +8,7 @@ android:gravity="center_vertical" android:minHeight="?android:attr/listPreferredItemHeight" android:orientation="vertical" - android:paddingEnd="?android:attr/scrollbarSize" - android:paddingRight="?android:attr/scrollbarSize"> + android:paddingEnd="?android:attr/scrollbarSize"> + android:paddingEnd="10dp" /> @@ -68,8 +63,7 @@ android:id="@+id/button_container" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="15dip" - android:layout_marginLeft="15dip" + android:layout_marginStart="15dp" android:gravity="center_vertical" android:orientation="horizontal" android:visibility="gone"