Commit 8a40e77a authored by Alex Catarineu's avatar Alex Catarineu Committed by morgan
Browse files

TB 40015: [android] Port padlock states for .onion services

parent 37090930
Loading
Loading
Loading
Loading
+1 −0
Changes for mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbar.kt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -488,6 +488,7 @@ class DisplayToolbar internal constructor(
        @ColorInt val color = when (siteSecurity) {
            Toolbar.SiteSecurity.INSECURE -> colors.securityIconInsecure
            Toolbar.SiteSecurity.SECURE -> colors.securityIconSecure
            Toolbar.SiteSecurity.ONION -> colors.securityIconSecure
        }
        if (color == Color.TRANSPARENT && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            views.securityIndicator.clearColorFilter()
+5 −0
Changes for mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/SiteSecurityIconView.kt: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -43,6 +43,11 @@ internal class SiteSecurityIconView @JvmOverloads constructor(
                View.mergeDrawableStates(drawableState, intArrayOf(R.attr.state_site_secure))
                drawableState
            }
            SiteSecurity.ONION -> {
                val drawableState = super.onCreateDrawableState(extraSpace + 1)
                View.mergeDrawableStates(drawableState, intArrayOf(R.attr.state_site_onion))
                drawableState
            }
        }
    }
}
+3 −0
Changes for mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_site_security.xml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@
   - 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" xmlns:ac="http://schemas.android.com/apk/res-auto">
    <item
        android:drawable="@drawable/mozac_ic_onion"
        ac:state_site_onion="true" />
    <item
        android:drawable="@drawable/mozac_ic_lock_24"
        ac:state_site_secure="true" />
+4 −0
Changes for mobile/android/android-components/components/browser/toolbar/src/main/res/values/attrs_browser_toolbar.xml: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -27,6 +27,10 @@
    <attr name="state_site_secure" format="boolean"/>
  </declare-styleable>

  <declare-styleable name="BrowserToolbarSiteOnionState">
    <attr name="state_site_onion" format="boolean"/>
  </declare-styleable>

  <declare-styleable name="ActionContainer">
    <attr name="actionContainerItemSize" format="dimension" />
  </declare-styleable>
+1 −0
Changes for mobile/android/android-components/components/browser/toolbar2/src/main/java/mozilla/components/browser/toolbar2/display/DisplayToolbar.kt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -493,6 +493,7 @@ class DisplayToolbar internal constructor(
        @ColorInt val color = when (siteSecurity) {
            Toolbar.SiteSecurity.INSECURE -> colors.securityIconInsecure
            Toolbar.SiteSecurity.SECURE -> colors.securityIconSecure
            Toolbar.SiteSecurity.ONION -> colors.securityIconSecure
        }
        if (color == Color.TRANSPARENT && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            views.securityIndicator.clearColorFilter()
Loading