Fix issue #994 - Add a scroll bar for timelines (default: disabled)

This commit is contained in:
Thomas 2023-12-21 18:11:51 +01:00
parent 7554238052
commit 24fbf41d08
19 changed files with 88 additions and 11 deletions

View file

@ -14,17 +14,15 @@ package app.fedilab.android.mastodon.helper;
* You should have received a copy of the GNU General Public License along with Fedilab; if not, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.mastodon.helper.Helper.mentionLongPattern;
import static app.fedilab.android.mastodon.helper.Helper.mentionPattern;
import static app.fedilab.android.mastodon.helper.Helper.mentionPatternALL; import static app.fedilab.android.mastodon.helper.Helper.mentionPatternALL;
import static app.fedilab.android.mastodon.helper.MastodonHelper.countWithEmoji;
import android.util.Patterns; import android.util.Patterns;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import app.fedilab.android.mastodon.ui.drawer.ComposeAdapter;
public class ComposeHelper { public class ComposeHelper {

View file

@ -15,6 +15,7 @@ package app.fedilab.android.mastodon.ui.fragment.admin;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -24,6 +25,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -63,6 +65,9 @@ public class FragmentAdminAccount extends Fragment {
} }
flagLoading = false; flagLoading = false;
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
return binding.getRoot(); return binding.getRoot();
} }

View file

@ -16,6 +16,7 @@ package app.fedilab.android.mastodon.ui.fragment.admin;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -25,6 +26,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -119,7 +121,9 @@ public class FragmentAdminDomain extends Fragment {
); );
adminVM = new ViewModelProvider(FragmentAdminDomain.this).get(viewModelKey, AdminVM.class); adminVM = new ViewModelProvider(FragmentAdminDomain.this).get(viewModelKey, AdminVM.class);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
binding.noActionText.setText(R.string.no_blocked_domains); binding.noActionText.setText(R.string.no_blocked_domains);
binding.loader.setVisibility(View.VISIBLE); binding.loader.setVisibility(View.VISIBLE);
binding.recyclerView.setVisibility(View.GONE); binding.recyclerView.setVisibility(View.GONE);

View file

