Commit 2ecf4674 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Merge custom actions if any (ones other than the defaults) to message actions...

Merge custom actions if any (ones other than the defaults) to message actions and remove test action
parent b81cef3b
...@@ -21,7 +21,6 @@ import android.support.v7.app.AlertDialog; ...@@ -21,7 +21,6 @@ import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.View; import android.view.View;
import android.widget.Toast;
import com.hadisatrio.optional.Optional; import com.hadisatrio.optional.Optional;
...@@ -670,7 +669,6 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -670,7 +669,6 @@ public class RoomFragment extends AbstractChatRoomFragment implements
.setReplyAction(presenter::replyMessage) .setReplyAction(presenter::replyMessage)
.setEditAction(this::onEditMessage) .setEditAction(this::onEditMessage)
.setCopyAction(msg -> onCopy(message.getMessage())) .setCopyAction(msg -> onCopy(message.getMessage()))
.addAction("Test", message1 -> Toast.makeText(context, "Teste", Toast.LENGTH_SHORT).show())
.show(context); .show(context);
} }
} }
......
...@@ -6,6 +6,7 @@ import android.support.v4.util.Pair; ...@@ -6,6 +6,7 @@ import android.support.v4.util.Pair;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import chat.rocket.android.BackgroundLooper; import chat.rocket.android.BackgroundLooper;
...@@ -81,6 +82,7 @@ public class MessagePopup { ...@@ -81,6 +82,7 @@ public class MessagePopup {
allowedActions.add(action); allowedActions.add(action);
} }
} }
allowedActions.addAll(singleton.otherActions);
CharSequence[] items = new CharSequence[allowedActions.size()]; CharSequence[] items = new CharSequence[allowedActions.size()];
for (int j = 0; j < items.length; j++) { for (int j = 0; j < items.length; j++) {
items[j] = allowedActions.get(j).actionName; items[j] = allowedActions.get(j).actionName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment