This commit is contained in:
Tiger Oakes
2019-08-12 10:35:13 -04:00
committed by Tiger Oakes
parent 85a2ab342e
commit 5eb00aea8e
14 changed files with 195 additions and 204 deletions

View File

@@ -5,6 +5,7 @@
package org.mozilla.samples.toolbar
import android.content.res.Resources
import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.annotation.DrawableRes
@@ -160,6 +161,9 @@ class ToolbarActivity : AppCompatActivity() {
*/
private fun setupCustomMenu() {
toolbar.siteSecurityColor = Color.TRANSPARENT to Color.TRANSPARENT
toolbar.siteSecurityIcon = getDrawable(R.drawable.custom_security_icon)
toolbar.setBackgroundColor(
ContextCompat.getColor(this, mozilla.components.ui.colors.R.color.photonBlue80))

View File

@@ -0,0 +1,47 @@
<?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/. -->
<selector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
xmlns:ac="http://schemas.android.com/apk/res-auto">
<item ac:state_site_secure="true">
<aapt:attr name="android:drawable">
<vector
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFF"
android:pathData="M17 11V8A5 5 0 0 0 7 8v3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zM9 8a3 3 0 0 1 3-3 3 3 0 0 1 3 3v3H9z"/>
</vector>
</aapt:attr>
</item>
<item>
<aapt:attr name="android:drawable">
<vector
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<group>
<clip-path
android:pathData="M 0 0 L 0 24 L 24 24 L 24 0 L 0 0 Z M 21 2 L 23 4 L 6 21 L 4 19 L 21 2 Z"/>
<path
android:name="icon"
android:fillColor="#FFF"
android:pathData="M17 11V8A5 5 0 0 0 7 8v3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zM9 8a3 3 0 0 1 3-3 3 3 0 0 1 3 3v3H9z" />
</group>
<group>
<clip-path android:pathData="M 18.8 2.8 C 19.8 1.8 21.1 3.3 20.2 4.2 L 3.4 21 L 2 19.6 L 18.8 2.8 Z"/>
<path
android:pathData="M 20 1.6 L 21.4 3 L 5.2 19.2 C 4.2 20.2 2.8 18.8 3.8 17.8 L 20 1.6 Z"
android:fillColor="#ff0039"
android:strokeWidth="1"/>
</group>
</vector>
</aapt:attr>
</item>
</selector>