@ -15,6 +15,7 @@ package app.fedilab.android.mastodon.ui.fragment.admin;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -24,6 +25,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -69,7 +71,9 @@ public class FragmentAdminReport extends Fragment {
} }
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent);
binding.swipeContainer.setColorSchemeColors( binding.swipeContainer.setColorSchemeColors(
c1, c1, c1 c1, c1, c1

View file

@ -14,6 +14,7 @@ package app.fedilab.android.mastodon.ui.fragment.media;
* You should have received a copy of the GNU General Public License along with Fedilab; if not, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -23,6 +24,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -63,6 +65,9 @@ public class FragmentMediaProfile extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
Bundle bundle = this.getArguments(); Bundle bundle = this.getArguments();
if (bundle != null) { if (bundle != null) {
accountTimeline = (Account) getArguments().getSerializable(Helper.ARG_ACCOUNT); accountTimeline = (Account) getArguments().getSerializable(Helper.ARG_ACCOUNT);

View file

@ -26,9 +26,11 @@ import androidx.preference.SwitchPreferenceCompat;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.activities.MainActivity; import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.mastodon.helper.Helper;
public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
boolean recreate;
@Override @Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.pref_timelines); addPreferencesFromResource(R.xml.pref_timelines);
@ -78,7 +80,7 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen
boolean checked = sharedpreferences.getBoolean(getString(R.string.SET_PIXELFED_PRESENTATION) + MainActivity.currentUserID + MainActivity.currentInstance, false); boolean checked = sharedpreferences.getBoolean(getString(R.string.SET_PIXELFED_PRESENTATION) + MainActivity.currentUserID + MainActivity.currentInstance, false);
SET_PIXELFED_PRESENTATION.setChecked(checked); SET_PIXELFED_PRESENTATION.setChecked(checked);
} }
recreate = false;
} }
@Override @Override
@ -89,6 +91,9 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen
if (key.compareToIgnoreCase(getString(R.string.SET_TRANSLATOR)) == 0) { if (key.compareToIgnoreCase(getString(R.string.SET_TRANSLATOR)) == 0) {
createPref(); createPref();
} }
if (key.compareToIgnoreCase(getString(R.string.SET_TIMELINE_SCROLLBAR)) == 0) {
recreate = true;
}
if (key.compareToIgnoreCase(getString(R.string.SET_DISPLAY_BOOKMARK)) == 0) { if (key.compareToIgnoreCase(getString(R.string.SET_DISPLAY_BOOKMARK)) == 0) {
SwitchPreferenceCompat SET_DISPLAY_BOOKMARK = findPreference(getString(R.string.SET_DISPLAY_BOOKMARK)); SwitchPreferenceCompat SET_DISPLAY_BOOKMARK = findPreference(getString(R.string.SET_DISPLAY_BOOKMARK));
if (SET_DISPLAY_BOOKMARK != null) { if (SET_DISPLAY_BOOKMARK != null) {
@ -124,6 +129,11 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen
super.onPause(); super.onPause();
getPreferenceScreen().getSharedPreferences() getPreferenceScreen().getSharedPreferences()
.unregisterOnSharedPreferenceChangeListener(this); .unregisterOnSharedPreferenceChangeListener(this);
if (recreate) {
recreate = false;
requireActivity().recreate();
Helper.recreateMainActivity(requireActivity());
}
} }

View file

@ -19,6 +19,7 @@ import static app.fedilab.android.BaseMainActivity.currentInstance;
import static app.fedilab.android.BaseMainActivity.currentToken; import static app.fedilab.android.BaseMainActivity.currentToken;
import static app.fedilab.android.mastodon.helper.MastodonHelper.ACCOUNTS_PER_CALL; import static app.fedilab.android.mastodon.helper.MastodonHelper.ACCOUNTS_PER_CALL;
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -28,6 +29,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -103,6 +105,9 @@ public class FragmentMastodonAccount extends Fragment {
flagLoading = false; flagLoading = false;
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
return binding.getRoot(); return binding.getRoot();
} }

View file

@ -14,6 +14,7 @@ package app.fedilab.android.mastodon.ui.fragment.timeline;
* You should have received a copy of the GNU General Public License along with Fedilab; if not, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -22,6 +23,7 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import java.util.List; import java.util.List;
@ -45,6 +47,9 @@ public class FragmentMastodonAnnouncement extends Fragment {
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
View root = binding.getRoot(); View root = binding.getRoot();
announcementsVM = new ViewModelProvider(FragmentMastodonAnnouncement.this).get(AnnouncementsVM.class); announcementsVM = new ViewModelProvider(FragmentMastodonAnnouncement.this).get(AnnouncementsVM.class);
binding.loader.setVisibility(View.VISIBLE); binding.loader.setVisibility(View.VISIBLE);

View file

@ -20,6 +20,7 @@ import static app.fedilab.android.mastodon.activities.ContextActivity.expand;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -31,6 +32,7 @@ import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import java.util.ArrayList; import java.util.ArrayList;
@ -175,6 +177,9 @@ public class FragmentMastodonContext extends Fragment {
} }
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
statusesVM = new ViewModelProvider(FragmentMastodonContext.this).get(StatusesVM.class); statusesVM = new ViewModelProvider(FragmentMastodonContext.this).get(StatusesVM.class);
binding.recyclerView.setNestedScrollingEnabled(true); binding.recyclerView.setNestedScrollingEnabled(true);
this.statuses = new ArrayList<>(); this.statuses = new ArrayList<>();

View file

@ -82,6 +82,9 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
flagLoading = false; flagLoading = false;
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
isViewInitialized = false; isViewInitialized = false;
return binding.getRoot(); return binding.getRoot();
} }

View file

@ -15,6 +15,7 @@ package app.fedilab.android.mastodon.ui.fragment.timeline;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -24,6 +25,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -52,6 +54,9 @@ public class FragmentMastodonDomainBlock extends Fragment {
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
return binding.getRoot(); return binding.getRoot();
} }

View file

@ -201,6 +201,9 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
flagLoading = false; flagLoading = false;
isViewInitialized = false; isViewInitialized = false;
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
View root = binding.getRoot(); View root = binding.getRoot();
if (getArguments() != null) { if (getArguments() != null) {
notificationType = (NotificationTypeEnum) getArguments().get(Helper.ARG_NOTIFICATION_TYPE); notificationType = (NotificationTypeEnum) getArguments().get(Helper.ARG_NOTIFICATION_TYPE);

View file

@ -15,6 +15,7 @@ package app.fedilab.android.mastodon.ui.fragment.timeline;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -24,6 +25,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -51,6 +53,9 @@ public class FragmentMastodonSuggestion extends Fragment {
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
flagLoading = false; flagLoading = false;
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
return binding.getRoot(); return binding.getRoot();
} }

View file

@ -15,6 +15,7 @@ package app.fedilab.android.mastodon.ui.fragment.timeline;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -24,6 +25,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -63,6 +65,9 @@ public class FragmentMastodonTag extends Fragment {
} }
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
return binding.getRoot(); return binding.getRoot();
} }

View file

