Search in sources :

Example 21 with Notification

use of com.keylesspalace.tusky.entity.Notification in project Tusky by tuskyapp.

the class NotificationsFragment method onOpenReblog.

@Override
public void onOpenReblog(int position) {
    Notification notification = notifications.get(position).getAsRight();
    onViewAccount(notification.getAccount().getId());
}
Also used : Notification(com.keylesspalace.tusky.entity.Notification)

Example 22 with Notification

use of com.keylesspalace.tusky.entity.Notification in project Tusky by Vavassor.

the class NotificationsFragment method onOpenReblog.

@Override
public void onOpenReblog(int position) {
    Notification notification = notifications.get(position).asRight();
    onViewAccount(notification.getAccount().getId());
}
Also used : Notification(com.keylesspalace.tusky.entity.Notification)

Example 23 with Notification

use of com.keylesspalace.tusky.entity.Notification in project Tusky by Vavassor.

the class NotificationsFragment method onViewMedia.

@Override
public void onViewMedia(int position, int attachmentIndex, @Nullable View view) {
    Notification notification = notifications.get(position).asRightOrNull();
    if (notification == null || notification.getStatus() == null)
        return;
    Status status = notification.getStatus();
    super.viewMedia(attachmentIndex, AttachmentViewData.list(status), view);
}
Also used : Status(com.keylesspalace.tusky.entity.Status) Notification(com.keylesspalace.tusky.entity.Notification)

Example 24 with Notification

use of com.keylesspalace.tusky.entity.Notification in project Tusky by Vavassor.

the class NotificationsFragment method onMore.

@Override
public void onMore(@NonNull View view, int position) {
    Notification notification = notifications.get(position).asRight();
    super.more(notification.getStatus(), view, position);
}
Also used : Notification(com.keylesspalace.tusky.entity.Notification)

Example 25 with Notification

use of com.keylesspalace.tusky.entity.Notification in project Tusky by Vavassor.

the class NotificationsFragment method onBookmark.

@Override
public void onBookmark(final boolean bookmark, final int position) {
    final Notification notification = notifications.get(position).asRight();
    final Status status = notification.getStatus();
    timelineCases.bookmark(status.getActionableId(), bookmark).observeOn(AndroidSchedulers.mainThread()).to(autoDisposable(from(this))).subscribe((newStatus) -> setBookmarkForStatus(status.getId(), bookmark), (t) -> Log.d(getClass().getSimpleName(), "Failed to bookmark status: " + status.getId(), t));
}
Also used : Status(com.keylesspalace.tusky.entity.Status) Notification(com.keylesspalace.tusky.entity.Notification)

Aggregations

Notification (com.keylesspalace.tusky.entity.Notification)27 Status (com.keylesspalace.tusky.entity.Status)11 NotificationViewData (com.keylesspalace.tusky.viewdata.NotificationViewData)8 Either (com.keylesspalace.tusky.util.Either)5 StatusViewData (com.keylesspalace.tusky.viewdata.StatusViewData)4 AccountEntity (com.keylesspalace.tusky.db.AccountEntity)3 AccountManager (com.keylesspalace.tusky.db.AccountManager)2 Activity (android.app.Activity)1 Context (android.content.Context)1 DialogInterface (android.content.DialogInterface)1 SharedPreferences (android.content.SharedPreferences)1 Bundle (android.os.Bundle)1 Log (android.util.Log)1 SparseBooleanArray (android.util.SparseBooleanArray)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 ArrayAdapter (android.widget.ArrayAdapter)1 Button (android.widget.Button)1 ListView (android.widget.ListView)1