Unverified Commit d8ff6179 authored by Tiger Oakes's avatar Tiger Oakes Committed by GitHub
Browse files

For #7992: Use favicon style from AC (#12608)

parent e265bd72
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -470,6 +470,7 @@ dependencies {
    implementation Deps.mozilla_ui_colors
    implementation Deps.mozilla_ui_icons
    implementation Deps.mozilla_ui_publicsuffixlist
    implementation Deps.mozilla_ui_widgets

    implementation Deps.mozilla_lib_crash
    implementation Deps.mozilla_lib_push_firebase
+1 −2
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ import android.view.View
import android.widget.PopupWindow
import androidx.appcompat.content.res.AppCompatResources.getDrawable
import kotlinx.android.synthetic.main.top_site_item.*
import kotlinx.android.synthetic.main.top_site_item.view.*
import mozilla.components.browser.menu.BrowserMenuBuilder
import mozilla.components.browser.menu.item.SimpleBrowserMenuItem
import mozilla.components.feature.top.sites.TopSite
@@ -44,7 +43,7 @@ class TopSiteItemViewHolder(
        }

        top_site_item.setOnLongClickListener {
            val menu = topSiteMenu.menuBuilder.build(view.context).show(anchor = it.top_site_title)
            val menu = topSiteMenu.menuBuilder.build(view.context).show(anchor = it)
            it.setOnTouchListener @SuppressLint("ClickableViewAccessibility") { v, event ->
                onTouchEvent(v, event, menu)
            }
+8 −11
Original line number Diff line number Diff line
@@ -5,21 +5,18 @@
package org.mozilla.fenix.settings.logins.view

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.logins_item.view.*
import kotlinx.android.synthetic.main.logins_item.*
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.loadIntoView
import org.mozilla.fenix.settings.logins.SavedLogin
import org.mozilla.fenix.settings.logins.interactor.SavedLoginsInteractor
import org.mozilla.fenix.utils.view.ViewHolder

class LoginsListViewHolder(
    private val view: View,
    view: View,
    private val interactor: SavedLoginsInteractor
) : RecyclerView.ViewHolder(view) {
) : ViewHolder(view) {

    private val favicon = view.favicon_image
    private val url = view.webAddressView
    private val username = view.usernameView
    private var loginItem: SavedLogin? = null

    fun bind(item: SavedLogin) {
@@ -30,17 +27,17 @@ class LoginsListViewHolder(
            username = item.username,
            timeLastUsed = item.timeLastUsed
        )
        url.text = item.origin
        username.text = item.username
        webAddressView.text = item.origin
        usernameView.text = item.username

        updateFavIcon(item.origin)

        view.setOnClickListener {
        itemView.setOnClickListener {
            interactor.onItemClicked(item)
        }
    }

    private fun updateFavIcon(url: String) {
        favicon.context.components.core.icons.loadIntoView(favicon, url)
        itemView.context.components.core.icons.loadIntoView(favicon_image, url)
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -9,5 +9,5 @@
        android:width="14dp"
        android:height="14dp" />
    <solid android:color="?accentBright" />
    <stroke android:color="@color/light_grey_05"/>
    <stroke android:color="@color/photonLightGrey05"/>
</shape>
+0 −29
Original line number Diff line number Diff line
<?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/. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
  <shape android:shape="oval">
    <size
        android:width="40dp"
        android:height="40dp"/>
    <solid android:color="@color/quick_action_reader_close_icon_background"/>
  </shape>
</item>
<item
    android:bottom="8dp"
    android:left="8dp"
    android:right="8dp"
    android:top="8dp">
  <vector
          android:width="24dp"
          android:height="24dp"
          android:viewportWidth="24"
          android:viewportHeight="24">
    <path
        android:pathData="M13.36 11.98l4.38-4.38a0.95 0.95 0 0 0-1.34-1.34l-4.38 4.38-4.38-4.38A0.95 0.95 0 0 0 6.3 7.6l4.38 4.38-4.38 4.38a0.95 0.95 0 1 0 1.34 1.34l4.38-4.38 4.38 4.38a0.95 0.95 0 0 0 1.34-1.34l-4.38-4.38z"
        android:fillColor="@color/quick_action_reader_close_icon"/>
  </vector>
</item>
</layer-list>
Loading