Use 'setup' header illust before selecting storage type.
Previously the storage setup wizard shows 'internal' header illust before user selects storage type. The CL turns the initial illust into 'setup' header illust. BUG=22211635 Change-Id: Ie429a6197d210e0bd1ef8d0af6abb6f83295ac50
This commit is contained in:
@@ -164,13 +164,27 @@ public abstract class StorageWizardBase extends Activity {
|
||||
secondBody.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
protected void setIllustrationInternal(boolean internal) {
|
||||
if (internal) {
|
||||
getSetupWizardLayout().setIllustration(R.drawable.bg_internal_storage_header,
|
||||
protected static final int ILLUSTRATION_SETUP = 0;
|
||||
protected static final int ILLUSTRATION_INTERNAL = 1;
|
||||
protected static final int ILLUSTRATION_PORTABLE = 2;
|
||||
|
||||
protected void setIllustrationType(int type) {
|
||||
switch (type) {
|
||||
case ILLUSTRATION_SETUP:
|
||||
getSetupWizardLayout().setIllustration(
|
||||
R.drawable.bg_setup_header,
|
||||
R.drawable.bg_header_horizontal_tile);
|
||||
} else {
|
||||
getSetupWizardLayout().setIllustration(R.drawable.bg_portable_storage_header,
|
||||
break;
|
||||
case ILLUSTRATION_INTERNAL:
|
||||
getSetupWizardLayout().setIllustration(
|
||||
R.drawable.bg_internal_storage_header,
|
||||
R.drawable.bg_header_horizontal_tile);
|
||||
break;
|
||||
case ILLUSTRATION_PORTABLE:
|
||||
getSetupWizardLayout().setIllustration(
|
||||
R.drawable.bg_portable_storage_header,
|
||||
R.drawable.bg_header_horizontal_tile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,8 @@ public class StorageWizardFormatConfirm extends StorageWizardBase {
|
||||
setContentView(R.layout.storage_wizard_generic);
|
||||
|
||||
mFormatPrivate = getIntent().getBooleanExtra(EXTRA_FORMAT_PRIVATE, false);
|
||||
setIllustrationInternal(mFormatPrivate);
|
||||
setIllustrationType(
|
||||
mFormatPrivate ? ILLUSTRATION_INTERNAL : ILLUSTRATION_PORTABLE);
|
||||
|
||||
if (mFormatPrivate) {
|
||||
setHeaderText(R.string.storage_wizard_format_confirm_title);
|
||||
|
@@ -51,7 +51,8 @@ public class StorageWizardFormatProgress extends StorageWizardBase {
|
||||
|
||||
mFormatPrivate = getIntent().getBooleanExtra(
|
||||
StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, false);
|
||||
setIllustrationInternal(mFormatPrivate);
|
||||
setIllustrationType(
|
||||
mFormatPrivate ? ILLUSTRATION_INTERNAL : ILLUSTRATION_PORTABLE);
|
||||
|
||||
setHeaderText(R.string.storage_wizard_format_progress_title, mDisk.getDescription());
|
||||
setBodyText(R.string.storage_wizard_format_progress_body, mDisk.getDescription());
|
||||
|
@@ -44,7 +44,7 @@ public class StorageWizardInit extends StorageWizardBase {
|
||||
|
||||
mIsPermittedToAdopt = UserManager.get(this).isAdminUser();
|
||||
|
||||
setIllustrationInternal(true);
|
||||
setIllustrationType(ILLUSTRATION_SETUP);
|
||||
setHeaderText(R.string.storage_wizard_init_title, mDisk.getDescription());
|
||||
|
||||
mRadioExternal = (RadioButton) findViewById(R.id.storage_wizard_init_external_title);
|
||||
@@ -82,10 +82,10 @@ public class StorageWizardInit extends StorageWizardBase {
|
||||
if (isChecked) {
|
||||
if (buttonView == mRadioExternal) {
|
||||
mRadioInternal.setChecked(false);
|
||||
setIllustrationInternal(false);
|
||||
setIllustrationType(ILLUSTRATION_PORTABLE);
|
||||
} else if (buttonView == mRadioInternal) {
|
||||
mRadioExternal.setChecked(false);
|
||||
setIllustrationInternal(true);
|
||||
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||
}
|
||||
getNextButton().setEnabled(true);
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ public class StorageWizardMigrate extends StorageWizardBase {
|
||||
}
|
||||
setContentView(R.layout.storage_wizard_migrate);
|
||||
|
||||
setIllustrationInternal(true);
|
||||
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||
setHeaderText(R.string.storage_wizard_migrate_title, mDisk.getDescription());
|
||||
setBodyText(R.string.memory_calculating_size);
|
||||
|
||||
|
@@ -45,7 +45,7 @@ public class StorageWizardMigrateConfirm extends StorageWizardBase {
|
||||
final String sourceDescrip = mStorage.getBestVolumeDescription(sourceVol);
|
||||
final String targetDescrip = mStorage.getBestVolumeDescription(mVolume);
|
||||
|
||||
setIllustrationInternal(true);
|
||||
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||
setHeaderText(R.string.storage_wizard_migrate_confirm_title, targetDescrip);
|
||||
setBodyText(R.string.memory_calculating_size);
|
||||
setSecondaryBodyText(R.string.storage_wizard_migrate_details, targetDescrip);
|
||||
|
@@ -49,7 +49,7 @@ public class StorageWizardMigrateProgress extends StorageWizardBase {
|
||||
mMoveId = getIntent().getIntExtra(EXTRA_MOVE_ID, -1);
|
||||
|
||||
final String descrip = mStorage.getBestVolumeDescription(mVolume);
|
||||
setIllustrationInternal(true);
|
||||
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||
setHeaderText(R.string.storage_wizard_migrate_progress_title, descrip);
|
||||
setBodyText(R.string.storage_wizard_migrate_details, descrip);
|
||||
|
||||
|
@@ -57,7 +57,7 @@ public class StorageWizardMoveConfirm extends StorageWizardBase {
|
||||
final String appName = getPackageManager().getApplicationLabel(mApp).toString();
|
||||
final String volumeName = mStorage.getBestVolumeDescription(mVolume);
|
||||
|
||||
setIllustrationInternal(true);
|
||||
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||
setHeaderText(R.string.storage_wizard_move_confirm_title, appName);
|
||||
setBodyText(R.string.storage_wizard_move_confirm_body, appName, volumeName);
|
||||
|
||||
|
@@ -46,7 +46,7 @@ public class StorageWizardMoveProgress extends StorageWizardBase {
|
||||
final String appName = getIntent().getStringExtra(EXTRA_TITLE);
|
||||
final String volumeName = mStorage.getBestVolumeDescription(mVolume);
|
||||
|
||||
setIllustrationInternal(true);
|
||||
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||
setHeaderText(R.string.storage_wizard_move_progress_title, appName);
|
||||
setBodyText(R.string.storage_wizard_move_progress_body, volumeName, appName);
|
||||
|
||||
|
@@ -38,11 +38,11 @@ public class StorageWizardReady extends StorageWizardBase {
|
||||
final VolumeInfo publicVol = findFirstVolume(VolumeInfo.TYPE_PUBLIC);
|
||||
final VolumeInfo privateVol = findFirstVolume(VolumeInfo.TYPE_PRIVATE);
|
||||
if (publicVol != null) {
|
||||
setIllustrationInternal(false);
|
||||
setIllustrationType(ILLUSTRATION_PORTABLE);
|
||||
setBodyText(R.string.storage_wizard_ready_external_body,
|
||||
mDisk.getDescription());
|
||||
} else if (privateVol != null) {
|
||||
setIllustrationInternal(true);
|
||||
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||
setBodyText(R.string.storage_wizard_ready_internal_body,
|
||||
mDisk.getDescription());
|
||||
}
|
||||
|
Reference in New Issue
Block a user