For FNX-22339: UI components for recently added bookmarks (#19953)
* Top level layout with recyclerview for recent bookmarks * Add layout for recent bookmarked item, including strings and styles. * Header layout for recently saved bookmarks * Address review comments * Include the header for recent bookmarks in the component layout * Add dark theme colors for button and title styles * Recent bookmark card title text color for dark mode/light modeupstream-sync
parent
efea115694
commit
e373f507a1
@ -0,0 +1,8 @@
|
||||
<?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/. -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:color="@color/photonDarkGrey05" />
|
||||
<item android:state_checked="false" android:color="@color/photonLightGrey50" />
|
||||
</selector>
|
@ -0,0 +1,8 @@
|
||||
<?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/. -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:color="@color/photonDarkGrey05" />
|
||||
<item android:state_checked="false" android:color="@color/photonLightGrey05" />
|
||||
</selector>
|
@ -0,0 +1,8 @@
|
||||
<?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/. -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:color="@color/photonDarkGrey90" />
|
||||
<item android:state_checked="false" android:color="@color/photonLightGrey30" />
|
||||
</selector>
|
@ -0,0 +1,30 @@
|
||||
<?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/. -->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:isScrollContainer="true"
|
||||
android:gravity="start">
|
||||
|
||||
<include layout="@layout/recent_bookmarks_header" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recent_bookmarks_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:minWidth="448dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:overScrollMode="never"
|
||||
android:nestedScrollingEnabled="false"
|
||||
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:spanCount="4"
|
||||
tools:listitem="@layout/recent_bookmark_item" />
|
||||
</LinearLayout>
|
@ -0,0 +1,57 @@
|
||||
<?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:id="@+id/bookmark_item"
|
||||
android:layout_width="@dimen/recent_bookmark_item_width"
|
||||
android:layout_height="@dimen/recent_bookmark_item_height"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/favicon_card"
|
||||
style="@style/RecentBookmarks.FaviconCard"
|
||||
android:importantForAccessibility="noHideDescendants"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" >
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/favicon_image"
|
||||
style="@style/recentBookmarkFavicon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bookmark_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/recent_bookmark_item_title_height"
|
||||
android:maxHeight="@dimen/recent_bookmark_item_title_height"
|
||||
android:layout_marginTop="@dimen/recent_bookmark_item_favicon_height"
|
||||
android:paddingTop="@dimen/recent_bookmark_item_title_padding_top"
|
||||
android:paddingStart="@dimen/recent_bookmark_item_padding"
|
||||
android:paddingEnd="@dimen/recent_bookmark_item_padding"
|
||||
android:textAppearance="@style/recentBookmarkItemTitleText"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/favicon_image"
|
||||
tools:text="Recently Saved bookmark item" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bookmark_subtitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/recent_bookmark_item_subtitle_height"
|
||||
android:layout_marginTop="@dimen/recent_bookmark_item_subtitle_margin_top"
|
||||
android:paddingStart="@dimen/recent_bookmark_item_padding"
|
||||
android:paddingEnd="@dimen/recent_bookmark_item_padding"
|
||||
android:textAppearance="@style/recentBookmarkItemSubTitleText"
|
||||
app:layout_constraintBottom_toBottomOf="@id/bookmark_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:text="Subtitle text" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,39 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/Header20TextStyle"
|
||||
android:id="@+id/recentlySavedBookmarksHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/recently_saved_bookmarks_content_description"
|
||||
android:text="@string/recently_saved_bookmarks"
|
||||
android:layout_marginTop="@dimen/home_recently_saved_padding_top"
|
||||
android:paddingStart="@dimen/home_recently_saved_padding_start"
|
||||
android:paddingBottom="@dimen/home_recently_saved_padding_bottom"
|
||||
android:maxLines="2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/showAllBookmarksButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button12TextStyle"
|
||||
android:contentDescription="@string/recently_saved_show_all_content_description"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:text="@string/recently_saved_show_all"
|
||||
android:paddingStart="@dimen/home_recently_saved_padding_start"
|
||||
android:paddingEnd="@dimen/home_recently_saved_padding_end"
|
||||
android:paddingTop="@dimen/home_show_all_padding_top"
|
||||
android:paddingBottom="@dimen/home_show_all_padding_bottom"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/recentlySavedBookmarksHeader" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue