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:
Daichi Hirono
2015-07-02 15:38:39 +09:00
parent b96db53256
commit fba2fd8375
10 changed files with 35 additions and 19 deletions

View File

@@ -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;
}
}

View File

@@ -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);

View File

@@ -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());

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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());
}