Skip to content

Commit 687f643

Browse files
Christopher TateAndroid (Google) Code Review
authored andcommitted
Merge "Use string resources instead of inline literals for progress toasts"
2 parents ca7b656 + 28b591c commit 687f643

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

packages/BackupRestoreConfirmation/res/values/strings.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,15 @@
4343

4444
<!-- Text for message to user when performing a full restore operation, explaining that they must enter the password originally used to encrypt the full backup data. -->
4545
<string name="restore_enc_password_text">If the restore data is encrypted, please enter the password below:</string>
46+
47+
<!-- Text of a toast telling the user that a full backup operation has begun -->
48+
<string name="toast_backup_started">Backup starting...</string>
49+
<!-- Text of a toast telling the user that a full backup operation has ended -->
50+
<string name="toast_backup_ended">Backup finished</string>
51+
<!-- Text of a toast telling the user that a full restore operation has begun -->
52+
<string name="toast_restore_started">Restore starting...</string>
53+
<!-- Text of a toast telling the user that a full restore operation has ended -->
54+
<string name="toast_restore_ended">Restore ended</string>
55+
<!-- Text of a toast telling the user that the operation has timed out -->
56+
<string name="toast_timeout">Operation timed out</string>
4657
</resources>

packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ObserverHandler extends Handler {
8282
public void handleMessage(Message msg) {
8383
switch (msg.what) {
8484
case MSG_START_BACKUP: {
85-
Toast.makeText(mContext, "!!! Backup starting !!!", Toast.LENGTH_LONG).show();
85+
Toast.makeText(mContext, R.string.toast_backup_started, Toast.LENGTH_LONG).show();
8686
}
8787
break;
8888

@@ -93,13 +93,13 @@ public void handleMessage(Message msg) {
9393
break;
9494

9595
case MSG_END_BACKUP: {
96-
Toast.makeText(mContext, "!!! Backup ended !!!", Toast.LENGTH_SHORT).show();
96+
Toast.makeText(mContext, R.string.toast_backup_ended, Toast.LENGTH_LONG).show();
9797
finish();
9898
}
9999
break;
100100

101101
case MSG_START_RESTORE: {
102-
Toast.makeText(mContext, "!!! Restore starting !!!", Toast.LENGTH_LONG).show();
102+
Toast.makeText(mContext, R.string.toast_restore_started, Toast.LENGTH_LONG).show();
103103
}
104104
break;
105105

@@ -110,13 +110,13 @@ public void handleMessage(Message msg) {
110110
break;
111111

112112
case MSG_END_RESTORE: {
113-
Toast.makeText(mContext, "!!! Restore ended !!!", Toast.LENGTH_SHORT).show();
113+
Toast.makeText(mContext, R.string.toast_restore_ended, Toast.LENGTH_SHORT).show();
114114
finish();
115115
}
116116
break;
117117

118118
case MSG_TIMEOUT: {
119-
Toast.makeText(mContext, "!!! TIMED OUT !!!", Toast.LENGTH_LONG).show();
119+
Toast.makeText(mContext, R.string.toast_timeout, Toast.LENGTH_LONG).show();
120120
}
121121
break;
122122
}

0 commit comments

Comments
 (0)