From 4461230e9bcda0a3203846c94f3184efaa72e6e5 Mon Sep 17 00:00:00 2001 From: ekager Date: Wed, 11 Sep 2019 20:06:10 -0700 Subject: [PATCH] For #5229, #5228 - Dismiss ETP panel on back press, don't truncate text --- .../TrackingProtectionPanelDialogFragment.kt | 7 ++++++- .../res/layout/component_tracking_protection_panel.xml | 4 +++- app/src/main/res/layout/switch_with_description.xml | 9 +++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionPanelDialogFragment.kt b/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionPanelDialogFragment.kt index aa611d16a..0781a9e49 100644 --- a/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionPanelDialogFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionPanelDialogFragment.kt @@ -212,5 +212,10 @@ class TrackingProtectionPanelDialogFragment : AppCompatDialogFragment(), BackHan return this } - override fun onBackPressed(): Boolean = trackingProtectionView.onBackPressed() + override fun onBackPressed(): Boolean { + if (!trackingProtectionView.onBackPressed()) { + dismiss() + } + return true + } } diff --git a/app/src/main/res/layout/component_tracking_protection_panel.xml b/app/src/main/res/layout/component_tracking_protection_panel.xml index 24eee13aa..813133c7c 100644 --- a/app/src/main/res/layout/component_tracking_protection_panel.xml +++ b/app/src/main/res/layout/component_tracking_protection_panel.xml @@ -29,9 +29,11 @@ diff --git a/app/src/main/res/layout/switch_with_description.xml b/app/src/main/res/layout/switch_with_description.xml index 7b484e98a..3f2405e06 100644 --- a/app/src/main/res/layout/switch_with_description.xml +++ b/app/src/main/res/layout/switch_with_description.xml @@ -2,14 +2,14 @@ - + android:layout_height="match_parent"> - +