浏览代码

extracted string
moved string to final constant

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>

tobiasKaminsky 6 年之前
父节点
当前提交
1348adfa2b

+ 3 - 3
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -2619,7 +2619,7 @@ public class FileDisplayActivity extends FileActivity
     }
     }
 
 
     private void handleOpenFileViaIntent(Intent intent) {
     private void handleOpenFileViaIntent(Intent intent) {
-        showLoadingDialog("Retrieving file…");
+        showLoadingDialog(getString(R.string.retrieving_file));
 
 
         String accountName = intent.getStringExtra("KEY_ACCOUNT");
         String accountName = intent.getStringExtra("KEY_ACCOUNT");
 
 
@@ -2631,7 +2631,7 @@ public class FileDisplayActivity extends FileActivity
 
 
             if (newAccount == null) {
             if (newAccount == null) {
                 dismissLoadingDialog();
                 dismissLoadingDialog();
-                DisplayUtils.showSnackMessage(this, "Associated account not found!");
+                DisplayUtils.showSnackMessage(this, getString(R.string.associated_account_not_found));
                 return;
                 return;
             }
             }
 
 
@@ -2642,7 +2642,7 @@ public class FileDisplayActivity extends FileActivity
 
 
         if ("null".equals(fileId)) {
         if ("null".equals(fileId)) {
             dismissLoadingDialog();
             dismissLoadingDialog();
-            DisplayUtils.showSnackMessage(this, "Error retrieving file");
+            DisplayUtils.showSnackMessage(this, getString(R.string.error_retrieving_file));
             return;
             return;
         }
         }
 
 

+ 2 - 1
src/main/java/com/owncloud/android/ui/adapter/NotificationListAdapter.java

@@ -75,6 +75,7 @@ import butterknife.ButterKnife;
  * This Adapter populates a RecyclerView with all notifications for an account within the app.
  * This Adapter populates a RecyclerView with all notifications for an account within the app.
  */
  */
 public class NotificationListAdapter extends RecyclerView.Adapter<NotificationListAdapter.NotificationViewHolder> {
 public class NotificationListAdapter extends RecyclerView.Adapter<NotificationListAdapter.NotificationViewHolder> {
+    private static final String FILE = "file";
     private StyleSpan styleSpanBold = new StyleSpan(Typeface.BOLD);
     private StyleSpan styleSpanBold = new StyleSpan(Typeface.BOLD);
     private ForegroundColorSpan foregroundColorSpanBlack = new ForegroundColorSpan(Color.BLACK);
     private ForegroundColorSpan foregroundColorSpanBlack = new ForegroundColorSpan(Color.BLACK);
 
 
@@ -107,7 +108,7 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
         holder.dateTime.setText(DisplayUtils.getRelativeTimestamp(notificationsActivity,
         holder.dateTime.setText(DisplayUtils.getRelativeTimestamp(notificationsActivity,
                 notification.getDatetime().getTime()));
                 notification.getDatetime().getTime()));
 
 
-        RichObject file = notification.subjectRichParameters.get("file");
+        RichObject file = notification.subjectRichParameters.get(FILE);
         String subject = notification.getSubject();
         String subject = notification.getSubject();
         if (file == null && !TextUtils.isEmpty(notification.getLink())) {
         if (file == null && !TextUtils.isEmpty(notification.getLink())) {
             subject = subject + " ↗";
             subject = subject + " ↗";

+ 3 - 0
src/main/res/values/strings.xml

@@ -864,4 +864,7 @@
     <string name="shared_avatar_desc">Avatar from shared user</string>
     <string name="shared_avatar_desc">Avatar from shared user</string>
     <string name="shared_with_you_by">Shared with you by %1$s</string>
     <string name="shared_with_you_by">Shared with you by %1$s</string>
     <string name="reshare_not_allowed">Resharing is not allowed</string>
     <string name="reshare_not_allowed">Resharing is not allowed</string>
+    <string name="retrieving_file">Retrieving file…</string>
+    <string name="associated_account_not_found">Associated account not found!</string>
+    <string name="error_retrieving_file">Error retrieving file</string>
 </resources>
 </resources>