Преглед изворни кода

extract bundle keys

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger пре 3 година
родитељ
комит
ed19792204

+ 2 - 2
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -2168,8 +2168,8 @@ class ChatController(args: Bundle) :
                     }
                     }
                     R.id.action_forward_message -> {
                     R.id.action_forward_message -> {
                         val bundle = Bundle()
                         val bundle = Bundle()
-                        bundle.putBoolean("forwardMessage", true)
-                        bundle.putString("forwardMessageText", message?.text)
+                        bundle.putBoolean(BundleKeys.KEY_FORWARD_MSG_FLAG, true)
+                        bundle.putString(BundleKeys.KEY_FORWARD_MSG_TEXT, message?.text)
                         getRouter().pushController(
                         getRouter().pushController(
                             RouterTransaction.with(ConversationsListController(bundle))
                             RouterTransaction.with(ConversationsListController(bundle))
                                 .pushChangeHandler(HorizontalChangeHandler())
                                 .pushChangeHandler(HorizontalChangeHandler())

+ 3 - 3
app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java

@@ -209,7 +209,7 @@ public class ConversationsListController extends BaseController implements Searc
     public ConversationsListController(Bundle bundle) {
     public ConversationsListController(Bundle bundle) {
         super();
         super();
         setHasOptionsMenu(true);
         setHasOptionsMenu(true);
-        forwardMessage = bundle.getBoolean("forwardMessage");
+        forwardMessage = bundle.getBoolean(BundleKeys.INSTANCE.getKEY_FORWARD_MSG_FLAG());
         this.bundle = bundle;
         this.bundle = bundle;
     }
     }
 
 
@@ -761,8 +761,8 @@ public class ConversationsListController extends BaseController implements Searc
             if (showShareToScreen) {
             if (showShareToScreen) {
                 shareToScreenWasShown = true;
                 shareToScreenWasShown = true;
                 handleSharedData();
                 handleSharedData();
-            }else if (forwardMessage) {
-                openConversation(bundle.getString("forwardMessageText"));
+            } else if (forwardMessage) {
+                openConversation(bundle.getString(BundleKeys.INSTANCE.getKEY_FORWARD_MSG_TEXT()));
             } else {
             } else {
                 openConversation();
                 openConversation();
             }
             }

+ 2 - 0
app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt

@@ -68,4 +68,6 @@ object BundleKeys {
     val KEY_SHARED_TEXT = "KEY_SHARED_TEXT"
     val KEY_SHARED_TEXT = "KEY_SHARED_TEXT"
     val KEY_GEOCODING_QUERY = "KEY_GEOCODING_QUERY"
     val KEY_GEOCODING_QUERY = "KEY_GEOCODING_QUERY"
     val KEY_META_DATA = "KEY_META_DATA"
     val KEY_META_DATA = "KEY_META_DATA"
+    val KEY_FORWARD_MSG_FLAG = "KEY_FORWARD_MSG_FLAG"
+    val KEY_FORWARD_MSG_TEXT = "KEY_FORWARD_MSG_TEXT"
 }
 }