For #5551 - Adds select login prompts

pull/35/head
ekager 4 years ago committed by Emily Kager
parent 88a539ee5a
commit 53eebd681b

@ -487,7 +487,16 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
}, },
onNeedToRequestPermissions = { permissions -> onNeedToRequestPermissions = { permissions ->
requestPermissions(permissions, REQUEST_CODE_PROMPT_PERMISSIONS) requestPermissions(permissions, REQUEST_CODE_PROMPT_PERMISSIONS)
}), },
loginPickerView = loginSelectBar,
onManageLogins = {
browserAnimator.captureEngineViewAndDrawStatically {
val directions =
NavGraphDirections.actionGlobalSavedLoginsAuthFragment()
findNavController().navigate(directions)
}
}
),
owner = this, owner = this,
view = view view = view
) )

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- This Source Code Form is subject to the terms of the Mozilla Public <?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 - 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/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<org.mozilla.fenix.browser.SwipeGestureLayout xmlns:android="http://schemas.android.com/apk/res/android" <org.mozilla.fenix.browser.SwipeGestureLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -8,53 +9,68 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/browserLayout" android:id="@+id/browserWindow"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
tools:context="browser.BrowserFragment">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/swipeRefresh" android:id="@+id/browserLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="0dp"
android:alpha="0" app:layout_constraintBottom_toTopOf="@+id/loginSelectBar"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_constraintTop_toTopOf="parent"
tools:context="browser.BrowserFragment">
<mozilla.components.concept.engine.EngineView <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/engineView" android:id="@+id/swipeRefresh"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone" /> android:alpha="0"
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> app:layout_behavior="@string/appbar_scrolling_view_behavior">
<mozilla.components.concept.engine.EngineView
android:id="@+id/engineView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<ViewStub <ViewStub
android:id="@+id/stubFindInPage" android:id="@+id/stubFindInPage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="56dp"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:inflatedId="@+id/findInPageView" android:inflatedId="@+id/findInPageView"
android:layout="@layout/stub_find_in_page" /> android:layout="@layout/stub_find_in_page" />
<include <include
android:id="@+id/viewDynamicDownloadDialog" android:id="@+id/viewDynamicDownloadDialog"
layout="@layout/download_dialog_layout" layout="@layout/download_dialog_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:visibility="gone" /> android:visibility="gone" />
<mozilla.components.feature.readerview.view.ReaderViewControlsBar
android:id="@+id/readerViewControlsBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?foundation"
android:elevation="24dp"
android:visibility="gone" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<mozilla.components.feature.readerview.view.ReaderViewControlsBar <mozilla.components.feature.prompts.login.LoginSelectBar
android:id="@+id/readerViewControlsBar" android:visibility="gone"
android:id="@+id/loginSelectBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" app:layout_constraintBottom_toBottomOf="parent"
android:background="?foundation" app:layout_constraintTop_toBottomOf="@id/browserLayout" />
android:elevation="24dp" </androidx.constraintlayout.widget.ConstraintLayout>
android:visibility="gone" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<org.mozilla.fenix.browser.TabPreview <org.mozilla.fenix.browser.TabPreview
android:id="@+id/tabPreview" android:id="@+id/tabPreview"

@ -50,6 +50,7 @@
<color name="readermode_end_gradient_normal_theme">#00B3F4</color> <color name="readermode_end_gradient_normal_theme">#00B3F4</color>
<color name="search_suggestion_indicator_icon_color_normal_theme">@color/search_suggestion_indicator_icon_color_dark_theme</color> <color name="search_suggestion_indicator_icon_color_normal_theme">@color/search_suggestion_indicator_icon_color_dark_theme</color>
<color name="search_suggestion_indicator_icon_bookmark_color_normal_theme">@color/search_suggestion_indicator_icon_bookmark_color_dark_theme</color> <color name="search_suggestion_indicator_icon_bookmark_color_normal_theme">@color/search_suggestion_indicator_icon_bookmark_color_dark_theme</color>
<color name="select_login_header_normal_theme">@color/accent_high_contrast_dark_theme</color>
<color name="mozac_widget_favicon_background_normal_theme">@color/mozac_widget_favicon_background_dark_theme</color> <color name="mozac_widget_favicon_background_normal_theme">@color/mozac_widget_favicon_background_dark_theme</color>
<color name="mozac_widget_favicon_border_normal_theme">@color/mozac_widget_favicon_border_dark_theme</color> <color name="mozac_widget_favicon_border_normal_theme">@color/mozac_widget_favicon_border_dark_theme</color>

@ -93,4 +93,5 @@
<attr name="onboardingKeyDescription" format="reference" /> <attr name="onboardingKeyDescription" format="reference" />
</declare-styleable> </declare-styleable>
<attr name="selectLoginHeaderTextColor" format="reference"/>
</resources> </resources>

