Commit 0abd17da authored by Alex Catarineu's avatar Alex Catarineu Committed by Pier Angelo Vendrame
Browse files

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

parent 57746147
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -517,6 +517,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
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
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
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
Original line number Diff line number Diff line
@@ -483,6 +483,7 @@ interface Toolbar : ScrollableToolbar {
    enum class SiteSecurity {
        INSECURE,
        SECURE,
        ONION,
    }

    /**
Loading