Loading app/src/main/java/app/fedilab/android/activities/ContextActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public class ContextActivity extends BaseActivity { focusedStatus = null; // or other values if (b != null) focusedStatus = (Status) b.getSerializable(Helper.ARG_STATUS); if (focusedStatus == null && currentAccount == null || currentAccount.mastodon_account == null) { if (focusedStatus == null || currentAccount == null || currentAccount.mastodon_account == null) { finish(); return; } Loading app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +0 −18 Original line number Diff line number Diff line Loading @@ -1787,10 +1787,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> holder.timer.cancel(); holder.timer = null; } if (holder.dateTimer != null) { holder.dateTimer.cancel(); holder.dateTimer = null; } if (status.emojis != null && status.emojis.size() > 0) { holder.timer = new Timer(); holder.timer.scheduleAtFixedRate(new TimerTask() { Loading @@ -1803,16 +1799,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> } }, 100, 100); } holder.dateTimer = new Timer(); holder.dateTimer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> holder.binding.dateShort.setText(Helper.dateDiff(context, status.created_at)); mainHandler.post(myRunnable); } }, 100, 10000); } else if (viewHolder.getItemViewType() == STATUS_ART) { StatusViewHolder holder = (StatusViewHolder) viewHolder; MastodonHelper.loadPPMastodon(holder.bindingArt.artPp, status.account); Loading Loading @@ -1881,9 +1867,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> if (holder instanceof StatusViewHolder && ((StatusViewHolder) holder).timer != null) { ((StatusViewHolder) holder).timer.cancel(); } if (holder instanceof StatusViewHolder && ((StatusViewHolder) holder).dateTimer != null) { ((StatusViewHolder) holder).dateTimer.cancel(); } } public interface FetchMoreCallBack { Loading @@ -1900,7 +1883,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> DrawerStatusNotificationBinding bindingNotification; DrawerStatusArtBinding bindingArt; Timer timer; Timer dateTimer; StatusViewHolder(DrawerStatusBinding itemView) { super(itemView.getRoot()); Loading app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java +17 −14 Original line number Diff line number Diff line Loading @@ -456,6 +456,8 @@ public class FragmentMastodonNotification extends Fragment implements Notificati } int position = 0; //We loop through messages already in the timeline if (this.notificationList != null) { notificationAdapter.notifyItemRangeChanged(0, this.notificationList.size()); for (Notification notificationsAlreadyPresent : this.notificationList) { //We compare the date of each status and we only add status having a date greater than the another, it is inserted at this position //Pinned messages are ignored because their date can be older Loading @@ -476,6 +478,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati notificationAdapter.notifyItemInserted(position); return NOTIFICATION__AT_THE_BOTTOM; } } return position; } Loading app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java +19 −15 Original line number Diff line number Diff line Loading @@ -499,6 +499,8 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. return STATUS_PRESENT; } int position = 0; if (this.statuses != null) { statusAdapter.notifyItemRangeChanged(0, this.statuses.size()); //We loop through messages already in the timeline for (Status statusAlreadyPresent : this.statuses) { //We compare the date of each status and we only add status having a date greater than the another, it is inserted at this position Loading @@ -520,6 +522,8 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. statusAdapter.notifyItemInserted(position); return STATUS_AT_THE_BOTTOM; } } return position; } Loading Loading
app/src/main/java/app/fedilab/android/activities/ContextActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public class ContextActivity extends BaseActivity { focusedStatus = null; // or other values if (b != null) focusedStatus = (Status) b.getSerializable(Helper.ARG_STATUS); if (focusedStatus == null && currentAccount == null || currentAccount.mastodon_account == null) { if (focusedStatus == null || currentAccount == null || currentAccount.mastodon_account == null) { finish(); return; } Loading
app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +0 −18 Original line number Diff line number Diff line Loading @@ -1787,10 +1787,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> holder.timer.cancel(); holder.timer = null; } if (holder.dateTimer != null) { holder.dateTimer.cancel(); holder.dateTimer = null; } if (status.emojis != null && status.emojis.size() > 0) { holder.timer = new Timer(); holder.timer.scheduleAtFixedRate(new TimerTask() { Loading @@ -1803,16 +1799,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> } }, 100, 100); } holder.dateTimer = new Timer(); holder.dateTimer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> holder.binding.dateShort.setText(Helper.dateDiff(context, status.created_at)); mainHandler.post(myRunnable); } }, 100, 10000); } else if (viewHolder.getItemViewType() == STATUS_ART) { StatusViewHolder holder = (StatusViewHolder) viewHolder; MastodonHelper.loadPPMastodon(holder.bindingArt.artPp, status.account); Loading Loading @@ -1881,9 +1867,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> if (holder instanceof StatusViewHolder && ((StatusViewHolder) holder).timer != null) { ((StatusViewHolder) holder).timer.cancel(); } if (holder instanceof StatusViewHolder && ((StatusViewHolder) holder).dateTimer != null) { ((StatusViewHolder) holder).dateTimer.cancel(); } } public interface FetchMoreCallBack { Loading @@ -1900,7 +1883,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> DrawerStatusNotificationBinding bindingNotification; DrawerStatusArtBinding bindingArt; Timer timer; Timer dateTimer; StatusViewHolder(DrawerStatusBinding itemView) { super(itemView.getRoot()); Loading
app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java +17 −14 Original line number Diff line number Diff line Loading @@ -456,6 +456,8 @@ public class FragmentMastodonNotification extends Fragment implements Notificati } int position = 0; //We loop through messages already in the timeline if (this.notificationList != null) { notificationAdapter.notifyItemRangeChanged(0, this.notificationList.size()); for (Notification notificationsAlreadyPresent : this.notificationList) { //We compare the date of each status and we only add status having a date greater than the another, it is inserted at this position //Pinned messages are ignored because their date can be older Loading @@ -476,6 +478,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati notificationAdapter.notifyItemInserted(position); return NOTIFICATION__AT_THE_BOTTOM; } } return position; } Loading
app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java +19 −15 Original line number Diff line number Diff line Loading @@ -499,6 +499,8 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. return STATUS_PRESENT; } int position = 0; if (this.statuses != null) { statusAdapter.notifyItemRangeChanged(0, this.statuses.size()); //We loop through messages already in the timeline for (Status statusAlreadyPresent : this.statuses) { //We compare the date of each status and we only add status having a date greater than the another, it is inserted at this position Loading @@ -520,6 +522,8 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. statusAdapter.notifyItemInserted(position); return STATUS_AT_THE_BOTTOM; } } return position; } Loading