Browse Source

fix https://github.com/nextcloud/android/issues/5457

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 5 years ago
parent
commit
352dbd575c

+ 14 - 5
src/main/java/com/owncloud/android/ui/adapter/NotificationListAdapter.java

@@ -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);