use of com.keylesspalace.tusky.entity.Notification in project Tusky by Vavassor.
the class NotificationsAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
if (position < notifications.size()) {
Notification notification = notifications.get(position);
Notification.Type type = notification.type;
switch(type) {
case MENTION:
{
StatusViewHolder holder = (StatusViewHolder) viewHolder;
Status status = notification.status;
holder.setupWithStatus(status, statusListener);
break;
}
case FAVOURITE:
case REBLOG:
{
StatusNotificationViewHolder holder = (StatusNotificationViewHolder) viewHolder;
holder.setMessage(type, notification.account.getDisplayName(), notification.status);
holder.setupButtons(notificationActionListener, notification.account.id);
break;
}
case FOLLOW:
{
FollowViewHolder holder = (FollowViewHolder) viewHolder;
holder.setMessage(notification.account.getDisplayName(), notification.account.username, notification.account.avatar);
holder.setupButtons(notificationActionListener, notification.account.id);
break;
}
}
}
}
use of com.keylesspalace.tusky.entity.Notification in project Tusky by Vavassor.
the class NotificationsFragment method onMore.
public void onMore(View view, int position) {
Notification notification = adapter.getItem(position);
super.more(notification.status, view, adapter, position);
}
use of com.keylesspalace.tusky.entity.Notification in project Tusky by Vavassor.
the class NotificationsFragment method onReply.
public void onReply(int position) {
Notification notification = adapter.getItem(position);
super.reply(notification.status);
}
use of com.keylesspalace.tusky.entity.Notification in project Tusky by Vavassor.
the class PushNotificationClient method onMessageReceived.
private void onMessageReceived(final Context context, String message) {
Log.v(TAG, "Notification received: " + message);
Gson gson = new GsonBuilder().registerTypeAdapter(Spanned.class, new SpannedTypeAdapter()).registerTypeAdapter(StringWithEmoji.class, new StringWithEmojiTypeAdapter()).create();
Notification notification = gson.fromJson(message, Notification.class);
NotificationMaker.make(context, NOTIFY_ID, notification);
}
Aggregations