Fixes issue #175 - Hide Post Numbers

This commit is contained in:
stom79 2017-12-22 07:00:02 +01:00
parent c7350282c7
commit 4dd0d94c2c
7 changed files with 50 additions and 11 deletions

View File

@ -257,8 +257,11 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
holder.notification_status_content.setMovementMethod(null);
holder.notification_status_content.setMovementMethod(LinkMovementMethod.getInstance());
holder.status_favorite_count.setText(String.valueOf(status.getFavourites_count()));
holder.status_reblog_count.setText(String.valueOf(status.getReblogs_count()));
boolean displayBoost = sharedpreferences.getBoolean(Helper.SET_DISPLAY_BOOST_COUNT, true);
if( displayBoost) {
holder.status_favorite_count.setText(String.valueOf(status.getFavourites_count()));
holder.status_reblog_count.setText(String.valueOf(status.getReblogs_count()));
}
holder.status_date.setText(Helper.dateDiff(context, status.getCreated_at()));
Helper.absoluteDateTimeReveal(context, holder.status_date, status.getCreated_at());

View File

@ -595,15 +595,17 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_mention_spoiler.setMovementMethod(null);
holder.status_mention_spoiler.setMovementMethod(LinkMovementMethod.getInstance());
if( status.getReblog() == null)
holder.status_favorite_count.setText(String.valueOf(status.getFavourites_count()));
else
holder.status_favorite_count.setText(String.valueOf(status.getReblog().getFavourites_count()));
if( status.getReblog() == null)
holder.status_reblog_count.setText(String.valueOf(status.getReblogs_count()));
else
holder.status_reblog_count.setText(String.valueOf(status.getReblog().getReblogs_count()));
boolean displayBoost = sharedpreferences.getBoolean(Helper.SET_DISPLAY_BOOST_COUNT, true);
if( displayBoost) {
if( status.getReblog() == null)
holder.status_favorite_count.setText(String.valueOf(status.getFavourites_count()));
else
holder.status_favorite_count.setText(String.valueOf(status.getReblog().getFavourites_count()));
if (status.getReblog() == null)
holder.status_reblog_count.setText(String.valueOf(status.getReblogs_count()));
else
holder.status_reblog_count.setText(String.valueOf(status.getReblog().getReblogs_count()));
}
holder.status_toot_date.setText(Helper.dateDiff(context, status.getCreated_at()));
Helper.absoluteDateTimeReveal(context, holder.status_toot_date, status.getCreated_at());

View File

@ -225,10 +225,26 @@ public class SettingsFragment extends Fragment {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_DISABLE_GIF, set_disable_gif.isChecked());
editor.apply();
if( getActivity() != null)
getActivity().recreate();
}
});
boolean displayBoost = sharedpreferences.getBoolean(Helper.SET_DISPLAY_BOOST_COUNT, true);
final CheckBox set_disable_counts = rootView.findViewById(R.id.set_disable_counts);
set_disable_counts.setChecked(displayBoost);
set_disable_counts.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_DISPLAY_BOOST_COUNT, set_disable_counts.isChecked());
editor.apply();
if( getActivity() != null)
getActivity().recreate();
}
});
boolean livenotif = sharedpreferences.getBoolean(Helper.SET_LIVE_NOTIFICATIONS, true);
final CheckBox set_live_notif = rootView.findViewById(R.id.set_live_notify);
set_live_notif.setChecked(livenotif);

View File

@ -267,6 +267,7 @@ public class Helper {
public static final String SET_DISPLAY_LOCAL = "set_display_local";
public static final String SET_DISPLAY_GLOBAL = "set_display_global";
public static final String SET_ALLOW_CROSS_ACTIONS = "set_allow_cross_actions";
public static final String SET_DISPLAY_BOOST_COUNT = "set_display_boost_count";
//End points
public static final String EP_AUTHORIZE = "/oauth/authorize";

View File

@ -127,6 +127,14 @@
android:text="@string/set_disable_gif"
android:layout_height="wrap_content" />
<!-- BOOST/FAVOURITE COUNT -->
<CheckBox
android:id="@+id/set_disable_counts"
android:layout_width="wrap_content"
android:text="@string/show_boost_count"
android:layout_height="wrap_content" />
<!-- TABS Layout -->
<LinearLayout
android:id="@+id/translation_layout_container"

View File

@ -128,6 +128,13 @@
android:layout_height="wrap_content" />
<!-- BOOST/FAVOURITE COUNT -->
<CheckBox
android:id="@+id/set_disable_counts"
android:layout_width="wrap_content"
android:text="@string/show_boost_count"
android:layout_height="wrap_content" />
<!-- Translation engine -->
<LinearLayout
android:layout_marginTop="10dp"

View File

@ -466,4 +466,6 @@
<!-- Migration -->
<string name="account_moved_to">%1$s has moved to %2$s</string>
<string name="show_boost_count">Show boosts/favourites count</string>
</resources>