Fix issue #88 - Add icon indicators in notifications

pull/95/head
Thomas 3 years ago
parent 6fb830aefe
commit c80860c53a

@ -134,6 +134,18 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
}); });
} else { } else {
StatusAdapter.StatusViewHolder holderStatus = (StatusAdapter.StatusViewHolder) viewHolder; StatusAdapter.StatusViewHolder holderStatus = (StatusAdapter.StatusViewHolder) viewHolder;
holderStatus.bindingNotification.status.typeOfNotification.setVisibility(View.VISIBLE);
if (getItemViewType(position) == TYPE_MENTION) {
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_message_24);
} else if (getItemViewType(position) == TYPE_STATUS) {
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_message_24);
} else if (getItemViewType(position) == TYPE_FAVOURITE) {
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_star_24);
} else if (getItemViewType(position) == TYPE_REBLOG) {
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_repeat_24);
} else if (getItemViewType(position) == TYPE_POLL) {
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_poll_24);
}
StatusesVM statusesVM = new ViewModelProvider((ViewModelStoreOwner) context).get(StatusesVM.class); StatusesVM statusesVM = new ViewModelProvider((ViewModelStoreOwner) context).get(StatusesVM.class);
SearchVM searchVM = new ViewModelProvider((ViewModelStoreOwner) context).get(SearchVM.class); SearchVM searchVM = new ViewModelProvider((ViewModelStoreOwner) context).get(SearchVM.class);
statusManagement(context, statusesVM, searchVM, holderStatus, this, null, notificationList, notification.status, Timeline.TimeLineEnum.NOTIFICATION, false); statusManagement(context, statusesVM, searchVM, holderStatus, this, null, notificationList, notification.status, Timeline.TimeLineEnum.NOTIFICATION, false);

@ -19,7 +19,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="12dp" android:layout_margin="6dp"
app:cardElevation="2dp"> app:cardElevation="2dp">
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
@ -28,13 +28,30 @@
android:orientation="vertical" android:orientation="vertical"
android:padding="6dp"> android:padding="6dp">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="middle" android:orientation="horizontal">
android:singleLine="true"
tools:text="User asked to follow you" /> <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="middle"
android:singleLine="true"
tools:text="User asked to follow you" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginStart="5dp"
android:src="@drawable/ic_baseline_supervised_user_circle_24"
android:tint="@color/cyanea_accent_reference" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"

@ -95,6 +95,7 @@
android:src="@drawable/ic_person" /> android:src="@drawable/ic_person" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/status_pinned" android:id="@+id/status_pinned"
android:layout_width="20dp" android:layout_width="20dp"
@ -104,6 +105,16 @@
android:src="@drawable/ic_baseline_push_pin_24" android:src="@drawable/ic_baseline_push_pin_24"
android:visibility="gone" /> android:visibility="gone" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/type_of_notification"
android:layout_height="20dp"
android:layout_gravity="center_vertical|end"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:tint="@color/cyanea_accent_reference"
android:layout_width="20dp"
android:visibility="gone" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.divider.MaterialDivider <com.google.android.material.divider.MaterialDivider

Loading…
Cancel
Save