@ -355,9 +355,10 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
lockForResumeCall = 0; lockForResumeCall = 0;
binding.loader.setVisibility(View.VISIBLE); binding.loader.setVisibility(View.VISIBLE);
binding.recyclerView.setVisibility(View.GONE); binding.recyclerView.setVisibility(View.GONE);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
max_id = statusReport != null ? statusReport.id : null; max_id = statusReport != null ? statusReport.id : null;
offset = 0; offset = 0;
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
rememberPosition = sharedpreferences.getBoolean(getString(R.string.SET_REMEMBER_POSITION), true); rememberPosition = sharedpreferences.getBoolean(getString(R.string.SET_REMEMBER_POSITION), true);
//Inner marker are only for pinned timelines and main timelines, they have isViewInitialized set to false //Inner marker are only for pinned timelines and main timelines, they have isViewInitialized set to false
if (max_id == null && !isViewInitialized && rememberPosition) { if (max_id == null && !isViewInitialized && rememberPosition) {
@ -459,6 +460,9 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
ContextCompat.registerReceiver(requireActivity(), receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION), ContextCompat.RECEIVER_NOT_EXPORTED); ContextCompat.registerReceiver(requireActivity(), receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION), ContextCompat.RECEIVER_NOT_EXPORTED);
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
boolean displayScrollBar = sharedpreferences.getBoolean(getString(R.string.SET_TIMELINE_SCROLLBAR), false);
binding.recyclerView.setVerticalScrollBarEnabled(displayScrollBar);
return binding.getRoot(); return binding.getRoot();
} }

View file

@ -3,7 +3,7 @@
<item android:id="@android:id/background"> <item android:id="@android:id/background">
<shape> <shape>
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<solid android:color="?secondaryColor" /> <solid android:color="?colorSecondary" />
</shape> </shape>
</item> </item>
@ -17,7 +17,7 @@
<scale android:scaleWidth="100%"> <scale android:scaleWidth="100%">
<shape> <shape>
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<solid android:color="?primaryColor" /> <solid android:color="?colorPrimary" />
</shape> </shape>
</scale> </scale>
</item> </item>

View file

@ -38,7 +38,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clipToPadding="false" android:clipToPadding="false"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:scrollbars="none" /> android:scrollbarThumbVertical="?colorPrimary"
android:scrollbars="vertical" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View file

@ -1190,6 +1190,7 @@
<string name="SET_GROUP_REBLOGS" translatable="false">SET_GROUP_REBLOGS</string> <string name="SET_GROUP_REBLOGS" translatable="false">SET_GROUP_REBLOGS</string>
<string name="SET_BOOST_ORIGINAL_DATE" translatable="false">SET_BOOST_ORIGINAL_DATE</string> <string name="SET_BOOST_ORIGINAL_DATE" translatable="false">SET_BOOST_ORIGINAL_DATE</string>
<string name="SET_TIMELINE_SCROLLBAR" translatable="false">SET_TIMELINE_SCROLLBAR</string>
<string name="SET_MARKDOWN_SUPPORT" translatable="false">SET_MARKDOWN_SUPPORT</string> <string name="SET_MARKDOWN_SUPPORT" translatable="false">SET_MARKDOWN_SUPPORT</string>
<string name="SET_TRUNCATE_LINKS" translatable="false">SET_TRUNCATE_LINKS</string> <string name="SET_TRUNCATE_LINKS" translatable="false">SET_TRUNCATE_LINKS</string>
<string name="SET_UNDERLINE_CLICKABLE" translatable="false">SET_UNDERLINE_CLICKABLE</string> <string name="SET_UNDERLINE_CLICKABLE" translatable="false">SET_UNDERLINE_CLICKABLE</string>
@ -1951,6 +1952,7 @@
<string name="also_followed_by">Followed by:</string> <string name="also_followed_by">Followed by:</string>
<string name="Directory">Directory</string> <string name="Directory">Directory</string>
<string name="boost_original_date">Display original date for boosts</string> <string name="boost_original_date">Display original date for boosts</string>
<string name="timeline_scrollbar">Display a scroll bar for timelines</string>
<string name="markdown_support">Markdown support</string> <string name="markdown_support">Markdown support</string>
<string name="set_disable_release_notes">Disable release notes</string> <string name="set_disable_release_notes">Disable release notes</string>
<string name="set_disable_release_notes_indication">When a new version is published, you will not be alerted inside the app.</string> <string name="set_disable_release_notes_indication">When a new version is published, you will not be alerted inside the app.</string>

View file

@ -50,6 +50,14 @@
app:singleLineTitle="false" app:singleLineTitle="false"
app:title="@string/boost_original_date" /> app:title="@string/boost_original_date" />
<SwitchPreferenceCompat
android:defaultValue="false"
app:iconSpaceReserved="false"
app:key="@string/SET_TIMELINE_SCROLLBAR"
app:singleLineTitle="false"
app:title="@string/timeline_scrollbar" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:defaultValue="true" android:defaultValue="true"
app:iconSpaceReserved="false" app:iconSpaceReserved="false"