Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Merge branch 'settings/hide-interaction-numbers' into fork
Browse files Browse the repository at this point in the history
  • Loading branch information
sk22 committed Nov 11, 2022
2 parents fa75c8e + 596ec32 commit ff0a77d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class GlobalUserPreferences{
public static boolean showReplies;
public static boolean showBoosts;
public static boolean loadNewPosts;
public static boolean showInteractionCounts;
public static ThemePreference theme;

private static SharedPreferences getPrefs(){
Expand All @@ -24,6 +25,7 @@ public static void load(){
showReplies=prefs.getBoolean("showReplies", true);
showBoosts=prefs.getBoolean("showBoosts", true);
loadNewPosts=prefs.getBoolean("loadNewPosts", true);
showInteractionCounts=prefs.getBoolean("showInteractionCounts", true);
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
}

Expand All @@ -35,6 +37,7 @@ public static void save(){
.putBoolean("showBoosts", showBoosts)
.putBoolean("loadNewPosts", loadNewPosts)
.putBoolean("trueBlackTheme", trueBlackTheme)
.putBoolean("showInteractionCounts", showInteractionCounts)
.putInt("theme", theme.ordinal())
.apply();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public void onCreate(Bundle savedInstanceState){
GlobalUserPreferences.useCustomTabs=i.checked;
GlobalUserPreferences.save();
}));
items.add(new SwitchItem(R.string.settings_show_interaction_counts, R.drawable.ic_fluent_number_row_24_regular, GlobalUserPreferences.showInteractionCounts, i->{
GlobalUserPreferences.showInteractionCounts=i.checked;
GlobalUserPreferences.save();
}));

items.add(new HeaderItem(R.string.home_timeline));
items.add(new SwitchItem(R.string.settings_show_replies, R.drawable.ic_fluent_chat_multiple_24_regular, GlobalUserPreferences.showReplies, i->{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.widget.ImageView;
import android.widget.TextView;

import org.joinmastodon.android.GlobalUserPreferences;
import org.joinmastodon.android.R;
import org.joinmastodon.android.api.session.AccountSessionManager;
import org.joinmastodon.android.fragments.BaseStatusListFragment;
Expand Down Expand Up @@ -98,7 +99,7 @@ public void onBind(FooterStatusDisplayItem item){
}

private void bindButton(TextView btn, long count){
if(count>0 && !item.hideCounts){
if(GlobalUserPreferences.showInteractionCounts && count>0 && !item.hideCounts){
btn.setText(DecimalFormat.getIntegerInstance().format(count));
btn.setCompoundDrawablePadding(V.dp(8));
}else{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M8.75 4c1.519 0 2.75 1.231 2.75 2.75v10.5c0 1.519-1.231 2.75-2.75 2.75h-4C3.231 20 2 18.769 2 17.25V6.75C2 5.231 3.231 4 4.75 4h4zm0 1.5h-4C4.06 5.5 3.5 6.06 3.5 6.75v10.5c0 0.69 0.56 1.25 1.25 1.25h4c0.69 0 1.25-0.56 1.25-1.25V6.75C10 6.06 9.44 5.5 8.75 5.5zM19.25 4C20.769 4 22 5.231 22 6.75v10.5c0 1.519-1.231 2.75-2.75 2.75h-4c-1.519 0-2.75-1.231-2.75-2.75V6.75C12.5 5.231 13.731 4 15.25 4h4zm0 1.5h-4C14.56 5.5 14 6.06 14 6.75v10.5c0 0.69 0.56 1.25 1.25 1.25h4c0.69 0 1.25-0.56 1.25-1.25V6.75c0-0.69-0.56-1.25-1.25-1.25zM6 9v6c0 0.414 0.336 0.75 0.75 0.75S7.5 15.414 7.5 15V9c0-0.414-0.336-0.75-0.75-0.75S6 8.586 6 9zm11.5 0.75v1.5h-1.25c-0.414 0-0.75 0.336-0.75 0.75v3c0 0.414 0.336 0.75 0.75 0.75h2c0.414 0 0.75-0.336 0.75-0.75s-0.336-0.75-0.75-0.75H17v-1.5h1.25c0.414 0 0.75-0.336 0.75-0.75V9c0-0.414-0.336-0.75-0.75-0.75h-2c-0.414 0-0.75 0.336-0.75 0.75s0.336 0.75 0.75 0.75h1.25z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>
1 change: 1 addition & 0 deletions mastodon/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
<string name="settings_load_new_posts">Automatisch neue Beiträge laden</string>
<string name="settings_gif">Spiele animierte GIFs, Avatare und Emojis ab</string>
<string name="settings_custom_tabs">In-App-Browser verwenden</string>
<string name="settings_show_interaction_counts">Interaktions-Anzahlen anzeigen</string>
<string name="settings_notifications">Benachrichtigungen</string>
<string name="notify_me_when">Benachrichtige mich, wenn</string>
<string name="notify_anyone">irgendjemand</string>
Expand Down
1 change: 1 addition & 0 deletions mastodon/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
<string name="settings_load_new_posts">Automatically load new posts</string>
<string name="settings_gif">Play animated avatars and emoji</string>
<string name="settings_custom_tabs">Use in-app browser</string>
<string name="settings_show_interaction_counts">Show interaction counts</string>
<string name="settings_notifications">Notifications</string>
<string name="notify_me_when">Notify me when</string>
<string name="notify_anyone">anyone</string>
Expand Down

0 comments on commit ff0a77d

Please sign in to comment.