[fenix] For https://github.com/mozilla-mobile/fenix/issues/18240 - Add a Credit Card preference screen (https://github.com/mozilla-mobile/fenix/pull/18410)
- Removes an unused preference key "pref_key_credit_cards_addresses"pull/600/head
parent
52ac8bde8d
commit
9272994178
@ -0,0 +1,27 @@
|
||||
/* 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/. */
|
||||
|
||||
package org.mozilla.fenix.settings.creditcards
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.ext.showToolbar
|
||||
|
||||
/**
|
||||
* "Credit cards" settings fragment displays a list of settings related to autofilling, adding and
|
||||
* syncing credit cards.
|
||||
*/
|
||||
class CreditCardsSettingFragment : PreferenceFragmentCompat() {
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
setPreferencesFromResource(R.xml.credit_cards_preferences, rootKey)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
showToolbar(getString(R.string.preferences_credit_cards))
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/credit_cards_add_credit_card_button_height"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:paddingStart="@dimen/top_bar_alignment_margin_start"
|
||||
tools:ignore="RtlSymmetry">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/add_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:importantForAccessibility="no"
|
||||
android:textAlignment="textStart"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_new" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/add_credit_card_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/credit_cards_add_credit_card_text_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/credit_cards_add_credit_card_text_horizontal_margin"
|
||||
android:text="@string/preferences_credit_cards_add_credit_card"
|
||||
android:textColor="?primaryText"
|
||||
android:textSize="@dimen/credit_cards_add_credit_card_text_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/add_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,20 @@
|
||||
<?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/. -->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="@string/pref_key_credit_cards_save_and_autofill_cards"
|
||||
android:summary="@string/preferences_credit_cards_save_and_autofill_cards_summary"
|
||||
android:title="@string/preferences_credit_cards_save_and_autofill_cards" />
|
||||
<Preference
|
||||
android:key="@string/pref_key_credit_cards_sync_cards_across_devices"
|
||||
android:title="@string/preferences_credit_cards_sync_cards_across_devices" />
|
||||
<Preference
|
||||
android:key="@string/pref_key_credit_cards_add_credit_card"
|
||||
android:title="@string/preferences_credit_cards_add_credit_card"
|
||||
android:layout="@layout/preference_credit_cards_add_credit_card"
|
||||
app:allowDividerAbove="true" />
|
||||
</PreferenceScreen>
|
Loading…
Reference in New Issue