Add CLEAR and FILTER buttons to notifications (#1168)

* Issue tuskyapp#762 add clear notifications button to the top of the Notifications adapter

* Issue tuskyapp#764 add the notifications filter

* Update notifications top bar buttons

* Replace PopupMenu with PopupWindow. Save notifications filter to the account table

* Disable hide top bar on empty content at the notification screen

* Add app bar behavior to the sw640 notification layout

* Fix issue with click on top notification tab
This commit is contained in:
pandasoft0 2019-04-09 20:13:54 +03:00 committed by Konrad Pozniak
commit 63e4c1d4e0
15 changed files with 1247 additions and 28 deletions

View file

@ -99,24 +99,25 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
switch (viewType) {
case VIEW_TYPE_MENTION: {
View view = LayoutInflater.from(parent.getContext())
View view = inflater
.inflate(R.layout.item_status, parent, false);
return new StatusViewHolder(view, useAbsoluteTime);
}
case VIEW_TYPE_STATUS_NOTIFICATION: {
View view = LayoutInflater.from(parent.getContext())
View view = inflater
.inflate(R.layout.item_status_notification, parent, false);
return new StatusNotificationViewHolder(view, useAbsoluteTime);
}
case VIEW_TYPE_FOLLOW: {
View view = LayoutInflater.from(parent.getContext())
View view = inflater
.inflate(R.layout.item_follow, parent, false);
return new FollowViewHolder(view);
}
case VIEW_TYPE_PLACEHOLDER: {
View view = LayoutInflater.from(parent.getContext())
View view = inflater
.inflate(R.layout.item_status_placeholder, parent, false);
return new PlaceholderViewHolder(view);
}