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

Commit 22d81f40 authored by cretin45's avatar cretin45 Committed by Ed Carrigan
Browse files

SetupWizard: Refactor for better transitions out of OOBE

Change-Id: If91da3f44dbc5383236b54da529953d48a475250
(cherry picked from commit 0d31b31a)
parent 3e845be8
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2009, 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.
*/
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:interpolator/decelerate_quad">
   <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
           android:duration="@android:integer/config_shortAnimTime"/>
</set>
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2009, 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.
*/
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:interpolator/accelerate_quad">
    <alpha android:fromAlpha="1.0" android:toAlpha="0"
           android:duration="@android:integer/config_shortAnimTime"/>
</set>
+15 −1
Original line number Diff line number Diff line
@@ -18,12 +18,25 @@
    <style name="Theme.Setup" parent="@android:style/Theme.Material.Light">
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowBackground">@color/page_background</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:colorPrimary">@color/primary</item>
        <item name="android:colorPrimaryDark">@color/primary</item>
        <item name="android:colorAccent">@color/accent</item>
        <item name="android:textColorLink">@color/accent</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:windowAnimationStyle">@style/ActivityAnimations</item>
    </style>

    <style name="ActivityAnimations" parent="@android:style/Animation.Activity">
        <item name="android:activityOpenEnterAnimation">@anim/translucent_enter</item>
        <item name="android:activityOpenExitAnimation">@anim/translucent_exit</item>
        <item name="android:activityCloseEnterAnimation">@anim/translucent_enter</item>
        <item name="android:activityCloseExitAnimation">@anim/translucent_exit</item>
        <item name="android:taskToFrontEnterAnimation">@anim/translucent_enter</item>
        <item name="android:taskToFrontExitAnimation">@anim/translucent_exit</item>
        <item name="android:taskToBackEnterAnimation">@anim/translucent_enter</item>
        <item name="android:taskToBackExitAnimation">@anim/translucent_exit</item>
    </style>

    <style name="Header">
@@ -32,6 +45,7 @@

    <style name="PageContainer">
        <item name="android:textColor">@color/primary_text</item>
        <item name="android:background">@color/page_background</item>
    </style>

    <style name="PageContent">
+17 −1
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ import android.app.StatusBarManager;
import android.content.Context;
import android.provider.Settings;

import com.cyanogenmod.setupwizard.util.SetupWizardUtils;

public class SetupWizardApp extends Application {

    public static final String TAG = SetupWizardApp.class.getSimpleName();
@@ -55,8 +57,22 @@ public class SetupWizardApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        disableCaptivePortalDetection();
        mStatusBarManager = (StatusBarManager)getSystemService(Context.STATUS_BAR_SERVICE);
        try {
            // Since this is a new component, we need to disable here if the user
            // has already been through setup on a previous version.
            if (SetupWizardUtils.isGuestUser(this)
                    || Settings.Secure.getInt(getContentResolver(),
                    Settings.Secure.USER_SETUP_COMPLETE) == 1) {
                SetupWizardUtils.disableSetupWizard(this);
            }  else {
                disableCaptivePortalDetection();
            }
        } catch (Settings.SettingNotFoundException e) {
            // Continue with setup
            disableCaptivePortalDetection();
        }

    }

    public void disableStatusBar() {
+4 −1
Original line number Diff line number Diff line
@@ -86,7 +86,9 @@ public class CMSetupWizardData extends AbstractSetupData {
            }
            showHideMobileDataPage();
        } else if (intent.getAction()
                .equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
                .equals(ConnectivityManager.CONNECTIVITY_ACTION) ||
                intent.getAction()
                        .equals(ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE)) {
            showHideAccountPages();
        } else  if (intent.getAction()
                .equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
@@ -139,6 +141,7 @@ public class CMSetupWizardData extends AbstractSetupData {
            filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
            filter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
        }
        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE);
        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
        filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
        filter.addAction(Intent.ACTION_TIME_CHANGED);
Loading