Merge "Use 'setup' header illust before selecting storage type."
This commit is contained in:
committed by
Android (Google) Code Review
commit
3de1dff6cb
@@ -164,13 +164,27 @@ public abstract class StorageWizardBase extends Activity {
|
|||||||
secondBody.setVisibility(View.VISIBLE);
|
secondBody.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setIllustrationInternal(boolean internal) {
|
protected static final int ILLUSTRATION_SETUP = 0;
|
||||||
if (internal) {
|
protected static final int ILLUSTRATION_INTERNAL = 1;
|
||||||
getSetupWizardLayout().setIllustration(R.drawable.bg_internal_storage_header,
|
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);
|
R.drawable.bg_header_horizontal_tile);
|
||||||
} else {
|
break;
|
||||||
getSetupWizardLayout().setIllustration(R.drawable.bg_portable_storage_header,
|
case ILLUSTRATION_INTERNAL:
|
||||||
|
getSetupWizardLayout().setIllustration(
|
||||||
|
R.drawable.bg_internal_storage_header,
|
||||||
R.drawable.bg_header_horizontal_tile);
|
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);
|
setContentView(R.layout.storage_wizard_generic);
|
||||||
|
|
||||||
mFormatPrivate = getIntent().getBooleanExtra(EXTRA_FORMAT_PRIVATE, false);
|
mFormatPrivate = getIntent().getBooleanExtra(EXTRA_FORMAT_PRIVATE, false);
|
||||||
setIllustrationInternal(mFormatPrivate);
|
setIllustrationType(
|
||||||
|
mFormatPrivate ? ILLUSTRATION_INTERNAL : ILLUSTRATION_PORTABLE);
|
||||||
|
|
||||||
if (mFormatPrivate) {
|
if (mFormatPrivate) {
|
||||||
setHeaderText(R.string.storage_wizard_format_confirm_title);
|
setHeaderText(R.string.storage_wizard_format_confirm_title);
|
||||||
|
@@ -51,7 +51,8 @@ public class StorageWizardFormatProgress extends StorageWizardBase {
|
|||||||
|
|
||||||
mFormatPrivate = getIntent().getBooleanExtra(
|
mFormatPrivate = getIntent().getBooleanExtra(
|
||||||
StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, false);
|
StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, false);
|
||||||
setIllustrationInternal(mFormatPrivate);
|
setIllustrationType(
|
||||||
|
mFormatPrivate ? ILLUSTRATION_INTERNAL : ILLUSTRATION_PORTABLE);
|
||||||
|
|
||||||
setHeaderText(R.string.storage_wizard_format_progress_title, mDisk.getDescription());
|
setHeaderText(R.string.storage_wizard_format_progress_title, mDisk.getDescription());
|
||||||
setBodyText(R.string.storage_wizard_format_progress_body, 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();
|
mIsPermittedToAdopt = UserManager.get(this).isAdminUser();
|
||||||
|
|
||||||
setIllustrationInternal(true);
|
setIllustrationType(ILLUSTRATION_SETUP);
|
||||||
setHeaderText(R.string.storage_wizard_init_title, mDisk.getDescription());
|
setHeaderText(R.string.storage_wizard_init_title, mDisk.getDescription());
|
||||||
|
|
||||||
mRadioExternal = (RadioButton) findViewById(R.id.storage_wizard_init_external_title);
|
mRadioExternal = (RadioButton) findViewById(R.id.storage_wizard_init_external_title);
|
||||||
@@ -82,10 +82,10 @@ public class StorageWizardInit extends StorageWizardBase {
|
|||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
if (buttonView == mRadioExternal) {
|
if (buttonView == mRadioExternal) {
|
||||||
mRadioInternal.setChecked(false);
|
mRadioInternal.setChecked(false);
|
||||||
setIllustrationInternal(false);
|
setIllustrationType(ILLUSTRATION_PORTABLE);
|
||||||
} else if (buttonView == mRadioInternal) {
|
} else if (buttonView == mRadioInternal) {
|
||||||
mRadioExternal.setChecked(false);
|
mRadioExternal.setChecked(false);
|
||||||
setIllustrationInternal(true);
|
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||||
}
|
}
|
||||||
getNextButton().setEnabled(true);
|
getNextButton().setEnabled(true);
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,7 @@ public class StorageWizardMigrate extends StorageWizardBase {
|
|||||||
}
|
}
|
||||||
setContentView(R.layout.storage_wizard_migrate);
|
setContentView(R.layout.storage_wizard_migrate);
|
||||||
|
|
||||||
setIllustrationInternal(true);
|
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||||
setHeaderText(R.string.storage_wizard_migrate_title, mDisk.getDescription());
|
setHeaderText(R.string.storage_wizard_migrate_title, mDisk.getDescription());
|
||||||
setBodyText(R.string.memory_calculating_size);
|
setBodyText(R.string.memory_calculating_size);
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ public class StorageWizardMigrateConfirm extends StorageWizardBase {
|
|||||||
final String sourceDescrip = mStorage.getBestVolumeDescription(sourceVol);
|
final String sourceDescrip = mStorage.getBestVolumeDescription(sourceVol);
|
||||||
final String targetDescrip = mStorage.getBestVolumeDescription(mVolume);
|
final String targetDescrip = mStorage.getBestVolumeDescription(mVolume);
|
||||||
|
|
||||||
setIllustrationInternal(true);
|
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||||
setHeaderText(R.string.storage_wizard_migrate_confirm_title, targetDescrip);
|
setHeaderText(R.string.storage_wizard_migrate_confirm_title, targetDescrip);
|
||||||
setBodyText(R.string.memory_calculating_size);
|
setBodyText(R.string.memory_calculating_size);
|
||||||
setSecondaryBodyText(R.string.storage_wizard_migrate_details, targetDescrip);
|
setSecondaryBodyText(R.string.storage_wizard_migrate_details, targetDescrip);
|
||||||
|
@@ -49,7 +49,7 @@ public class StorageWizardMigrateProgress extends StorageWizardBase {
|
|||||||
mMoveId = getIntent().getIntExtra(EXTRA_MOVE_ID, -1);
|
mMoveId = getIntent().getIntExtra(EXTRA_MOVE_ID, -1);
|
||||||
|
|
||||||
final String descrip = mStorage.getBestVolumeDescription(mVolume);
|
final String descrip = mStorage.getBestVolumeDescription(mVolume);
|
||||||
setIllustrationInternal(true);
|
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||||
setHeaderText(R.string.storage_wizard_migrate_progress_title, descrip);
|
setHeaderText(R.string.storage_wizard_migrate_progress_title, descrip);
|
||||||
setBodyText(R.string.storage_wizard_migrate_details, 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 appName = getPackageManager().getApplicationLabel(mApp).toString();
|
||||||
final String volumeName = mStorage.getBestVolumeDescription(mVolume);
|
final String volumeName = mStorage.getBestVolumeDescription(mVolume);
|
||||||
|
|
||||||
setIllustrationInternal(true);
|
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||||
setHeaderText(R.string.storage_wizard_move_confirm_title, appName);
|
setHeaderText(R.string.storage_wizard_move_confirm_title, appName);
|
||||||
setBodyText(R.string.storage_wizard_move_confirm_body, appName, volumeName);
|
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 appName = getIntent().getStringExtra(EXTRA_TITLE);
|
||||||
final String volumeName = mStorage.getBestVolumeDescription(mVolume);
|
final String volumeName = mStorage.getBestVolumeDescription(mVolume);
|
||||||
|
|
||||||
setIllustrationInternal(true);
|
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||||
setHeaderText(R.string.storage_wizard_move_progress_title, appName);
|
setHeaderText(R.string.storage_wizard_move_progress_title, appName);
|
||||||
setBodyText(R.string.storage_wizard_move_progress_body, volumeName, 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 publicVol = findFirstVolume(VolumeInfo.TYPE_PUBLIC);
|
||||||
final VolumeInfo privateVol = findFirstVolume(VolumeInfo.TYPE_PRIVATE);
|
final VolumeInfo privateVol = findFirstVolume(VolumeInfo.TYPE_PRIVATE);
|
||||||
if (publicVol != null) {
|
if (publicVol != null) {
|
||||||
setIllustrationInternal(false);
|
setIllustrationType(ILLUSTRATION_PORTABLE);
|
||||||
setBodyText(R.string.storage_wizard_ready_external_body,
|
setBodyText(R.string.storage_wizard_ready_external_body,
|
||||||
mDisk.getDescription());
|
mDisk.getDescription());
|
||||||
} else if (privateVol != null) {
|
} else if (privateVol != null) {
|
||||||
setIllustrationInternal(true);
|
setIllustrationType(ILLUSTRATION_INTERNAL);
|
||||||
setBodyText(R.string.storage_wizard_ready_internal_body,
|
setBodyText(R.string.storage_wizard_ready_internal_body,
|
||||||
mDisk.getDescription());
|
mDisk.getDescription());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user