Fix issue with count + remove default compact mode
This commit is contained in:
parent
0ebbb7b648
commit
0d100f70f5
|
@ -471,7 +471,7 @@ public class Status implements Parcelable{
|
|||
return;
|
||||
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, true);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
|
||||
int mode;
|
||||
if( isCompactMode)
|
||||
mode = Html.FROM_HTML_MODE_COMPACT;
|
||||
|
@ -503,7 +503,7 @@ public class Status implements Parcelable{
|
|||
if( (status.getReblog() != null && status.getReblog().getContent() == null) || (status.getReblog() == null && status.getContent() == null))
|
||||
return;
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, true);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
|
||||
int mode;
|
||||
if( isCompactMode)
|
||||
mode = Html.FROM_HTML_MODE_COMPACT;
|
||||
|
@ -626,7 +626,7 @@ public class Status implements Parcelable{
|
|||
return;
|
||||
SpannableString spannableStringTranslated = null;
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, true);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
|
||||
int mode;
|
||||
if( isCompactMode)
|
||||
mode = Html.FROM_HTML_MODE_COMPACT;
|
||||
|
@ -735,7 +735,7 @@ public class Status implements Parcelable{
|
|||
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, true);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
|
||||
int mode;
|
||||
if( isCompactMode)
|
||||
mode = Html.FROM_HTML_MODE_COMPACT;
|
||||
|
|
|
@ -380,7 +380,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
|
||||
status = statuses.get(position);
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, true);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
|
||||
int HIDDEN_STATUS = 0;
|
||||
//If account related to status is null, the toot is hidden
|
||||
if( status.getAccount() == null )
|
||||
|
@ -469,7 +469,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if( type == RetrieveFeedsAsyncTask.Type.HOME ) {
|
||||
boolean showPreview = sharedpreferences.getBoolean(Helper.SET_PREVIEW_REPLIES, false);
|
||||
//Retrieves attached replies to a toot
|
||||
if (showPreview && status.getReblogs_count() == -1) {
|
||||
if (showPreview && status.getReplies_count() == -1) {
|
||||
new RetrieveRepliesAsyncTask(context, status, StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if( type == RetrieveFeedsAsyncTask.Type.HOME ) {
|
||||
boolean showPreview = sharedpreferences.getBoolean(Helper.SET_PREVIEW_REPLIES, false);
|
||||
//All way to deal with replies count
|
||||
if( showPreview && status.getReblogs_count() == -1){
|
||||
if( showPreview && status.getReplies_count() == -1){
|
||||
boolean showPreviewPP = sharedpreferences.getBoolean(Helper.SET_PREVIEW_REPLIES_PP, false);
|
||||
if( status.getReplies() == null){
|
||||
holder.loader_replies.setVisibility(View.VISIBLE);
|
||||
|
@ -526,13 +526,13 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.status_replies.setVisibility(View.VISIBLE);
|
||||
holder.loader_replies.setVisibility(View.GONE);
|
||||
}
|
||||
}else if(showPreview && status.getReblogs_count() >= 0) {
|
||||
if( status.getReblogs_count() > 0 ) {
|
||||
holder.status_reply.setText(String.valueOf(status.getReblogs_count()));
|
||||
}else if(showPreview && status.getReplies_count() >= 0) {
|
||||
if( status.getReplies_count() > 0 ) {
|
||||
holder.status_reply.setText(String.valueOf(status.getReplies_count()));
|
||||
holder.status_replies.setVisibility(View.VISIBLE);
|
||||
}
|
||||
boolean showPreviewPP = sharedpreferences.getBoolean(Helper.SET_PREVIEW_REPLIES_PP, false);
|
||||
if (showPreviewPP && status.getReblogs_count() > 0) {
|
||||
if (showPreviewPP && status.getReplies_count() > 0) {
|
||||
new RetrieveRepliesAsyncTask(context, status, StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
status.setReblogs_count(-1);
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.status_more.getLayoutParams().width = (int) Helper.convertDpToPixel((20*iconSizePercent/100), context);
|
||||
holder.status_privacy.getLayoutParams().height = (int) Helper.convertDpToPixel((20*iconSizePercent/100), context);
|
||||
holder.status_privacy.getLayoutParams().width = (int) Helper.convertDpToPixel((20*iconSizePercent/100), context);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, true);
|
||||
boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -277,7 +277,7 @@ public class SettingsFragment extends Fragment {
|
|||
}
|
||||
});
|
||||
|
||||
boolean compact_mode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, true);
|
||||
boolean compact_mode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
|
||||
final CheckBox set_compact_mode = rootView.findViewById(R.id.set_compact_mode);
|
||||
set_compact_mode.setChecked(compact_mode);
|
||||
|
||||
|
|
Loading…
Reference in New Issue