Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-04-15 15:05:58 +02:00
parent 4dc092945b
commit 352dbd575c
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -74,6 +74,7 @@ import butterknife.ButterKnife;
*/
public class NotificationListAdapter extends RecyclerView.Adapter<NotificationListAdapter.NotificationViewHolder> {
private static final String FILE = "file";
private static final String ACTION_TYPE_WEB = "WEB";
private StyleSpan styleSpanBold = new StyleSpan(Typeface.BOLD);
private ForegroundColorSpan foregroundColorSpanBlack;
@ -184,11 +185,19 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
button.setOnClickListener(v -> {
setButtonEnabled(holder, false);
new NotificationExecuteActionTask(client,
holder,
notification,
notificationsActivity)
.execute(action);
if (ACTION_TYPE_WEB.equals(action.type)) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(action.link));
notificationsActivity.startActivity(intent);
} else {
new NotificationExecuteActionTask(client,
holder,
notification,
notificationsActivity)
.execute(action);
}
});
holder.buttons.addView(button);