mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
remove unsubscribe btn
This commit is contained in:
parent
fb45798b74
commit
e2ab26c4a3
@ -28,7 +28,6 @@ public class NotificationsViewHolder extends BaseViewHolder<GroupedNotificationM
|
||||
|
||||
@BindView(R.id.title) FontTextView title;
|
||||
@BindView(R.id.date) FontTextView date;
|
||||
@BindView(R.id.unsubsribe) ForegroundImageView unSubscribe;
|
||||
@BindView(R.id.markAsRead) ForegroundImageView markAsRead;
|
||||
@BindView(R.id.notificationType) ForegroundImageView notificationType;
|
||||
@BindView(R.id.repoName) FontTextView repoName;
|
||||
@ -36,7 +35,6 @@ public class NotificationsViewHolder extends BaseViewHolder<GroupedNotificationM
|
||||
|
||||
private NotificationsViewHolder(@NonNull View itemView, @Nullable BaseRecyclerAdapter adapter, boolean showUnreadState) {
|
||||
super(itemView, adapter);
|
||||
unSubscribe.setOnClickListener(this);
|
||||
markAsRead.setOnClickListener(this);
|
||||
this.showUnreadState = showUnreadState;
|
||||
}
|
||||
@ -53,7 +51,6 @@ public class NotificationsViewHolder extends BaseViewHolder<GroupedNotificationM
|
||||
int color;
|
||||
date.setText(ParseDateFormat.getTimeAgo(thread.getUpdatedAt()));
|
||||
markAsRead.setVisibility(thread.isUnread() ? View.VISIBLE : View.GONE);
|
||||
// unSubscribe.setImageResource(thread.isIsSubscribed() ? R.drawable.ic_unsubscribe : R.drawable.ic_subscribe);
|
||||
if (thread.getSubject().getType() != null) {
|
||||
notificationType.setImageResource(thread.getSubject().getType().getDrawableRes());
|
||||
notificationType.setContentDescription(thread.getSubject().getType().name());
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.fastaccess.ui.modules.notification.all;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.fastaccess.R;
|
||||
@ -36,11 +37,6 @@ public class AllNotificationsPresenter extends BasePresenter<AllNotificationsMvp
|
||||
if (item.isUnread() && !PrefGetter.isMarkAsReadEnabled()) {
|
||||
markAsRead(position, v, item);
|
||||
}
|
||||
} else if (v.getId() == R.id.unsubsribe) {
|
||||
item.setUnread(false);
|
||||
manageDisposable(item.save(item));
|
||||
sendToView(view -> view.onUpdateReadState(new GroupedNotificationModel(item), position));
|
||||
ReadNotificationService.unSubscribe(v.getContext(), item.getId());
|
||||
} else {
|
||||
if (item.getSubject() != null && item.getSubject().getUrl() != null) {
|
||||
if (item.isUnread() && !PrefGetter.isMarkAsReadEnabled()) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.fastaccess.ui.modules.notification.unread;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.fastaccess.R;
|
||||
@ -31,11 +32,6 @@ public class UnreadNotificationsPresenter extends BasePresenter<UnreadNotificati
|
||||
Notification item = model.getNotification();
|
||||
if (v.getId() == R.id.markAsRead) {
|
||||
if (item.isUnread()) markAsRead(position, v, item);
|
||||
} else if (v.getId() == R.id.unsubsribe) {
|
||||
item.setUnread(false);
|
||||
manageDisposable(item.save(item));
|
||||
sendToView(view -> view.onRemove(position));
|
||||
ReadNotificationService.unSubscribe(v.getContext(), item.getId());
|
||||
} else {
|
||||
if (item.getSubject() != null && item.getSubject().getUrl() != null) {
|
||||
if (item.isUnread() && !PrefGetter.isMarkAsReadEnabled()) {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@ -30,7 +29,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginEnd="@dimen/avatar_margin_end"
|
||||
tools:src="@drawable/ic_issues"/>
|
||||
tools:src="@drawable/ic_issues" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -47,7 +46,7 @@
|
||||
android:maxLines="5"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
tools:text="When one acquires music and afterlife, one is able to capture heaven."/>
|
||||
tools:text="When one acquires music and afterlife, one is able to capture heaven." />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -73,7 +72,7 @@
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:visibility="gone"
|
||||
tools:text="50 minutes ago"
|
||||
tools:visibility="visible"/>
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.fastaccess.ui.widgets.FontTextView
|
||||
android:id="@+id/date"
|
||||
@ -83,7 +82,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:gravity="start|center"
|
||||
android:textColor="?android:textColorTertiary"
|
||||
tools:text="50 minutes ago"/>
|
||||
tools:text="50 minutes ago" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -103,15 +102,6 @@
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.fastaccess.ui.widgets.ForegroundImageView
|
||||
android:id="@+id/unsubsribe"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/un_subscribe"
|
||||
android:padding="@dimen/spacing_micro"
|
||||
android:src="@drawable/ic_unsubscribe"/>
|
||||
|
||||
<com.fastaccess.ui.widgets.ForegroundImageView
|
||||
android:id="@+id/markAsRead"
|
||||
android:layout_width="wrap_content"
|
||||
@ -120,7 +110,7 @@
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/un_subscribe"
|
||||
android:padding="@dimen/spacing_micro"
|
||||
android:src="@drawable/ic_done"/>
|
||||
android:src="@drawable/ic_done" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user