2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

For #5551 - Adds select login prompts

This commit is contained in:
ekager 2020-08-19 22:05:41 -04:00 committed by Emily Kager
parent 88a539ee5a
commit 53eebd681b
6 changed files with 74 additions and 39 deletions

View File

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

View File

@ -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
- 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"
@ -8,53 +9,68 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/browserLayout"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/browserWindow"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="browser.BrowserFragment">
android:layout_height="match_parent">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresh"
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/browserLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/loginSelectBar"
app:layout_constraintTop_toTopOf="parent"
tools:context="browser.BrowserFragment">
<mozilla.components.concept.engine.EngineView
android:id="@+id/engineView"
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
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
android:id="@+id/stubFindInPage"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="bottom"
android:inflatedId="@+id/findInPageView"
android:layout="@layout/stub_find_in_page" />
<include
android:id="@+id/viewDynamicDownloadDialog"
layout="@layout/download_dialog_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:visibility="gone" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<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" />
<ViewStub
android:id="@+id/stubFindInPage"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="bottom"
android:inflatedId="@+id/findInPageView"
android:layout="@layout/stub_find_in_page" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<include
android:id="@+id/viewDynamicDownloadDialog"
layout="@layout/download_dialog_layout"
<mozilla.components.feature.prompts.login.LoginSelectBar
android:visibility="gone"
android:id="@+id/loginSelectBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
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>
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/browserLayout" />
</androidx.constraintlayout.widget.ConstraintLayout>
<org.mozilla.fenix.browser.TabPreview
android:id="@+id/tabPreview"

View File

@ -50,6 +50,7 @@
<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_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_border_normal_theme">@color/mozac_widget_favicon_border_dark_theme</color>

View File

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

View File

@ -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="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="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_border_normal_theme">@color/mozac_widget_favicon_border_light_theme</color>

View File

@ -27,6 +27,7 @@
tools:ignore="UnusedResources">@color/destructive_normal_theme</item>
<item name="mozacInputLayoutErrorIconColor"
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) -->
<item name="colorControlActivated">@color/accent_high_contrast_normal_theme</item>
@ -79,7 +80,7 @@
<item name="syncedTabsSeparator">@color/synced_tabs_separator</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="selectLoginHeaderTextColor">@color/select_login_header_normal_theme</item>
<!-- Shared widget colors -->
<item name="mozac_primary_text_color">@color/primary_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>
</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">
<item name="colorControlActivated">?attr/onboardingSelected</item>
<item name="colorControlNormal">?attr/onboardingDeselected</item>
@ -174,6 +180,7 @@
tools:ignore="UnusedResources">@color/destructive_private_theme</item>
<item name="mozacInputLayoutErrorIconColor"
tools:ignore="UnusedResources">@color/destructive_private_theme</item>
<item name="mozacLoginSelectHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectLoginHeaderTextStyle</item>
<!-- Inactive thumb color -->
<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="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="selectLoginHeaderTextColor">@color/accent_high_contrast_private_theme</item>
<!-- Shared widget colors -->
<item name="mozac_primary_text_color">@color/primary_text_private_theme</item>