For #26606 - Add backplating to Top Sites
This commit is contained in:
parent
d4b6babdb0
commit
b1369a5de8
|
@ -9,6 +9,7 @@ import androidx.test.uiautomator.UiDevice
|
|||
import okhttp3.mockwebserver.MockWebServer
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Ignore
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.mozilla.fenix.R
|
||||
|
@ -240,6 +241,7 @@ class TopSitesTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Ignore("Failing after updates to Top Sites UI. See: https://github.com/mozilla-mobile/fenix/issues/26698")
|
||||
@SmokeTest
|
||||
@Test
|
||||
fun verifySponsoredShortcutsListTest() {
|
||||
|
|
|
@ -2,64 +2,73 @@
|
|||
<!-- 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"
|
||||
<FrameLayout
|
||||
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/top_site_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/top_sites_item_margin_bottom"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/favicon_card"
|
||||
style="@style/TopSite.FaviconCard"
|
||||
android:importantForAccessibility="noHideDescendants"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
style="@style/TopSite.Card">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/top_site_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/favicon_image"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
style="@style/topSiteFavicon"
|
||||
tools:src="@drawable/ic_pocket"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="bottom"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/favicon_image"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/top_site_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/top_sites_text_margin_top"
|
||||
android:drawablePadding="2dp"
|
||||
android:gravity="center"
|
||||
android:textAlignment="center"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/fx_mobile_text_color_primary"
|
||||
android:textSize="12sp"
|
||||
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: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="11sp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="RtlCompat,SmallSp"
|
||||
tools:visibility="visible"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/favicon_image"
|
||||
style="@style/topSiteFavicon" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/top_site_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxWidth="84dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/top_sites_text_margin_top"
|
||||
android:drawablePadding="2dp"
|
||||
android:gravity="center"
|
||||
android:textAlignment="center"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/fx_mobile_text_color_primary"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/favicon_card"
|
||||
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>
|
||||
</FrameLayout>
|
||||
|
|
|
@ -165,14 +165,16 @@
|
|||
<dimen name="account_settings_device_name_min_height">48dp</dimen>
|
||||
|
||||
<!-- Top sites -->
|
||||
<dimen name="top_sites_item_margin_top">4dp</dimen>
|
||||
<dimen name="top_sites_item_margin_bottom">12dp</dimen>
|
||||
<dimen name="top_sites_text_margin_top">6dp</dimen>
|
||||
<dimen name="top_sites_text_margin_top">2dp</dimen>
|
||||
<dimen name="top_sites_favicon_size">36dp</dimen>
|
||||
<dimen name="top_sites_favicon_elevation">0dp</dimen>
|
||||
<dimen name="top_sites_favicon_corner_size">4dp</dimen>
|
||||
|
||||
<dimen name="top_sites_card_size">60dp</dimen>
|
||||
<dimen name="top_sites_card_padding">12dp</dimen>
|
||||
<dimen name="top_sites_card_height">84dp</dimen>
|
||||
<dimen name="top_sites_card_width">72dp</dimen>
|
||||
<dimen name="top_sites_card_padding">8dp</dimen>
|
||||
<dimen name="top_sites_card_elevation">6dp</dimen>
|
||||
<dimen name="top_sites_card_radius">8dp</dimen>
|
||||
|
||||
|
|
|
@ -667,10 +667,14 @@
|
|||
<item name="behavior_halfExpandedRatio">0.001</item>
|
||||
</style>
|
||||
|
||||
<style name="TopSite.FaviconCard" parent="Mozac.Widgets.Favicon">
|
||||
<item name="android:layout_width">@dimen/top_sites_card_size</item>
|
||||
<item name="android:layout_height">@dimen/top_sites_card_size</item>
|
||||
<item name="android:padding">@dimen/top_sites_card_padding</item>
|
||||
<style name="TopSite.Card" parent="Mozac.Widgets.Favicon">
|
||||
<item name="android:layout_width">@dimen/top_sites_card_width</item>
|
||||
<item name="android:layout_height">@dimen/top_sites_card_height</item>
|
||||
<item name="android:layout_marginTop">@dimen/top_sites_item_margin_top</item>
|
||||
<item name="android:layout_marginBottom">@dimen/top_sites_item_margin_bottom</item>
|
||||
<item name="android:layout_gravity">center_horizontal</item>
|
||||
<item name="android:importantForAccessibility">noHideDescendants</item>
|
||||
<item name="contentPadding">@dimen/top_sites_card_padding</item>
|
||||
<item name="cardBackgroundColor">?mozac_widget_favicon_background_color</item>
|
||||
<item name="cardCornerRadius">@dimen/top_sites_card_radius</item>
|
||||
<item name="cardElevation">@dimen/top_sites_card_elevation</item>
|
||||
|
|
Loading…
Reference in New Issue