Remove old settings + fix scroll with fav.

pull/434/head
Thomas 2 years ago
parent c23be87ff4
commit dbaf2a379a

@ -253,13 +253,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
if (timelineType != null) { if (timelineType != null) {
slug = timelineType.getValue() + (ident != null ? "|" + ident : ""); slug = timelineType.getValue() + (ident != null ? "|" + ident : "");
} }
//Only fragment in main view pager should not have the view initialized
//AND Only the first fragment will initialize its view
if (!isViewInitialized) {
if (slug != null) {
isViewInitialized = slug.compareTo(Helper.getSlugOfFirstFragment(requireActivity(), currentUserID, currentInstance)) == 0;
}
}
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION)); LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION));
@ -278,9 +272,18 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
binding.loader.setVisibility(View.VISIBLE); binding.loader.setVisibility(View.VISIBLE);
binding.recyclerView.setVisibility(View.GONE); binding.recyclerView.setVisibility(View.GONE);
max_id = statusReport != null ? statusReport.id : null; max_id = statusReport != null ? statusReport.id : null;
if (max_id == null) { //Inner marker are only for pinned timelines and main timelines, they have isViewInitialized set to false
if (max_id == null && !isViewInitialized) {
max_id = sharedpreferences.getString(getString(R.string.SET_INNER_MARKER) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance + slug, null); max_id = sharedpreferences.getString(getString(R.string.SET_INNER_MARKER) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance + slug, null);
} }
//Only fragment in main view pager should not have the view initialized
//AND Only the first fragment will initialize its view
if (!isViewInitialized) {
if (slug != null) {
isViewInitialized = slug.compareTo(Helper.getSlugOfFirstFragment(requireActivity(), currentUserID, currentInstance)) == 0;
}
}
flagLoading = false; flagLoading = false;
router(null); router(null);
@ -299,6 +302,8 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
binding.swipeContainer.setRefreshing(false); binding.swipeContainer.setRefreshing(false);
binding.loadingNextElements.setVisibility(View.GONE); binding.loadingNextElements.setVisibility(View.GONE);
flagLoading = false; flagLoading = false;
if (timelineStatuses != null && fetched_statuses != null && fetched_statuses.statuses != null && fetched_statuses.statuses.size() > 0) { if (timelineStatuses != null && fetched_statuses != null && fetched_statuses.statuses != null && fetched_statuses.statuses.size() > 0) {
try { try {
if (statusToUpdate != null) { if (statusToUpdate != null) {
@ -318,7 +323,6 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
} }
} catch (Exception ignored) { } catch (Exception ignored) {
} }
flagLoading = fetched_statuses.pagination.max_id == null; flagLoading = fetched_statuses.pagination.max_id == null;
binding.noAction.setVisibility(View.GONE); binding.noAction.setVisibility(View.GONE);
if (timelineType == Timeline.TimeLineEnum.ART) { if (timelineType == Timeline.TimeLineEnum.ART) {

@ -13,9 +13,9 @@
app:singleLineTitle="false" app:singleLineTitle="false"
app:summary="@string/set_capitalize_indication" app:summary="@string/set_capitalize_indication"
app:title="@string/set_capitalize" /> app:title="@string/set_capitalize" />
<!--
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:defaultValue="true" app:defaultValue="false"
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
app:key="@string/SET_PICTURE_COMPRESSED" app:key="@string/SET_PICTURE_COMPRESSED"
app:singleLineTitle="false" app:singleLineTitle="false"
@ -23,13 +23,13 @@
app:title="@string/set_resize_picture" /> app:title="@string/set_resize_picture" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:defaultValue="true" app:defaultValue="false"
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
app:key="@string/SET_VIDEO_COMPRESSED" app:key="@string/SET_VIDEO_COMPRESSED"
app:singleLineTitle="false" app:singleLineTitle="false"
app:summary="@string/set_resize_video_indication" app:summary="@string/set_resize_video_indication"
app:title="@string/set_resize_video" /> app:title="@string/set_resize_video" />
-->
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:defaultValue="false" app:defaultValue="false"
app:iconSpaceReserved="false" app:iconSpaceReserved="false"

Loading…
Cancel
Save