am db93e1d7: Merge "UX compliance for CA Cert warning tile in QuickSettings" into klp-dev
* commit 'db93e1d79eca52c7ab27b148f55dc0a5a0c771a1': UX compliance for CA Cert warning tile in QuickSettings
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2013 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="top"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_marginTop="@dimen/qs_tile_margin_above_icon"
|
||||
android:layout_marginBottom="@dimen/qs_cawarn_tile_margin_below_icon"
|
||||
android:layout_width="@dimen/qs_tile_icon_size"
|
||||
android:layout_height="@dimen/qs_tile_icon_size"
|
||||
android:layout_gravity="top|center_horizontal"
|
||||
android:scaleType="centerInside"
|
||||
/>
|
||||
<TextView
|
||||
style="@style/TextAppearance.QuickSettings.CaCertWarning"
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|center_horizontal"
|
||||
android:gravity="top|center_horizontal"
|
||||
/>
|
||||
</LinearLayout>
|
||||
@@ -212,6 +212,8 @@
|
||||
<dimen name="qs_tile_margin_below_icon">17dp</dimen>
|
||||
<!-- Quick Settings tile geometry: icon size -->
|
||||
<dimen name="qs_tile_icon_size">32dp</dimen>
|
||||
<!-- Quick Settings CA Cert Warning tile geometry: gap between icon and text -->
|
||||
<dimen name="qs_cawarn_tile_margin_below_icon">3dp</dimen>
|
||||
|
||||
<!-- The width of the notification panel window: match_parent below sw600dp -->
|
||||
<dimen name="notification_panel_width">-1dp</dimen>
|
||||
|
||||
@@ -498,7 +498,9 @@
|
||||
<string name="battery_meter_very_low_overlay_symbol">!</string>
|
||||
|
||||
<!-- Shows up when there is a user SSL CA Cert installed on the
|
||||
device. Indicates to the user that SSL traffic can be intercepted. [CHAR LIMIT=NONE] -->
|
||||
<string name="ssl_ca_cert_warning">Network may be monitored</string>
|
||||
device. Indicates to the user that SSL traffic can be intercepted.
|
||||
If the text fits on one line (~14 chars), it should start with a
|
||||
linebreak to position it correctly. [CHAR LIMIT=45] -->
|
||||
<string name="ssl_ca_cert_warning">Network may\nbe monitored</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -116,6 +116,10 @@
|
||||
<item name="android:textColor">#ff3a3b39</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.QuickSettings.CaCertWarning" parent="@style/TextAppearance.QuickSettings.TileView">
|
||||
<item name="android:textAllCaps">false</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.QuickSettings.TileView.User" parent="@style/TextAppearance.QuickSettings.TileView">
|
||||
<item name="android:background">#CC000000</item>
|
||||
<item name="android:padding">4dp</item>
|
||||
|
||||
@@ -759,7 +759,8 @@ class QuickSettings {
|
||||
*/
|
||||
|
||||
// SSL CA Cert Warning.
|
||||
final QuickSettingsBasicTile sslCaCertWarningTile = new QuickSettingsBasicTile(mContext);
|
||||
final QuickSettingsBasicTile sslCaCertWarningTile =
|
||||
new QuickSettingsBasicTile(mContext, null, R.layout.quick_settings_tile_monitoring);
|
||||
sslCaCertWarningTile.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -35,6 +35,10 @@ class QuickSettingsBasicTile extends QuickSettingsTileView {
|
||||
}
|
||||
|
||||
public QuickSettingsBasicTile(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, R.layout.quick_settings_tile_basic);
|
||||
}
|
||||
|
||||
public QuickSettingsBasicTile(Context context, AttributeSet attrs, int layoutId) {
|
||||
super(context, attrs);
|
||||
|
||||
setLayoutParams(new FrameLayout.LayoutParams(
|
||||
@@ -42,8 +46,7 @@ class QuickSettingsBasicTile extends QuickSettingsTileView {
|
||||
context.getResources().getDimensionPixelSize(R.dimen.quick_settings_cell_height)
|
||||
));
|
||||
setBackgroundResource(R.drawable.qs_tile_background);
|
||||
addView(LayoutInflater.from(context).inflate(
|
||||
R.layout.quick_settings_tile_basic, null),
|
||||
addView(LayoutInflater.from(context).inflate(layoutId, null),
|
||||
new FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.MATCH_PARENT));
|
||||
|
||||
Reference in New Issue
Block a user