@ -250,7 +250,7 @@
<color name="prompt_login_edit_text_cursor_color_normal_theme">@color/prompt_login_edit_text_cursor_color_light_theme</color> <color name="prompt_login_edit_text_cursor_color_normal_theme">@color/prompt_login_edit_text_cursor_color_light_theme</color>
<color name="search_suggestion_indicator_icon_color_normal_theme">@color/search_suggestion_indicator_icon_color_light_theme</color> <color name="search_suggestion_indicator_icon_color_normal_theme">@color/search_suggestion_indicator_icon_color_light_theme</color>
<color name="search_suggestion_indicator_icon_bookmark_color_normal_theme">@color/search_suggestion_indicator_icon_bookmark_color_light_theme</color> <color name="search_suggestion_indicator_icon_bookmark_color_normal_theme">@color/search_suggestion_indicator_icon_bookmark_color_light_theme</color>
<color name="select_login_header_normal_theme">@color/accent_bright_light_theme</color>
<color name="mozac_widget_favicon_background_normal_theme">@color/mozac_widget_favicon_background_light_theme</color> <color name="mozac_widget_favicon_background_normal_theme">@color/mozac_widget_favicon_background_light_theme</color>
<color name="mozac_widget_favicon_border_normal_theme">@color/mozac_widget_favicon_border_light_theme</color> <color name="mozac_widget_favicon_border_normal_theme">@color/mozac_widget_favicon_border_light_theme</color>

@ -27,6 +27,7 @@
tools:ignore="UnusedResources">@color/destructive_normal_theme</item> tools:ignore="UnusedResources">@color/destructive_normal_theme</item>
<item name="mozacInputLayoutErrorIconColor" <item name="mozacInputLayoutErrorIconColor"
tools:ignore="UnusedResources">@color/destructive_normal_theme</item> tools:ignore="UnusedResources">@color/destructive_normal_theme</item>
<item name="mozacLoginSelectHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectLoginHeaderTextStyle</item>
<!-- Active thumb color & Active track color (30% transparency) --> <!-- Active thumb color & Active track color (30% transparency) -->
<item name="colorControlActivated">@color/accent_high_contrast_normal_theme</item> <item name="colorControlActivated">@color/accent_high_contrast_normal_theme</item>
@ -79,7 +80,7 @@
<item name="syncedTabsSeparator">@color/synced_tabs_separator</item> <item name="syncedTabsSeparator">@color/synced_tabs_separator</item>
<item name="awesomeBarIndicatorColor">@color/search_suggestion_indicator_icon_color_normal_theme</item> <item name="awesomeBarIndicatorColor">@color/search_suggestion_indicator_icon_color_normal_theme</item>
<item name="awesomeBarIndicatorBookmarkColor">@color/search_suggestion_indicator_icon_bookmark_color_normal_theme</item> <item name="awesomeBarIndicatorBookmarkColor">@color/search_suggestion_indicator_icon_bookmark_color_normal_theme</item>
<item name="selectLoginHeaderTextColor">@color/select_login_header_normal_theme</item>
<!-- Shared widget colors --> <!-- Shared widget colors -->
<item name="mozac_primary_text_color">@color/primary_text_normal_theme</item> <item name="mozac_primary_text_color">@color/primary_text_normal_theme</item>
<item name="mozac_caption_text_color">@color/caption_text_normal_theme</item> <item name="mozac_caption_text_color">@color/caption_text_normal_theme</item>
@ -126,6 +127,11 @@
<item name="buttonBarPositiveButtonStyle">@style/DialogButtonStyleLight</item> <item name="buttonBarPositiveButtonStyle">@style/DialogButtonStyleLight</item>
</style> </style>
<style name="SelectLoginHeaderTextStyle" parent="Header16TextStyle">
<item name="android:textColor">?selectLoginHeaderTextColor</item>
<item name="drawableTint">?accentHighContrast</item>
</style>
<style name="Checkable.Colored" parent="Theme.AppCompat"> <style name="Checkable.Colored" parent="Theme.AppCompat">
<item name="colorControlActivated">?attr/onboardingSelected</item> <item name="colorControlActivated">?attr/onboardingSelected</item>
<item name="colorControlNormal">?attr/onboardingDeselected</item> <item name="colorControlNormal">?attr/onboardingDeselected</item>
@ -174,6 +180,7 @@
tools:ignore="UnusedResources">@color/destructive_private_theme</item> tools:ignore="UnusedResources">@color/destructive_private_theme</item>
<item name="mozacInputLayoutErrorIconColor" <item name="mozacInputLayoutErrorIconColor"
tools:ignore="UnusedResources">@color/destructive_private_theme</item> tools:ignore="UnusedResources">@color/destructive_private_theme</item>
<item name="mozacLoginSelectHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectLoginHeaderTextStyle</item>
<!-- Inactive thumb color --> <!-- Inactive thumb color -->
<item name="colorSwitchThumbNormal">@color/toggle_off_knob_dark_theme</item> <item name="colorSwitchThumbNormal">@color/toggle_off_knob_dark_theme</item>
@ -221,6 +228,7 @@
<item name="mozacPromptLoginEditTextCursorColor">@color/prompt_login_edit_text_cursor_color_private_theme</item> <item name="mozacPromptLoginEditTextCursorColor">@color/prompt_login_edit_text_cursor_color_private_theme</item>
<item name="awesomeBarIndicatorColor">@color/search_suggestion_indicator_icon_color_dark_theme</item> <item name="awesomeBarIndicatorColor">@color/search_suggestion_indicator_icon_color_dark_theme</item>
<item name="awesomeBarIndicatorBookmarkColor">@color/search_suggestion_indicator_icon_bookmark_color_dark_theme</item> <item name="awesomeBarIndicatorBookmarkColor">@color/search_suggestion_indicator_icon_bookmark_color_dark_theme</item>
<item name="selectLoginHeaderTextColor">@color/accent_high_contrast_private_theme</item>
<!-- Shared widget colors --> <!-- Shared widget colors -->
<item name="mozac_primary_text_color">@color/primary_text_private_theme</item> <item name="mozac_primary_text_color">@color/primary_text_private_theme</item>

Loading…
Cancel
Save