[fenix] For https://github.com/mozilla-mobile/fenix/issues/24969 - Display address autofill prompt

pull/600/head
Alexandru2909 2 years ago committed by mergify[bot]
parent 2c2ee2a49d
commit 1e3024e560

@ -76,6 +76,7 @@ import mozilla.components.feature.session.PictureInPictureFeature
import mozilla.components.feature.session.SessionFeature import mozilla.components.feature.session.SessionFeature
import mozilla.components.feature.session.SwipeRefreshFeature import mozilla.components.feature.session.SwipeRefreshFeature
import mozilla.components.concept.engine.permission.SitePermissions import mozilla.components.concept.engine.permission.SitePermissions
import mozilla.components.feature.prompts.address.AddressDelegate
import mozilla.components.feature.session.ScreenOrientationFeature import mozilla.components.feature.session.ScreenOrientationFeature
import mozilla.components.feature.sitepermissions.SitePermissionsFeature import mozilla.components.feature.sitepermissions.SitePermissionsFeature
import mozilla.components.lib.state.ext.consumeFlow import mozilla.components.lib.state.ext.consumeFlow
@ -636,6 +637,14 @@ abstract class BaseBrowserFragment :
}, },
onSelectCreditCard = { onSelectCreditCard = {
showBiometricPrompt(context) showBiometricPrompt(context)
},
addressDelegate = object : AddressDelegate {
override val addressPickerView
get() = binding.addressSelectBar
override val onManageAddresses = {
val directions = NavGraphDirections.actionGlobalAutofillSettingFragment()
findNavController().navigate(directions)
}
} }
), ),
owner = this, owner = this,

@ -18,7 +18,7 @@
android:id="@+id/browserLayout" android:id="@+id/browserLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/creditCardSelectBar" app:layout_constraintBottom_toTopOf="@+id/addressSelectBar"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:context="browser.BrowserFragment"> tools:context="browser.BrowserFragment">
@ -68,13 +68,21 @@
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
<mozilla.components.feature.prompts.address.AddressSelectBar
android:visibility="gone"
android:id="@+id/addressSelectBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/creditCardSelectBar"
app:layout_constraintTop_toBottomOf="@id/browserLayout" />
<mozilla.components.feature.prompts.creditcard.CreditCardSelectBar <mozilla.components.feature.prompts.creditcard.CreditCardSelectBar
android:visibility="gone" android:visibility="gone"
android:id="@+id/creditCardSelectBar" android:id="@+id/creditCardSelectBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/loginSelectBar" app:layout_constraintBottom_toTopOf="@id/loginSelectBar"
app:layout_constraintTop_toBottomOf="@id/browserLayout" /> app:layout_constraintTop_toBottomOf="@id/addressSelectBar" />
<mozilla.components.feature.prompts.login.LoginSelectBar <mozilla.components.feature.prompts.login.LoginSelectBar
android:visibility="gone" android:visibility="gone"

@ -30,6 +30,7 @@
tools:ignore="UnusedResources">@color/fx_mobile_text_color_warning</item> tools:ignore="UnusedResources">@color/fx_mobile_text_color_warning</item>
<item name="mozacLoginSelectHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item> <item name="mozacLoginSelectHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item>
<item name="mozacSelectCreditCardHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item> <item name="mozacSelectCreditCardHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item>
<item name="mozacSelectAddressHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item>
<!-- Design system color attributes --> <!-- Design system color attributes -->
@ -227,6 +228,7 @@
tools:ignore="UnusedResources">@color/fx_mobile_private_text_color_warning</item> tools:ignore="UnusedResources">@color/fx_mobile_private_text_color_warning</item>
<item name="mozacLoginSelectHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item> <item name="mozacLoginSelectHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item>
<item name="mozacSelectCreditCardHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item> <item name="mozacSelectCreditCardHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item>
<item name="mozacSelectAddressHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item>
<!-- Design system color attributes --> <!-- Design system color attributes -->

Loading…
Cancel
Save