mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Forwarding message to selected conversation
Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
parent
6f75c25bbd
commit
d67226e39d
@ -111,7 +111,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {
|
if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {
|
||||||
if (!router!!.hasRootController()) {
|
if (!router!!.hasRootController()) {
|
||||||
router!!.setRoot(
|
router!!.setRoot(
|
||||||
RouterTransaction.with(ConversationsListController())
|
RouterTransaction.with(ConversationsListController(Bundle()))
|
||||||
.pushChangeHandler(HorizontalChangeHandler())
|
.pushChangeHandler(HorizontalChangeHandler())
|
||||||
.popChangeHandler(HorizontalChangeHandler())
|
.popChangeHandler(HorizontalChangeHandler())
|
||||||
)
|
)
|
||||||
@ -121,7 +121,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
if (hasDb) {
|
if (hasDb) {
|
||||||
if (userUtils.anyUserExists()) {
|
if (userUtils.anyUserExists()) {
|
||||||
router!!.setRoot(
|
router!!.setRoot(
|
||||||
RouterTransaction.with(ConversationsListController())
|
RouterTransaction.with(ConversationsListController(Bundle()))
|
||||||
.pushChangeHandler(HorizontalChangeHandler())
|
.pushChangeHandler(HorizontalChangeHandler())
|
||||||
.popChangeHandler(HorizontalChangeHandler())
|
.popChangeHandler(HorizontalChangeHandler())
|
||||||
)
|
)
|
||||||
@ -174,7 +174,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
fun resetConversationsList() {
|
fun resetConversationsList() {
|
||||||
if (userUtils.anyUserExists()) {
|
if (userUtils.anyUserExists()) {
|
||||||
router!!.setRoot(
|
router!!.setRoot(
|
||||||
RouterTransaction.with(ConversationsListController())
|
RouterTransaction.with(ConversationsListController(Bundle()))
|
||||||
.pushChangeHandler(HorizontalChangeHandler())
|
.pushChangeHandler(HorizontalChangeHandler())
|
||||||
.popChangeHandler(HorizontalChangeHandler())
|
.popChangeHandler(HorizontalChangeHandler())
|
||||||
)
|
)
|
||||||
|
@ -443,7 +443,7 @@ public class AccountVerificationController extends BaseController {
|
|||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
if (userUtils.getUsers().size() == 1) {
|
if (userUtils.getUsers().size() == 1) {
|
||||||
getRouter().setRoot(RouterTransaction.with(new
|
getRouter().setRoot(RouterTransaction.with(new
|
||||||
ConversationsListController())
|
ConversationsListController(new Bundle()))
|
||||||
.pushChangeHandler(new HorizontalChangeHandler())
|
.pushChangeHandler(new HorizontalChangeHandler())
|
||||||
.popChangeHandler(new HorizontalChangeHandler()));
|
.popChangeHandler(new HorizontalChangeHandler()));
|
||||||
} else {
|
} else {
|
||||||
@ -524,7 +524,7 @@ public class AccountVerificationController extends BaseController {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (userUtils.anyUserExists()) {
|
if (userUtils.anyUserExists()) {
|
||||||
getRouter().setRoot(RouterTransaction.with(new ConversationsListController())
|
getRouter().setRoot(RouterTransaction.with(new ConversationsListController(new Bundle()))
|
||||||
.pushChangeHandler(new HorizontalChangeHandler())
|
.pushChangeHandler(new HorizontalChangeHandler())
|
||||||
.popChangeHandler(new HorizontalChangeHandler()));
|
.popChangeHandler(new HorizontalChangeHandler()));
|
||||||
} else {
|
} else {
|
||||||
|
@ -2165,6 +2165,14 @@ class ChatController(args: Bundle) :
|
|||||||
clipboardManager.setPrimaryClip(clipData)
|
clipboardManager.setPrimaryClip(clipData)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
R.id.action_forward_message -> {
|
||||||
|
val bundle = Bundle()
|
||||||
|
bundle.putBoolean("forwardMessage", true)
|
||||||
|
getRouter().pushController(
|
||||||
|
RouterTransaction.with(ConversationsListController(bundle)).pushChangeHandler
|
||||||
|
(HorizontalChangeHandler()).popChangeHandler(HorizontalChangeHandler()))
|
||||||
|
true
|
||||||
|
}
|
||||||
R.id.action_reply_to_message -> {
|
R.id.action_reply_to_message -> {
|
||||||
val chatMessage = message as ChatMessage?
|
val chatMessage = message as ChatMessage?
|
||||||
replyToMessage(chatMessage, message?.jsonMessageId)
|
replyToMessage(chatMessage, message?.jsonMessageId)
|
||||||
|
@ -203,9 +203,12 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
|
|
||||||
private String textToPaste = "";
|
private String textToPaste = "";
|
||||||
|
|
||||||
public ConversationsListController() {
|
private boolean forwardMessage = false;
|
||||||
|
|
||||||
|
public ConversationsListController(Bundle bundle) {
|
||||||
super();
|
super();
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
|
forwardMessage = bundle.getBoolean("forwardMessage");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -340,9 +343,13 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
|
|
||||||
showShareToScreen = !shareToScreenWasShown && hasActivityActionSendIntent();
|
showShareToScreen = !shareToScreenWasShown && hasActivityActionSendIntent();
|
||||||
|
|
||||||
|
|
||||||
if (showShareToScreen) {
|
if (showShareToScreen) {
|
||||||
hideSearchBar();
|
hideSearchBar();
|
||||||
getActionBar().setTitle(R.string.send_to_three_dots);
|
getActionBar().setTitle(R.string.send_to_three_dots);
|
||||||
|
} else if (forwardMessage) {
|
||||||
|
hideSearchBar();
|
||||||
|
getActionBar().setTitle(R.string.nc_forward_to_three_dots);
|
||||||
} else {
|
} else {
|
||||||
MainActivity activity = (MainActivity) getActivity();
|
MainActivity activity = (MainActivity) getActivity();
|
||||||
|
|
||||||
@ -752,6 +759,8 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
if (showShareToScreen) {
|
if (showShareToScreen) {
|
||||||
shareToScreenWasShown = true;
|
shareToScreenWasShown = true;
|
||||||
handleSharedData();
|
handleSharedData();
|
||||||
|
}else if (forwardMessage) {
|
||||||
|
forwardMessage();
|
||||||
} else {
|
} else {
|
||||||
openConversation();
|
openConversation();
|
||||||
}
|
}
|
||||||
@ -759,6 +768,10 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void forwardMessage() {
|
||||||
|
System.out.println("Add code to forward a message here");
|
||||||
|
}
|
||||||
|
|
||||||
private void handleSharedData() {
|
private void handleSharedData() {
|
||||||
collectDataFromIntent();
|
collectDataFromIntent();
|
||||||
if (!textToPaste.isEmpty()) {
|
if (!textToPaste.isEmpty()) {
|
||||||
|
@ -8,6 +8,12 @@
|
|||||||
android:title="@string/nc_copy_message"
|
android:title="@string/nc_copy_message"
|
||||||
app:showAsAction="always" />
|
app:showAsAction="always" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_forward_message"
|
||||||
|
android:icon="@drawable/ic_content_copy"
|
||||||
|
android:title="@string/nc_forward_message"
|
||||||
|
app:showAsAction="always" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_reply_to_message"
|
android:id="@+id/action_reply_to_message"
|
||||||
android:icon="@drawable/ic_reply"
|
android:icon="@drawable/ic_reply"
|
||||||
|
@ -189,6 +189,8 @@
|
|||||||
<string name="nc_add_to_favorites">Add to favorites</string>
|
<string name="nc_add_to_favorites">Add to favorites</string>
|
||||||
<string name="nc_remove_from_favorites">Remove from favorites</string>
|
<string name="nc_remove_from_favorites">Remove from favorites</string>
|
||||||
|
|
||||||
|
<string name="nc_forward_to_three_dots">Forward to …</string>
|
||||||
|
|
||||||
<!-- Contacts -->
|
<!-- Contacts -->
|
||||||
<string name="nc_select_participants">Select participants</string>
|
<string name="nc_select_participants">Select participants</string>
|
||||||
<string name="nc_add_participants">Add participants</string>
|
<string name="nc_add_participants">Add participants</string>
|
||||||
@ -357,6 +359,7 @@
|
|||||||
|
|
||||||
<!-- Chat -->
|
<!-- Chat -->
|
||||||
<string name="nc_copy_message">Copy</string>
|
<string name="nc_copy_message">Copy</string>
|
||||||
|
<string name="nc_forward_message">Forward</string>
|
||||||
<string name="nc_reply">Reply</string>
|
<string name="nc_reply">Reply</string>
|
||||||
<string name="nc_reply_privately">Reply privately</string>
|
<string name="nc_reply_privately">Reply privately</string>
|
||||||
<string name="nc_delete_message">Delete</string>
|
<string name="nc_delete_message">Delete</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user