Use new backgrounds in wifi setup for xl

Bug: 3373467
Change-Id: Iccc9a4c36dc46a67e395c81a642646b8199be606
This commit is contained in:
Daisuke Miyakawa
2011-01-20 12:28:47 -08:00
parent 5a813ba7f9
commit 8f533a6232
8 changed files with 23 additions and 0 deletions

View File

@@ -136,6 +136,7 @@
<activity android:name=".wifi.WifiSettingsForSetupWizardXL" <activity android:name=".wifi.WifiSettingsForSetupWizardXL"
android:theme="@android:style/Theme.Holo.NoActionBar" android:theme="@android:style/Theme.Holo.NoActionBar"
android:windowBackground="@drawable/setups_bg_default"
android:clearTaskOnLaunch="true" android:clearTaskOnLaunch="true"
android:screenOrientation="landscape" android:screenOrientation="landscape"
android:exported="true" /> android:exported="true" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@@ -118,6 +118,8 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
private DetailedState mPreviousState = DetailedState.DISCONNECTED; private DetailedState mPreviousState = DetailedState.DISCONNECTED;
private int mBackgroundId = R.drawable.setups_bg_default;
// At first, we set "Skip" button disabled so that users won't press it soon after the screen // At first, we set "Skip" button disabled so that users won't press it soon after the screen
// migration. The button is enabled after the wifi module returns some result // migration. The button is enabled after the wifi module returns some result
// (a list of available network, etc.) One possible problem is that the notification from the // (a list of available network, etc.) One possible problem is that the notification from the
@@ -261,6 +263,8 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
// this can be false here. We want to treat it as "after connect action". // this can be false here. We want to treat it as "after connect action".
mAfterConnectAction = true; mAfterConnectAction = true;
trySetBackground(R.drawable.setups_bg_complete);
mProgressBar.setIndeterminate(false); mProgressBar.setIndeterminate(false);
mProgressBar.setProgress(2); mProgressBar.setProgress(2);
@@ -376,6 +380,8 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
edit = true; edit = true;
} }
trySetBackground(R.drawable.setups_bg_default);
// We don't want to keep scanning Wi-Fi networks during users' configuring one network. // We don't want to keep scanning Wi-Fi networks during users' configuring one network.
mWifiSettings.pauseWifiScan(); mWifiSettings.pauseWifiScan();
@@ -432,6 +438,8 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
/* package */ void onConnectButtonPressed() { /* package */ void onConnectButtonPressed() {
mAfterConnectAction = true; mAfterConnectAction = true;
trySetBackground(R.drawable.setups_bg_wifi);
mWifiSettings.submit(mWifiConfig.getController()); mWifiSettings.submit(mWifiConfig.getController());
// updateConnectionState() isn't called soon after the user's "connect" action, // updateConnectionState() isn't called soon after the user's "connect" action,
@@ -478,6 +486,8 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
} }
private void onBackButtonPressed() { private void onBackButtonPressed() {
trySetBackground(R.drawable.setups_bg_default);
if (mAfterConnectAction) { if (mAfterConnectAction) {
if (DEBUG) Log.d(TAG, "Back button pressed after connect action."); if (DEBUG) Log.d(TAG, "Back button pressed after connect action.");
mAfterConnectAction = false; mAfterConnectAction = false;
@@ -570,6 +580,8 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
mConnectButton.setVisibility(View.VISIBLE); mConnectButton.setVisibility(View.VISIBLE);
mConnectButton.setEnabled(true); mConnectButton.setEnabled(true);
trySetBackground(R.drawable.setups_bg_default);
if (!TextUtils.isEmpty(mEditingTitle)) { if (!TextUtils.isEmpty(mEditingTitle)) {
mTitleView.setText(mEditingTitle); mTitleView.setText(mEditingTitle);
} else { } else {
@@ -637,4 +649,14 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) { public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, view, menuInfo); super.onCreateContextMenu(menu, view, menuInfo);
} }
/**
* Replace the current background with a new background whose id is resId if needed.
*/
private void trySetBackground(int resId) {
if (mBackgroundId != resId) {
getWindow().setBackgroundDrawable(getResources().getDrawable(resId));
mBackgroundId = resId;
}
}
} }