Loading app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonConversation.java +7 −4 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ package app.fedilab.android.mastodon.ui.fragment.timeline; * see <http://www.gnu.org/licenses>. */ import static app.fedilab.android.BaseMainActivity.currentAccount; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; Loading @@ -39,6 +41,7 @@ import app.fedilab.android.R; import app.fedilab.android.databinding.FragmentPaginationBinding; import app.fedilab.android.mastodon.client.entities.api.Conversation; import app.fedilab.android.mastodon.client.entities.api.Conversations; import app.fedilab.android.mastodon.client.entities.app.BaseAccount; import app.fedilab.android.mastodon.client.entities.app.StatusCache; import app.fedilab.android.mastodon.client.entities.app.Timeline; import app.fedilab.android.mastodon.exception.DBException; Loading Loading @@ -229,7 +232,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati } private void storeMarker() { private void storeMarker(BaseAccount connectedAccount) { if (mLayoutManager != null) { int position = mLayoutManager.findFirstVisibleItemPosition(); if (conversationList != null && conversationList.size() > position) { Loading @@ -237,7 +240,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati Conversation conversation = conversationList.get(position); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putString(getString(R.string.SET_INNER_MARKER) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance + Timeline.TimeLineEnum.CONVERSATION, conversation.id); editor.putString(getString(R.string.SET_INNER_MARKER) + connectedAccount.user_id + connectedAccount.instance + Timeline.TimeLineEnum.CONVERSATION, conversation.id); editor.apply(); } catch (Exception ignored) { } Loading Loading @@ -355,14 +358,14 @@ public class FragmentMastodonConversation extends Fragment implements Conversati @Override public void onDestroyView() { if (isAdded()) { storeMarker(); storeMarker(currentAccount); } super.onDestroyView(); } @Override public void onPause() { storeMarker(); storeMarker(currentAccount); super.onPause(); } Loading app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonNotification.java +6 −5 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import app.fedilab.android.databinding.FragmentPaginationBinding; import app.fedilab.android.mastodon.client.entities.api.Notification; import app.fedilab.android.mastodon.client.entities.api.Notifications; import app.fedilab.android.mastodon.client.entities.api.Status; import app.fedilab.android.mastodon.client.entities.app.BaseAccount; import app.fedilab.android.mastodon.client.entities.app.CachedBundle; import app.fedilab.android.mastodon.client.entities.app.StatusCache; import app.fedilab.android.mastodon.client.entities.app.Timeline; Loading Loading @@ -554,7 +555,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati } private void storeMarker() { private void storeMarker(BaseAccount connectedAccount) { if (mLayoutManager != null) { int position = mLayoutManager.findFirstVisibleItemPosition(); if (notificationList != null && notificationList.size() > position) { Loading @@ -563,10 +564,10 @@ public class FragmentMastodonNotification extends Fragment implements Notificati Notification notification = notificationList.get(position); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putString(getString(R.string.SET_INNER_MARKER) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance + Timeline.TimeLineEnum.NOTIFICATION, notification.id); editor.putString(getString(R.string.SET_INNER_MARKER) + connectedAccount.user_id + connectedAccount.instance + Timeline.TimeLineEnum.NOTIFICATION, notification.id); editor.apply(); TimelinesVM timelinesVM = new ViewModelProvider(FragmentMastodonNotification.this).get(TimelinesVM.class); timelinesVM.addMarker(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, null, notification.id); timelinesVM.addMarker(connectedAccount.instance, connectedAccount.token, null, notification.id); } } catch (Exception ignored) { } Loading Loading @@ -690,14 +691,14 @@ public class FragmentMastodonNotification extends Fragment implements Notificati e.printStackTrace(); } if (isAdded()) { storeMarker(); storeMarker(currentAccount); } super.onDestroyView(); } @Override public void onPause() { storeMarker(); storeMarker(currentAccount); super.onPause(); } Loading app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonTimeline.java +6 −5 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import app.fedilab.android.mastodon.client.entities.api.Attachment; import app.fedilab.android.mastodon.client.entities.api.Pagination; import app.fedilab.android.mastodon.client.entities.api.Status; import app.fedilab.android.mastodon.client.entities.api.Statuses; import app.fedilab.android.mastodon.client.entities.app.BaseAccount; import app.fedilab.android.mastodon.client.entities.app.BubbleTimeline; import app.fedilab.android.mastodon.client.entities.app.CachedBundle; import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline; Loading Loading @@ -855,7 +856,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. @Override public void onPause() { storeMarker(); storeMarker(currentAccount); super.onPause(); } Loading @@ -863,7 +864,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. public void onDestroyView() { //Update last read id for home timeline if (isAdded()) { storeMarker(); storeMarker(currentAccount); } try { requireActivity().unregisterReceiver(receive_action); Loading @@ -873,7 +874,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. } private void storeMarker() { private void storeMarker(BaseAccount connectedAccount) { if (mLayoutManager != null) { int position = mLayoutManager.findFirstVisibleItemPosition(); if (timelineStatuses != null && timelineStatuses.size() > position) { Loading @@ -881,10 +882,10 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. Status status = timelineStatuses.get(position); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putString(getString(R.string.SET_INNER_MARKER) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance + slug, status.id); editor.putString(getString(R.string.SET_INNER_MARKER) + connectedAccount.user_id + connectedAccount.instance + slug, status.id); editor.apply(); if (timelineType == Timeline.TimeLineEnum.HOME) { timelinesVM.addMarker(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, status.id, null); timelinesVM.addMarker(connectedAccount.instance, connectedAccount.token, status.id, null); } } catch (Exception ignored) { } Loading Loading
app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonConversation.java +7 −4 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ package app.fedilab.android.mastodon.ui.fragment.timeline; * see <http://www.gnu.org/licenses>. */ import static app.fedilab.android.BaseMainActivity.currentAccount; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; Loading @@ -39,6 +41,7 @@ import app.fedilab.android.R; import app.fedilab.android.databinding.FragmentPaginationBinding; import app.fedilab.android.mastodon.client.entities.api.Conversation; import app.fedilab.android.mastodon.client.entities.api.Conversations; import app.fedilab.android.mastodon.client.entities.app.BaseAccount; import app.fedilab.android.mastodon.client.entities.app.StatusCache; import app.fedilab.android.mastodon.client.entities.app.Timeline; import app.fedilab.android.mastodon.exception.DBException; Loading Loading @@ -229,7 +232,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati } private void storeMarker() { private void storeMarker(BaseAccount connectedAccount) { if (mLayoutManager != null) { int position = mLayoutManager.findFirstVisibleItemPosition(); if (conversationList != null && conversationList.size() > position) { Loading @@ -237,7 +240,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati Conversation conversation = conversationList.get(position); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putString(getString(R.string.SET_INNER_MARKER) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance + Timeline.TimeLineEnum.CONVERSATION, conversation.id); editor.putString(getString(R.string.SET_INNER_MARKER) + connectedAccount.user_id + connectedAccount.instance + Timeline.TimeLineEnum.CONVERSATION, conversation.id); editor.apply(); } catch (Exception ignored) { } Loading Loading @@ -355,14 +358,14 @@ public class FragmentMastodonConversation extends Fragment implements Conversati @Override public void onDestroyView() { if (isAdded()) { storeMarker(); storeMarker(currentAccount); } super.onDestroyView(); } @Override public void onPause() { storeMarker(); storeMarker(currentAccount); super.onPause(); } Loading
app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonNotification.java +6 −5 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import app.fedilab.android.databinding.FragmentPaginationBinding; import app.fedilab.android.mastodon.client.entities.api.Notification; import app.fedilab.android.mastodon.client.entities.api.Notifications; import app.fedilab.android.mastodon.client.entities.api.Status; import app.fedilab.android.mastodon.client.entities.app.BaseAccount; import app.fedilab.android.mastodon.client.entities.app.CachedBundle; import app.fedilab.android.mastodon.client.entities.app.StatusCache; import app.fedilab.android.mastodon.client.entities.app.Timeline; Loading Loading @@ -554,7 +555,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati } private void storeMarker() { private void storeMarker(BaseAccount connectedAccount) { if (mLayoutManager != null) { int position = mLayoutManager.findFirstVisibleItemPosition(); if (notificationList != null && notificationList.size() > position) { Loading @@ -563,10 +564,10 @@ public class FragmentMastodonNotification extends Fragment implements Notificati Notification notification = notificationList.get(position); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putString(getString(R.string.SET_INNER_MARKER) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance + Timeline.TimeLineEnum.NOTIFICATION, notification.id); editor.putString(getString(R.string.SET_INNER_MARKER) + connectedAccount.user_id + connectedAccount.instance + Timeline.TimeLineEnum.NOTIFICATION, notification.id); editor.apply(); TimelinesVM timelinesVM = new ViewModelProvider(FragmentMastodonNotification.this).get(TimelinesVM.class); timelinesVM.addMarker(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, null, notification.id); timelinesVM.addMarker(connectedAccount.instance, connectedAccount.token, null, notification.id); } } catch (Exception ignored) { } Loading Loading @@ -690,14 +691,14 @@ public class FragmentMastodonNotification extends Fragment implements Notificati e.printStackTrace(); } if (isAdded()) { storeMarker(); storeMarker(currentAccount); } super.onDestroyView(); } @Override public void onPause() { storeMarker(); storeMarker(currentAccount); super.onPause(); } Loading
app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonTimeline.java +6 −5 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import app.fedilab.android.mastodon.client.entities.api.Attachment; import app.fedilab.android.mastodon.client.entities.api.Pagination; import app.fedilab.android.mastodon.client.entities.api.Status; import app.fedilab.android.mastodon.client.entities.api.Statuses; import app.fedilab.android.mastodon.client.entities.app.BaseAccount; import app.fedilab.android.mastodon.client.entities.app.BubbleTimeline; import app.fedilab.android.mastodon.client.entities.app.CachedBundle; import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline; Loading Loading @@ -855,7 +856,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. @Override public void onPause() { storeMarker(); storeMarker(currentAccount); super.onPause(); } Loading @@ -863,7 +864,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. public void onDestroyView() { //Update last read id for home timeline if (isAdded()) { storeMarker(); storeMarker(currentAccount); } try { requireActivity().unregisterReceiver(receive_action); Loading @@ -873,7 +874,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. } private void storeMarker() { private void storeMarker(BaseAccount connectedAccount) { if (mLayoutManager != null) { int position = mLayoutManager.findFirstVisibleItemPosition(); if (timelineStatuses != null && timelineStatuses.size() > position) { Loading @@ -881,10 +882,10 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. Status status = timelineStatuses.get(position); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putString(getString(R.string.SET_INNER_MARKER) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance + slug, status.id); editor.putString(getString(R.string.SET_INNER_MARKER) + connectedAccount.user_id + connectedAccount.instance + slug, status.id); editor.apply(); if (timelineType == Timeline.TimeLineEnum.HOME) { timelinesVM.addMarker(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, status.id, null); timelinesVM.addMarker(connectedAccount.instance, connectedAccount.token, status.id, null); } } catch (Exception ignored) { } Loading