extract bundle keys

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-07-22 22:39:31 +02:00
parent af31d8a703
commit ed19792204
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
3 changed files with 7 additions and 5 deletions

View File

@ -2168,8 +2168,8 @@ class ChatController(args: Bundle) :
}
R.id.action_forward_message -> {
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(
RouterTransaction.with(ConversationsListController(bundle))
.pushChangeHandler(HorizontalChangeHandler())

View File

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

View File

@ -68,4 +68,6 @@ object BundleKeys {
val KEY_SHARED_TEXT = "KEY_SHARED_TEXT"
val KEY_GEOCODING_QUERY = "KEY_GEOCODING_QUERY"
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"
}