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

[fenix] For https://github.com/mozilla-mobile/fenix/issues/23433 - Align the provided top sites to the design spec

This commit is contained in:
Gabriel Luong 2022-01-31 13:47:10 -05:00 committed by mergify[bot]
parent ce32b61419
commit 7dcf99911f
4 changed files with 28 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import android.view.MotionEvent
import android.view.View import android.view.View
import android.widget.PopupWindow import android.widget.PopupWindow
import androidx.appcompat.content.res.AppCompatResources.getDrawable import androidx.appcompat.content.res.AppCompatResources.getDrawable
import androidx.core.view.isVisible
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Dispatchers.Main
@ -80,6 +81,8 @@ class TopSiteItemViewHolder(
} }
if (topSite is TopSite.Provided) { if (topSite is TopSite.Provided) {
binding.topSiteSubtitle.isVisible = true
CoroutineScope(IO).launch { CoroutineScope(IO).launch {
itemView.context.components.core.client.bitmapForUrl(topSite.imageUrl)?.let { bitmap -> itemView.context.components.core.client.bitmapForUrl(topSite.imageUrl)?.let { bitmap ->
withContext(Main) { withContext(Main) {

View File

@ -7,7 +7,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/top_site_item" android:id="@+id/top_site_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/top_sites_item_size" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/top_sites_item_margin_top" android:layout_marginTop="@dimen/top_sites_item_margin_top"
android:layout_marginBottom="@dimen/top_sites_item_margin_bottom" android:layout_marginBottom="@dimen/top_sites_item_margin_bottom"
android:orientation="vertical"> android:orientation="vertical">
@ -41,6 +41,26 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/favicon_card" app:layout_constraintTop_toBottomOf="@id/favicon_card"
tools:ignore="RtlCompat,SmallSp" /> tools:ignore="RtlCompat,SmallSp"
tools:text="Mozilla"/>
<TextView
android:id="@+id/top_site_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="84dp"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textAlignment="center"
android:singleLine="true"
android:text="@string/top_sites_sponsored_label"
android:textColor="@color/fx_mobile_text_color_secondary"
android:textSize="10sp"
android:visibility="invisible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/top_site_title"
tools:ignore="RtlCompat,SmallSp"
tools:visibility="visible"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -183,10 +183,9 @@
<dimen name="account_settings_device_name_min_height">48dp</dimen> <dimen name="account_settings_device_name_min_height">48dp</dimen>
<!-- Top sites --> <!-- Top sites -->
<dimen name="top_sites_item_size">84dp</dimen>
<dimen name="top_sites_item_margin_top">8dp</dimen> <dimen name="top_sites_item_margin_top">8dp</dimen>
<dimen name="top_sites_item_margin_bottom">12dp</dimen> <dimen name="top_sites_item_margin_bottom">12dp</dimen>
<dimen name="top_sites_text_margin_top">8dp</dimen> <dimen name="top_sites_text_margin_top">6dp</dimen>
<dimen name="top_sites_favicon_size">36dp</dimen> <dimen name="top_sites_favicon_size">36dp</dimen>
<dimen name="top_sites_favicon_elevation">0dp</dimen> <dimen name="top_sites_favicon_elevation">0dp</dimen>
<dimen name="top_sites_favicon_corner_size">4dp</dimen> <dimen name="top_sites_favicon_corner_size">4dp</dimen>

View File

@ -1905,6 +1905,8 @@
<string name="top_sites_menu_settings">Settings</string> <string name="top_sites_menu_settings">Settings</string>
<!-- Text for the menu button to navigate to sponsors and privacy support articles. '&amp;' is replaced with the ampersand symbol: & --> <!-- Text for the menu button to navigate to sponsors and privacy support articles. '&amp;' is replaced with the ampersand symbol: & -->
<string name="top_sites_menu_sponsor_privacy">Our sponsors &amp; your privacy</string> <string name="top_sites_menu_sponsor_privacy">Our sponsors &amp; your privacy</string>
<!-- Label text displayed for a sponsored top site. -->
<string name="top_sites_sponsored_label">Sponsored</string>
<!-- Inactive tabs in the tabs tray --> <!-- Inactive tabs in the tabs tray -->
<!-- Title text displayed in the tabs tray when a tab has been unused for 14 days. --> <!-- Title text displayed in the tabs tray when a tab has been unused for 14 days. -->