mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-12-25 16:20:20 +02:00
Display quotes in notifications
This commit is contained in:
parent
89c68998e0
commit
2e673db1a7
4 changed files with 36 additions and 4 deletions
|
|
@ -72,6 +72,8 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
private final int TYPE_ADMIN_SIGNUP = 11;
|
||||
private final int TYPE_ADMIN_REPORT = 12;
|
||||
private final int TYPE_HIDDEN = 13;
|
||||
private final int TYPE_QUOTE = 14;
|
||||
|
||||
public FetchMoreCallBack fetchMoreCallBack;
|
||||
private Context context;
|
||||
private RecyclerView mRecyclerView;
|
||||
|
|
@ -160,6 +162,13 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
return TYPE_HIDDEN;
|
||||
}
|
||||
}
|
||||
case "quote" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_QUOTE;
|
||||
} else {
|
||||
return TYPE_HIDDEN;
|
||||
}
|
||||
}
|
||||
case "update" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_UPDATE;
|
||||
|
|
@ -351,7 +360,9 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
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_UPDATE) {
|
||||
} else if (getItemViewType(position) == TYPE_QUOTE) {
|
||||
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_format_quote_24);
|
||||
}else if (getItemViewType(position) == TYPE_UPDATE) {
|
||||
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_edit_24);
|
||||
} else if (getItemViewType(position) == TYPE_REACTION) {
|
||||
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_insert_emoticon_24);
|
||||
|
|
@ -384,7 +395,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
statusManagement(context, statusesVM, searchVM, holderStatus, mRecyclerView, this, null, notification.status, Timeline.TimeLineEnum.NOTIFICATION, false, true, false, null);
|
||||
holderStatus.bindingNotification.status.dateShort.setText(Helper.dateDiff(context, notification.created_at));
|
||||
holderStatus.bindingNotification.status.pronouns.setVisibility(View.GONE);
|
||||
if (getItemViewType(position) == TYPE_MENTION || getItemViewType(position) == TYPE_STATUS || getItemViewType(position) == TYPE_REACTION) {
|
||||
if (getItemViewType(position) == TYPE_MENTION || getItemViewType(position) == TYPE_STATUS || getItemViewType(position) == TYPE_REACTION || getItemViewType(position) == TYPE_QUOTE ) {
|
||||
holderStatus.bindingNotification.status.actionButtons.setVisibility(View.VISIBLE);
|
||||
String title = "";
|
||||
if (getItemViewType(position) == TYPE_MENTION) {
|
||||
|
|
@ -434,7 +445,10 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
} else if (getItemViewType(position) == TYPE_REBLOG) {
|
||||
// title = String.format(Locale.getDefault(), "%s %s", notification.account.display_name, context.getString(R.string.notif_reblog));
|
||||
title = notification.account.display_name;
|
||||
} else if (getItemViewType(position) == TYPE_UPDATE) {
|
||||
} else if (getItemViewType(position) == TYPE_QUOTE) {
|
||||
// title = String.format(Locale.getDefault(), "%s %s", notification.account.display_name, context.getString(R.string.notif_reblog));
|
||||
title = notification.account.display_name;
|
||||
}else if (getItemViewType(position) == TYPE_UPDATE) {
|
||||
// title = String.format(Locale.getDefault(), "%s %s", notification.account.display_name, context.getString(R.string.notif_update));
|
||||
title = notification.account.display_name;
|
||||
} else if (getItemViewType(position) == TYPE_POLL) {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ public class FragmentNotificationContainer extends Fragment {
|
|||
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_reply_24));
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_star_24));
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_repeat));
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_format_quote_24));
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_poll_24));
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_home_24));
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(R.drawable.ic_baseline_person_add_alt_1_24));
|
||||
|
|
@ -103,6 +104,7 @@ public class FragmentNotificationContainer extends Fragment {
|
|||
dialogView.displayMentions.setChecked(true);
|
||||
dialogView.displayFavourites.setChecked(true);
|
||||
dialogView.displayReblogs.setChecked(true);
|
||||
dialogView.displayQuotes.setChecked(true);
|
||||
dialogView.displayPollResults.setChecked(true);
|
||||
dialogView.displayUpdatesFromPeople.setChecked(true);
|
||||
dialogView.displayFollows.setChecked(true);
|
||||
|
|
@ -127,6 +129,10 @@ public class FragmentNotificationContainer extends Fragment {
|
|||
excludedCategoriesList.add("reblog");
|
||||
dialogView.displayReblogs.setChecked(false);
|
||||
}
|
||||
case "quote" -> {
|
||||
excludedCategoriesList.add("quote");
|
||||
dialogView.displayQuotes.setChecked(false);
|
||||
}
|
||||
case "poll" -> {
|
||||
excludedCategoriesList.add("poll");
|
||||
dialogView.displayPollResults.setChecked(false);
|
||||
|
|
@ -163,7 +169,9 @@ public class FragmentNotificationContainer extends Fragment {
|
|||
notificationType = "favourite";
|
||||
} else if (checkedId == R.id.display_reblogs) {
|
||||
notificationType = "reblog";
|
||||
} else if (checkedId == R.id.display_poll_results) {
|
||||
} else if (checkedId == R.id.display_quotes) {
|
||||
notificationType = "quote";
|
||||
}else if (checkedId == R.id.display_poll_results) {
|
||||
notificationType = "poll";
|
||||
} else if (checkedId == R.id.display_updates_from_people) {
|
||||
notificationType = "status";
|
||||
|
|
|
|||
|
|
@ -78,6 +78,15 @@
|
|||
android:text="@string/notif_display_reblogs"
|
||||
app:icon="@drawable/ic_baseline_repeat_24" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/display_quotes"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/notif_display_quotes"
|
||||
app:icon="@drawable/ic_baseline_format_quote_24" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/display_poll_results"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
|
||||
|
|
|
|||
|
|
@ -748,6 +748,7 @@
|
|||
<string name="notif_display_mentions">Mentions</string>
|
||||
<string name="notif_display_favourites">Favourites</string>
|
||||
<string name="notif_display_reblogs">Reblogs</string>
|
||||
<string name="notif_display_quotes">Quotes</string>
|
||||
<string name="notif_display_poll_results">Poll results</string>
|
||||
<string name="notif_display_updates_from_people">Updates from people</string>
|
||||
<string name="notif_display_follows">Follows</string>
|
||||
|
|
|
|||
Loading…
Reference in a new issue