1
0
Fork 0

Add accounts preferences

master
Emily Kager 2019-01-31 16:37:15 -08:00 committed by Jeff Boek
parent 0c893b356a
commit 179807b83f
5 changed files with 109 additions and 6 deletions

View File

@ -0,0 +1,19 @@
<?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:id="@android:id/mask">
<shape>
<solid android:color="#000000" />
<corners android:radius="8dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="#FFFFFF" />
<corners android:radius="8dp" />
</shape>
</item>
</ripple>

View File

@ -0,0 +1,57 @@
<?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/. -->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="@drawable/sign_in_preference_background"
android:clickable="true"
android:focusable="true"
android:elevation="4dp"
android:padding="16dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="44dp"
android:layout_height="60dp"
android:src="@drawable/ic_sessions_intro"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@android:id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:layout_marginBottom="10dp"
android:ellipsize="none"
android:scrollHorizontally="false"
android:singleLine="true"
android:text="Title"
android:textAppearance="?android:attr/textAppearanceMedium"
app:layout_constraintBottom_toTopOf="@android:id/summary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@android:id/summary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:ellipsize="none"
android:scrollHorizontally="false"
android:text="Summary"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -14,4 +14,6 @@
<string name="pref_key_rate" translatable="false">pref_key_rate</string>
<string name="pref_key_feedback" translatable="false">pref_key_feedback</string>
<string name="pref_key_about" translatable="false">pref_key_about</string>
<string name="pref_key_account" translatable="false">pref_key_account</string>
<string name="pref_key_sign_in" translatable="false">pref_key_sign_in</string>
</resources>

View File

@ -68,6 +68,15 @@
<!-- Preference for accessibility -->
<string name="preferences_accessibility">Accessibility</string>
<!-- Preference category for account information -->
<string name="preferences_category_account">Account</string>
<!-- Preference shown on banner to sign into account -->
<string name="preferences_sign_in">Sign in</string>
<!-- Preference description for banner about signing in -->
<string name="preferences_sign_in_description">Get your tabs, bookmarks, logins, history and more on all your devices</string>
<!-- Preference for language -->
<string name="preferences_language">Language</string>

View File

@ -6,7 +6,23 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
<androidx.preference.Preference
android:key="@string/pref_key_sign_in"
android:layout="@layout/sign_in_preference"
android:summary="@string/preferences_sign_in_description"
android:title="@string/preferences_sign_in" />
<androidx.preference.PreferenceCategory
android:title="@string/preferences_category_account"
app:iconSpaceReserved="false">
<androidx.preference.Preference
android:icon="@drawable/ic_shortcuts"
android:key="@string/pref_key_account"
android:summary="user@email.com"
android:title="User Name" />
</androidx.preference.PreferenceCategory>
<androidx.preference.PreferenceCategory
android:title="@string/preferences_category_basics"
app:iconSpaceReserved="false">
<androidx.preference.Preference
@ -27,9 +43,9 @@
<androidx.preference.SwitchPreference
android:key="@string/pref_key_make_default_browser"
android:title="@string/preferences_set_as_default_browser" />
</PreferenceCategory>
</androidx.preference.PreferenceCategory>
<PreferenceCategory
<androidx.preference.PreferenceCategory
android:title="@string/preferences_category_advanced"
app:iconSpaceReserved="false">
<androidx.preference.Preference
@ -48,9 +64,9 @@
android:icon="@drawable/ic_data_collection"
android:key="@string/pref_key_data_choices"
android:title="@string/preferences_data_choices" />
</PreferenceCategory>
</androidx.preference.PreferenceCategory>
<PreferenceCategory
<androidx.preference.PreferenceCategory
android:title="@string/preferences_category_about"
app:iconSpaceReserved="false">
<androidx.preference.Preference
@ -69,5 +85,5 @@
android:icon="@drawable/ic_about"
android:key="@string/pref_key_about"
android:title="@string/preferences_about" />
</PreferenceCategory>
</androidx.preference.PreferenceCategory>
</androidx.preference.PreferenceScreen>