Update CA certificate warning to material next spec

* Fix colour extraction
* Update landscape mode
* Update logo

Screenshots:
* https://screenshot.googleplex.com/5mwbKLJeFVecrpi
* https://screenshot.googleplex.com/9z62Sw26NX5Zfwu

Bug: 191845997
Test: Manual testing with Settings
Change-Id: Id9988dbce9eabc2b69dba4bd20ca7a6729601147
This commit is contained in:
Alex Johnston
2021-06-23 10:36:17 +01:00
parent 88c518b2ca
commit e92f5df3be
5 changed files with 44 additions and 21 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 B

View File

@@ -0,0 +1,31 @@
<!--
~ Copyright (C) 2021 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorError"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@android:color/white"
android:pathData="M21.26,18L13.73,4.99c-0.77,-1.33 -2.69,-1.33 -3.46,0L2.74,18c-0.77,1.33 0.19,3 1.73,3h15.06C21.07,21 22.03,19.33 21.26,18zM4.47,19L12,5.99L19.53,19H4.47z" />
<path
android:fillColor="@android:color/white"
android:pathData="M11,11v2c0,0.55 0.45,1 1,1c0.55,0 1,-0.45 1,-1v-2c0,-0.55 -0.45,-1 -1,-1C11.45,10 11,10.45 11,11z" />
<path
android:fillColor="@android:color/white"
android:pathData="M12,17m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0" />
</vector>

View File

@@ -18,37 +18,24 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/setup_wizard_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:icon="@drawable/ic_alert_red">
<LinearLayout
style="@style/SudContentFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/sud_layout_icon"
style="@style/SudGlifIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="@drawable/ic_warning_googred_48dp"/>
<TextView
android:id="@+id/sud_layout_title"
style="@style/SudGlifHeaderTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/ca_certificate_warning_title"/>
android:orientation="vertical">
<TextView
android:id="@+id/sud_layout_description"
style="@style/SudDescription.Glif"
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:textSize="18sp"
android:alpha="0.7"
android:text="@string/ca_certificate_warning_description"/>
</LinearLayout>

View File

@@ -6792,7 +6792,7 @@
<!-- Title of warning shown to the user before they can install a CA certificate [CHAR LIMIT=NONE] -->
<string name="ca_certificate_warning_title">Your data won\u2019t be private</string>
<!-- Description of warning shown to the user before they can install a CA certificate [CHAR LIMIT=NONE] -->
<string name="ca_certificate_warning_description">CA certificates are used by websites, apps, and VPNs for encryption. Only install CA certificates from organizations you trust. \n\n If you install a CA certificate, the certificate owner could access your data, such as passwords or credit card details, from websites you visit or apps you use even if your data is encrypted.</string>
<string name="ca_certificate_warning_description">CA certificates are used by websites, apps, and VPNs for encryption. Only install CA certificates from organizations you trust. \n\nIf you install a CA certificate, the certificate owner could access your data, such as passwords or credit card details, from websites you visit or apps you use even if your data is encrypted.</string>
<!-- Label for button to not install a certificate [CHAR_LIMIT=50] -->
<string name="certificate_warning_dont_install">Don\u2019t install</string>
<!-- Label for button to continue installing a certificate [CHAR_LIMIT=50] -->

View File

@@ -25,10 +25,12 @@ import android.view.View;
import android.widget.Toast;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupdesign.GlifLayout;
import com.google.android.setupdesign.util.ThemeHelper;
/**
* Creates a warning dialog explaining the consequences of installing a CA certificate
@@ -40,8 +42,11 @@ public class InstallCaCertificateWarning extends Activity {
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
ThemeHelper.trySetDynamicColor(this);
setContentView(R.layout.ca_certificate_warning_dialog);
final GlifLayout layout = findViewById(R.id.setup_wizard_layout);
layout.setHeaderText(R.string.ca_certificate_warning_title);
final FooterBarMixin mixin = layout.getMixin(FooterBarMixin.class);
mixin.setSecondaryButton(