mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 23:25:20 +03:00
use proper context
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
ed19792204
commit
fd430b9084
1 changed files with 14 additions and 1 deletions
|
@ -69,6 +69,7 @@ import java.util.concurrent.ExecutionException;
|
|||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import androidx.appcompat.view.ContextThemeWrapper;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.emoji.widget.EmojiTextView;
|
||||
|
@ -407,7 +408,19 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
|
|||
return;
|
||||
}
|
||||
|
||||
PopupMenu popupMenu = new PopupMenu(this.context, itemView, Gravity.START);
|
||||
Context viewContext;
|
||||
|
||||
if (itemView != null && itemView.getContext() != null) {
|
||||
viewContext = itemView.getContext();
|
||||
} else {
|
||||
viewContext = this.context;
|
||||
}
|
||||
|
||||
PopupMenu popupMenu = new PopupMenu(
|
||||
new ContextThemeWrapper(viewContext, R.style.appActionBarPopupMenu),
|
||||
itemView,
|
||||
Gravity.START
|
||||
);
|
||||
popupMenu.inflate(R.menu.chat_preview_message_menu);
|
||||
|
||||
popupMenu.setOnMenuItemClickListener(item -> {
|
||||
|
|
Loading…
Reference in a new issue