1
0
Fork 0

For #9583: Increase touch targets for onboarding elements.

master
mcarare 2020-05-29 19:22:08 +03:00 committed by Emily Kager
parent 713b004488
commit c4f7a32eae
8 changed files with 71 additions and 49 deletions

View File

@ -5,7 +5,7 @@
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
import android.view.View
import android.widget.Switch
import androidx.appcompat.widget.SwitchCompat
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.*
import org.mozilla.fenix.R
@ -17,7 +17,7 @@ class OnboardingTrackingProtectionViewHolder(view: View) : RecyclerView.ViewHold
private var standardTrackingProtection: OnboardingRadioButton
private var strictTrackingProtection: OnboardingRadioButton
private var trackingProtectionToggle: Switch
private var trackingProtectionToggle: SwitchCompat
init {
view.header_text.setOnboardingIcon(R.drawable.ic_onboarding_tracking_protection)

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!-- 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/. -->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item
android:bottom="6dp"
android:top="6dp">
<shape android:shape="rectangle">
<corners android:radius="4dp" />
</shape>
</item>
</ripple>

View File

@ -4,7 +4,8 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<Button xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/PositiveButton"
android:layout_height="36dp"
android:id="@+id/finish_button"
android:layout_marginBottom="16dp"
android:background="@drawable/onboarding_padded_background"
android:backgroundTint="?accent"
android:layout_marginBottom="10dp"
android:text="@string/onboarding_finish" />

View File

@ -25,8 +25,8 @@
<Button
style="@style/NeutralButton"
android:id="@+id/turn_on_sync_button"
android:layout_height="36dp"
android:layout_marginTop="16dp"
android:background="@drawable/onboarding_padded_background"
android:layout_marginTop="10dp"
android:text="@string/onboarding_firefox_account_sign_in"
app:backgroundTint="@color/foundation_light_theme" />
</LinearLayout>

View File

@ -38,7 +38,7 @@
style="@style/NeutralOnboardingButton"
android:id="@+id/read_button"
android:text="@string/onboarding_privacy_notice_read_button"
android:layout_marginTop="16dp"
android:layout_marginTop="10dp"
app:layout_constraintTop_toBottomOf="@id/description_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -23,10 +23,12 @@
app:layout_constraintTop_toTopOf="parent"
tools:drawableStart="@drawable/ic_onboarding_tracking_protection" />
<Switch
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tracking_protection_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="48dp"
android:minHeight="48dp"
app:layout_constraintBottom_toBottomOf="@id/header_text"
app:layout_constraintEnd_toEndOf="parent"
android:theme="@style/Checkable.Colored"

View File

@ -3,47 +3,53 @@
- 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/. -->
<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:id="@+id/onboarding_card"
style="@style/OnboardingCardLightWithPadding"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/header_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/onboarding_whats_new_header1"
tools:drawableStart="@drawable/ic_whats_new"
android:drawablePadding="12dp"
android:textAppearance="@style/HeaderTextStyle"
android:gravity="center_vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
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:id="@+id/onboarding_card"
style="@style/OnboardingCardLight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/description_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/Body14TextStyle"
android:layout_marginTop="12dp"
tools:text="@string/onboarding_whats_new_description"
app:layout_constraintTop_toBottomOf="@id/header_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/get_answers"/>
android:id="@+id/header_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawablePadding="12dp"
android:gravity="center_vertical"
android:text="@string/onboarding_whats_new_header1"
android:textAppearance="@style/HeaderTextStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:drawableStart="@drawable/ic_whats_new" />
<TextView
android:id="@+id/get_answers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/Body14TextStyle"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:text="@string/onboarding_whats_new_description_linktext"
app:layout_constraintTop_toBottomOf="@id/description_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
android:id="@+id/description_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textAppearance="@style/Body14TextStyle"
app:layout_constraintBottom_toTopOf="@id/get_answers"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/header_text"
tools:text="@string/onboarding_whats_new_description" />
<TextView
android:id="@+id/get_answers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="18dp"
android:text="@string/onboarding_whats_new_description_linktext"
android:textAppearance="@style/Body14TextStyle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/description_text" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -248,8 +248,8 @@
<!-- Ideally we should consolidate this with NeutralButton in the future -->
<style name="NeutralOnboardingButton" parent="NeutralButton">
<item name="android:background">@drawable/onboarding_padded_background</item>
<item name="backgroundTint">?neutralFaded</item>
<item name="android:layout_height">36dp</item>
<item name="android:textColor">?primaryText</item>
</style>