2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-15 18:12:54 +00:00

For #13765 - Fix TopSites layout and item sizes (#14278)

This commit is contained in:
Codrut Topliceanu 2020-08-31 20:13:27 +03:00 committed by GitHub
parent 4a00131fa1
commit cfd799a6af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 17 deletions

View File

@ -3,12 +3,21 @@
- 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/. -->
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" <!--LinearLayout is used here because we are forced by the view pager
to keep layout_width="match_parent"-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/top_sites_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/top_sites_list"
android:layout_width="wrap_content"
android:minWidth="448dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clipChildren="false" android:clipChildren="false"
@ -18,3 +27,4 @@
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="4" app:spanCount="4"
tools:listitem="@layout/top_site_item" /> tools:listitem="@layout/top_site_item" />
</LinearLayout>

View File

@ -5,25 +5,27 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/top_site_item" android:id="@+id/top_site_item"
android:layout_width="64dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/top_sites_item_size"
android:padding="8dp" android:layout_marginBottom="@dimen/top_sites_item_margin_top"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/favicon_image" android:id="@+id/favicon_image"
style="@style/Mozac.Widgets.Favicon" style="@style/TopSite.Favicon"
android:layout_gravity="center" android:layout_gravity="center"
android:importantForAccessibility="no" /> android:importantForAccessibility="no" />
<TextView <TextView
android:id="@+id/top_site_title" android:id="@+id/top_site_title"
android:layout_width="match_parent" android:layout_width="64dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:singleLine="true" android:singleLine="true"
android:layout_gravity="center_horizontal"
android:textColor="@color/top_site_title_text" android:textColor="@color/top_site_title_text"
android:textSize="10sp" android:textSize="10sp"
android:layout_marginTop="8dp" /> android:layout_marginTop="@dimen/top_sites_text_margin_top" />
</LinearLayout> </LinearLayout>

View File

@ -169,6 +169,13 @@
<dimen name="saved_logins_item_margin_start">16dp</dimen> <dimen name="saved_logins_item_margin_start">16dp</dimen>
<dimen name="saved_logins_item_margin_end">48dp</dimen> <dimen name="saved_logins_item_margin_end">48dp</dimen>
<!-- Top sites -->
<dimen name="top_sites_favicon_size">40dp</dimen>
<dimen name="top_sites_favicon_padding">4dp</dimen>
<dimen name="top_sites_item_size">64dp</dimen>
<dimen name="top_sites_item_margin_top">12dp</dimen>
<dimen name="top_sites_text_margin_top">8dp</dimen>
<!-- a11y --> <!-- a11y -->
<dimen name="accessibility_min_height">48dp</dimen> <dimen name="accessibility_min_height">48dp</dimen>

View File

@ -622,6 +622,14 @@
<item name="behavior_halfExpandedRatio">0.4</item> <item name="behavior_halfExpandedRatio">0.4</item>
</style> </style>
<style name="TopSite.Favicon" parent="Mozac.Widgets.Favicon">
<item name="android:layout_width">@dimen/top_sites_favicon_size</item>
<item name="android:layout_height">@dimen/top_sites_favicon_size</item>
<item name="android:scaleType">fitCenter</item>
<item name="android:padding">@dimen/top_sites_favicon_padding</item>
<item name="android:background">@drawable/mozac_widget_favicon_background</item>
</style>
<style name="TabTrayFab" parent="Widget.MaterialComponents.ExtendedFloatingActionButton"> <style name="TabTrayFab" parent="Widget.MaterialComponents.ExtendedFloatingActionButton">
<item name="elevation">90dp</item> <item name="elevation">90dp</item>
<item name="android:stateListAnimator">@null</item> <item name="android:stateListAnimator">@null</item>