Bug 1379066 - 5. Site identity use new drawable
The icon for site-identity of Photon is different from Australis. Even
in Photon there are still two version, one for normal mode, one for
private mode.
We cannot simply use tinting to change color of site-identity. Because
of the lock icon should keep green.
MozReview-Commit-ID: Je7wXrq1gEK
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/photon/res/drawable/security_mode_icon.xml
@@ -0,0 +1,15 @@
+<?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:gecko="http://schemas.android.com/apk/res-auto">
+
+ <!-- private browsing mode -->
+ <item android:drawable="@drawable/security_mode_icon_pm" gecko:state_private="true" />
+
+ <!-- normal mode -->
+ <item android:drawable="@drawable/security_mode_icon_nm" />
+
+</selector>
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/photon/res/drawable/security_mode_icon_nm.xml
@@ -0,0 +1,32 @@
+<?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/. -->
+
+<!-- level value is matter. It should match SecurityModeUtil.getImageLevel -->
+<level-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:drawable="@drawable/ic_globe_nm"
+ android:maxLevel="0" />
+ <item
+ android:drawable="@drawable/ic_lock"
+ android:maxLevel="1" />
+ <item
+ android:drawable="@drawable/ic_warning_minor"
+ android:maxLevel="2" />
+ <item
+ android:drawable="@drawable/ic_lock_disabled"
+ android:maxLevel="3" />
+ <item
+ android:drawable="@drawable/ic_shield_enabled"
+ android:maxLevel="4" />
+ <item
+ android:drawable="@drawable/ic_shield_disabled"
+ android:maxLevel="5" />
+ <item
+ android:drawable="@drawable/ic_search_icon"
+ android:maxLevel="6" />
+
+</level-list>
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/photon/res/drawable/security_mode_icon_pm.xml
@@ -0,0 +1,32 @@
+<?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/. -->
+
+<!-- level value is matter. It should match SecurityModeUtil.getImageLevel -->
+<level-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:drawable="@drawable/ic_globe_pm"
+ android:maxLevel="0" />
+ <item
+ android:drawable="@drawable/ic_lock"
+ android:maxLevel="1" />
+ <item
+ android:drawable="@drawable/ic_warning_minor"
+ android:maxLevel="2" />
+ <item
+ android:drawable="@drawable/ic_lock_disabled"
+ android:maxLevel="3" />
+ <item
+ android:drawable="@drawable/ic_shield_enabled"
+ android:maxLevel="4" />
+ <item
+ android:drawable="@drawable/ic_shield_disabled"
+ android:maxLevel="5" />
+ <item
+ android:drawable="@drawable/ic_search_icon"
+ android:maxLevel="6" />
+
+</level-list>
--- a/mobile/android/app/src/photon/res/layout/toolbar_display_layout.xml
+++ b/mobile/android/app/src/photon/res/layout/toolbar_display_layout.xml
@@ -24,17 +24,17 @@
android:contentDescription="@string/site_security"
android:paddingBottom="@dimen/browser_toolbar_site_security_padding_vertical"
android:paddingEnd="@dimen/browser_toolbar_site_security_padding_horizontal"
android:paddingLeft="@dimen/browser_toolbar_site_security_padding_horizontal"
android:paddingRight="@dimen/browser_toolbar_site_security_padding_horizontal"
android:paddingStart="@dimen/browser_toolbar_site_security_padding_horizontal"
android:paddingTop="@dimen/browser_toolbar_site_security_padding_vertical"
android:scaleType="fitCenter"
- android:src="@drawable/site_security_icon" />
+ android:src="@drawable/security_mode_icon" />
<org.mozilla.gecko.widget.FadedMultiColorTextView
android:id="@+id/url_bar_title"
style="@style/UrlBar.Title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
gecko:autoUpdateTheme="false"