|
|
@ -5,9 +5,14 @@
|
|
|
|
package org.mozilla.fenix.settings.creditcards
|
|
|
|
package org.mozilla.fenix.settings.creditcards
|
|
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle
|
|
|
|
import android.os.Bundle
|
|
|
|
|
|
|
|
import androidx.navigation.fragment.findNavController
|
|
|
|
import androidx.preference.PreferenceFragmentCompat
|
|
|
|
import androidx.preference.PreferenceFragmentCompat
|
|
|
|
|
|
|
|
import mozilla.components.service.fxa.SyncEngine
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
|
|
|
|
import org.mozilla.fenix.ext.requireComponents
|
|
|
|
import org.mozilla.fenix.ext.showToolbar
|
|
|
|
import org.mozilla.fenix.ext.showToolbar
|
|
|
|
|
|
|
|
import org.mozilla.fenix.settings.SyncPreferenceView
|
|
|
|
|
|
|
|
import org.mozilla.fenix.settings.requirePreference
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* "Credit cards" settings fragment displays a list of settings related to autofilling, adding and
|
|
|
|
* "Credit cards" settings fragment displays a list of settings related to autofilling, adding and
|
|
|
@ -23,5 +28,27 @@ class CreditCardsSettingFragment : PreferenceFragmentCompat() {
|
|
|
|
super.onResume()
|
|
|
|
super.onResume()
|
|
|
|
|
|
|
|
|
|
|
|
showToolbar(getString(R.string.preferences_credit_cards))
|
|
|
|
showToolbar(getString(R.string.preferences_credit_cards))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SyncPreferenceView(
|
|
|
|
|
|
|
|
syncPreference = requirePreference(R.string.pref_key_credit_cards_sync_cards_across_devices),
|
|
|
|
|
|
|
|
lifecycleOwner = viewLifecycleOwner,
|
|
|
|
|
|
|
|
accountManager = requireComponents.backgroundServices.accountManager,
|
|
|
|
|
|
|
|
syncEngine = SyncEngine.Passwords,
|
|
|
|
|
|
|
|
onSignInToSyncClicked = {
|
|
|
|
|
|
|
|
val directions =
|
|
|
|
|
|
|
|
CreditCardsSettingFragmentDirections.actionCreditCardsSettingFragmentToTurnOnSyncFragment()
|
|
|
|
|
|
|
|
findNavController().navigate(directions)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onSyncStatusClicked = {
|
|
|
|
|
|
|
|
val directions =
|
|
|
|
|
|
|
|
CreditCardsSettingFragmentDirections.actionGlobalAccountSettingsFragment()
|
|
|
|
|
|
|
|
findNavController().navigate(directions)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onReconnectClicked = {
|
|
|
|
|
|
|
|
val directions =
|
|
|
|
|
|
|
|
CreditCardsSettingFragmentDirections.actionGlobalAccountProblemFragment()
|
|
|
|
|
|
|
|
findNavController().navigate(directions)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|