SetupWizard: Improve some of the transitions

Change-Id: I26a9d20cf429ab137d9877970ea0d6e4eafec0ad
This commit is contained in:
cretin45 2015-01-23 15:26:45 -08:00
parent 4e0c85b7ef
commit 59730c2e75
6 changed files with 29 additions and 6 deletions

View File

@ -19,9 +19,6 @@
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@color/primary</item>
<item name="android:windowActivityTransitions">true</item>
<item name="android:windowContentTransitions">true</item>
<item name="android:windowExitTransition">@android:transition/explode</item>
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary</item>
<item name="android:colorAccent">@color/accent</item>

View File

@ -161,12 +161,14 @@ public class ChooseDataSimPage extends SetupPage {
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
if (isDetached()) return;
mSignalStrengths.put(subInfoRecord.slotId, signalStrength);
updateSignalStrength(subInfoRecord);
}
@Override
public void onServiceStateChanged(ServiceState state) {
if (isDetached()) return;
mServiceStates.put(subInfoRecord.slotId, state);
updateSignalStrength(subInfoRecord);
}
@ -174,12 +176,14 @@ public class ChooseDataSimPage extends SetupPage {
}
private void updateSignalStrengths() {
if (isDetached()) return;
for (int i = 0; i < mSubInfoRecords.size(); i++) {
updateSignalStrength(mSubInfoRecords.get(i));
}
}
private void setDataSubChecked(SubInfoRecord subInfoRecord) {
if (isDetached()) return;
for (int i = 0; i < mCheckBoxes.size(); i++) {
mCheckBoxes.get(i).setChecked(subInfoRecord.slotId == i);
@ -187,6 +191,7 @@ public class ChooseDataSimPage extends SetupPage {
}
private void updateCurrentDataSub() {
if (isDetached()) return;
for (int i = 0; i < mSubInfoRecords.size(); i++) {
SubInfoRecord subInfoRecord = mSubInfoRecords.get(i);
mCheckBoxes.get(i).setChecked(SubscriptionManager.getDefaultDataSubId()
@ -196,6 +201,7 @@ public class ChooseDataSimPage extends SetupPage {
}
private void updateCarrierText(SubInfoRecord subInfoRecord) {
if (isDetached()) return;
String name = mPhone.getNetworkOperatorName(subInfoRecord.subId);
ServiceState serviceState = mServiceStates.get(subInfoRecord.slotId);
if (TextUtils.isEmpty(name)) {
@ -211,6 +217,7 @@ public class ChooseDataSimPage extends SetupPage {
}
private void updateSignalStrength(SubInfoRecord subInfoRecord) {
if (isDetached()) return;
ImageView signalView = mSignalViews.get(subInfoRecord.slotId);
SignalStrength signalStrength = mSignalStrengths.get(subInfoRecord.slotId);
if (!hasService(subInfoRecord)) {

View File

@ -22,6 +22,7 @@ import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.app.Activity;
import android.app.ActivityOptions;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
@ -299,8 +300,13 @@ public class CyanogenServicesPage extends SetupPage {
Bundle result = future.getResult();
Intent intent = result
.getParcelable(AccountManager.KEY_INTENT);
ActivityOptions options =
ActivityOptions.makeCustomAnimation(activity,
android.R.anim.fade_in,
android.R.anim.fade_out);
activity.startActivityForResult(intent,
SetupWizardApp.REQUEST_CODE_SETUP_CYANOGEN);
SetupWizardApp.REQUEST_CODE_SETUP_CYANOGEN,
options.toBundle());
} catch (OperationCanceledException e) {
} catch (IOException e) {
} catch (AuthenticatorException e) {

View File

@ -22,6 +22,7 @@ import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.app.Activity;
import android.app.ActivityOptions;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
@ -109,8 +110,12 @@ public class GmsAccountPage extends SetupPage {
Bundle result = future.getResult();
Intent intent = result
.getParcelable(AccountManager.KEY_INTENT);
ActivityOptions options =
ActivityOptions.makeCustomAnimation(activity,
android.R.anim.fade_in,
android.R.anim.fade_out);
activity.startActivityForResult(intent,
SetupWizardApp.REQUEST_CODE_SETUP_GMS);
SetupWizardApp.REQUEST_CODE_SETUP_GMS, options.toBundle());
} catch (OperationCanceledException e) {
} catch (IOException e) {
} catch (AuthenticatorException e) {

View File

@ -55,6 +55,7 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.setup_main);
getWindow().setWindowAnimations(android.R.anim.fade_in);
mRootView = findViewById(R.id.root);
((SetupWizardApp)getApplicationContext()).disableStatusBar();
mSetupData = (AbstractSetupData)getLastNonConfigurationInstance();

View File

@ -18,6 +18,7 @@ package com.cyanogenmod.setupwizard.util;
import android.accounts.AccountManager;
import android.app.Activity;
import android.app.ActivityOptions;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@ -29,6 +30,7 @@ import android.net.wifi.WifiManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
import com.google.android.gms.common.ConnectionResult;
@ -58,7 +60,12 @@ public class SetupWizardUtils {
intent.putExtra(SetupWizardApp.EXTRA_ALLOW_SKIP, true);
intent.putExtra("theme", "material_light");
intent.putExtra(SetupWizardApp.EXTRA_AUTO_FINISH, false);
context.startActivityForResult(intent, SetupWizardApp.REQUEST_CODE_SETUP_WIFI);
ActivityOptions options =
ActivityOptions.makeCustomAnimation(context,
android.R.anim.fade_in,
android.R.anim.fade_out);
context.startActivityForResult(intent,
SetupWizardApp.REQUEST_CODE_SETUP_WIFI, options.toBundle());
}
public static boolean isNetworkConnected(Context context) {