1
0
Fork 0

For #5229, #5228 - Dismiss ETP panel on back press, don't truncate text

master
ekager 2019-09-11 20:06:10 -07:00 committed by Emily Kager
parent d3679e0625
commit 4461230e9b
3 changed files with 14 additions and 6 deletions

View File

@ -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
}
}

View File

@ -29,9 +29,11 @@
<org.mozilla.fenix.trackingprotection.SwitchWithDescription
android:id="@+id/tracking_protection"
android:layout_width="match_parent"
android:layout_height="@dimen/tracking_protection_item_height"
android:layout_height="wrap_content"
android:minHeight="@dimen/tracking_protection_item_height"
android:text="@string/preference_enhanced_tracking_protection"
app:layout_constraintTop_toBottomOf="@id/url"
app:layout_constraintBottom_toTopOf="@id/blocking_header"
app:switchDescription="@string/etp_panel_on"
app:switchIcon="@drawable/ic_tracking_protection"
app:switchTitle="@string/preference_enhanced_tracking_protection" />

View File

@ -2,14 +2,14 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="0dp"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
android:layout_height="match_parent">
<TextView
android:layout_marginTop="4dp"
android:id="@+id/switchItemTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -32,6 +32,7 @@
android:layout_height="wrap_content"
android:clickable="false"
android:textColor="?attr/secondaryText"
android:layout_marginBottom="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/switchItemTitle"
app:layout_constraintHorizontal_bias="0.5"
@ -50,4 +51,4 @@
app:layout_constraintBottom_toBottomOf="@id/switchItemDescription"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/switchItemTitle" />
</merge>
</androidx.constraintlayout.widget.ConstraintLayout>