Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e831030 authored by Maurice Lam's avatar Maurice Lam
Browse files

[ScreenLock] Style encryption interstitial in SUW

When running in setup wizard, style the encryption interstitial using
styles from Setup Wizard library, to be consistent with the rest of
the setup flow.

Bug: 22587892
Change-Id: I3787643139ec4189f16e0046875fe3a688c8060b
parent d85fafce
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2015 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
-->

<com.android.setupwizardlib.SetupWizardLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:id="@+id/setup_wizard_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    settings:suwBackgroundTile="@drawable/setup_illustration_tile"
    settings:suwHeaderText="@string/encryption_interstitial_header"
    settings:suwIllustrationHorizontalTile="@drawable/setup_illustration_horizontal_tile"
    settings:suwIllustrationImage="@drawable/setup_illustration_lock_screen">

    <LinearLayout
        style="@style/SuwContentFrame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <TextView
            android:id="@+id/encryption_message"
            style="@style/SuwDescription"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <RadioGroup
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:checkedButton="@+id/encrypt_require_password">

            <RadioButton
                android:id="@+id/encrypt_require_password"
                style="@style/SuwRadioButton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <RadioButton
                android:id="@+id/encrypt_dont_require_password"
                style="@style/SuwRadioButton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </RadioGroup>

    </LinearLayout>

</com.android.setupwizardlib.SetupWizardLayout>
+6 −3
Original line number Diff line number Diff line
@@ -87,8 +87,12 @@ public class EncryptionInterstitial extends SettingsActivity {
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            final int layoutId = R.layout.encryption_interstitial;
            View view = inflater.inflate(layoutId, container, false);
            return inflater.inflate(R.layout.encryption_interstitial, container, false);
        }

        @Override
        public void onViewCreated(View view, Bundle savedInstanceState) {
            super.onViewCreated(view, savedInstanceState);
            mRequirePasswordToDecryptButton =
                    (RadioButton) view.findViewById(R.id.encrypt_require_password);
            mDontRequirePasswordToDecryptButton =
@@ -135,7 +139,6 @@ public class EncryptionInterstitial extends SettingsActivity {

            setRequirePasswordState(getActivity().getIntent().getBooleanExtra(
                    EXTRA_REQUIRE_PASSWORD, true));
            return view;
        }

        @Override
+11 −9
Original line number Diff line number Diff line
@@ -72,22 +72,24 @@ public class SetupEncryptionInterstitial extends EncryptionInterstitial {
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            final SetupWizardLayout layout = new SetupWizardLayout(inflater.getContext());
            layout.setIllustration(R.drawable.setup_illustration_lock_screen,
                    R.drawable.setup_illustration_horizontal_tile);
            layout.setBackgroundTile(R.drawable.setup_illustration_tile);
            layout.setHeaderText(R.string.encryption_interstitial_header);
            return inflater.inflate(R.layout.setup_encryption_interstitial, container, false);
        }

        @Override
        public void onViewCreated(View view, Bundle savedInstanceState) {
            super.onViewCreated(view, savedInstanceState);

            final SetupWizardLayout layout =
                    (SetupWizardLayout) view.findViewById(R.id.setup_wizard_layout);

            View content = super.onCreateView(inflater, layout, savedInstanceState);
            layout.addView(content);
            layout.getNavigationBar().setNavigationBarListener(this);
            final NavigationBar navigationBar = layout.getNavigationBar();
            navigationBar.setNavigationBarListener(this);

            Activity activity = getActivity();
            if (activity != null) {
                activity.setTitle(R.string.encryption_interstitial_header);
                SetupWizardUtils.setImmersiveMode(activity);
            }
            return layout;
        }

        @Override