forked from mirrors/Fedilab
Fix non updated counter with cache
This commit is contained in:
parent
2da0b1bba8
commit
3d2b1b6b7d
5 changed files with 13 additions and 6 deletions
|
@ -53,14 +53,12 @@ public class ContextActivity extends BaseActivity {
|
|||
public static boolean displayCW;
|
||||
public static Resources.Theme theme;
|
||||
Fragment currentFragment;
|
||||
private Status focusedStatus;
|
||||
private ActivityConversationBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeHelper.applyTheme(this);
|
||||
binding = ActivityConversationBinding.inflate(getLayoutInflater());
|
||||
app.fedilab.android.databinding.ActivityConversationBinding binding = ActivityConversationBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
@ -78,7 +76,7 @@ public class ContextActivity extends BaseActivity {
|
|||
Bundle b = getIntent().getExtras();
|
||||
final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ContextActivity.this);
|
||||
displayCW = sharedpreferences.getBoolean(getString(R.string.SET_EXPAND_CW), false);
|
||||
focusedStatus = null; // or other values
|
||||
Status focusedStatus = null; // or other values
|
||||
if (b != null)
|
||||
focusedStatus = (Status) b.getSerializable(Helper.ARG_STATUS);
|
||||
if (focusedStatus == null || currentAccount == null || currentAccount.mastodon_account == null) {
|
||||
|
|
|
@ -1474,11 +1474,11 @@ public class Helper {
|
|||
}
|
||||
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, channelId)
|
||||
.setSmallIcon(R.drawable.ic_notification).setTicker(message);
|
||||
if (notifType == NotifType.MENTION) {
|
||||
/* if (notifType == NotifType.MENTION) {
|
||||
if (message.length() > 500) {
|
||||
message = message.substring(0, 499) + "…";
|
||||
}
|
||||
}
|
||||
}*/
|
||||
notificationBuilder.setGroup(account.mastodon_account.acct + "@" + account.instance)
|
||||
.setContentIntent(pIntent)
|
||||
.setContentText(message);
|
||||
|
|
|
@ -69,8 +69,11 @@ public class FragmentMastodonContext extends Fragment {
|
|||
int position = getPosition(receivedStatus);
|
||||
if (position >= 0) {
|
||||
statuses.get(position).reblog = receivedStatus.reblog;
|
||||
statuses.get(position).reblogged = receivedStatus.reblogged;
|
||||
statuses.get(position).favourited = receivedStatus.favourited;
|
||||
statuses.get(position).bookmarked = receivedStatus.bookmarked;
|
||||
statuses.get(position).reblogs_count = receivedStatus.reblogs_count;
|
||||
statuses.get(position).favourites_count = receivedStatus.favourites_count;
|
||||
statusAdapter.notifyItemChanged(position);
|
||||
}
|
||||
} else if (delete_statuses_for_user != null && statusAdapter != null) {
|
||||
|
|
|
@ -76,8 +76,11 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
|
|||
if (position >= 0) {
|
||||
if (notificationList.get(position).status != null) {
|
||||
notificationList.get(position).status.reblog = receivedStatus.reblog;
|
||||
notificationList.get(position).status.reblogged = receivedStatus.reblogged;
|
||||
notificationList.get(position).status.favourited = receivedStatus.favourited;
|
||||
notificationList.get(position).status.bookmarked = receivedStatus.bookmarked;
|
||||
notificationList.get(position).status.favourites_count = receivedStatus.favourites_count;
|
||||
notificationList.get(position).status.reblogs_count = receivedStatus.reblogs_count;
|
||||
notificationAdapter.notifyItemChanged(position);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,8 +92,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
|||
int position = getPosition(receivedStatus);
|
||||
if (position >= 0) {
|
||||
statuses.get(position).reblog = receivedStatus.reblog;
|
||||
statuses.get(position).reblogged = receivedStatus.reblogged;
|
||||
statuses.get(position).favourited = receivedStatus.favourited;
|
||||
statuses.get(position).bookmarked = receivedStatus.bookmarked;
|
||||
statuses.get(position).reblogs_count = receivedStatus.reblogs_count;
|
||||
statuses.get(position).favourites_count = receivedStatus.favourites_count;
|
||||
statusAdapter.notifyItemChanged(position);
|
||||
}
|
||||
} else if (delete_statuses_for_user != null && statusAdapter != null) {
|
||||
|
|
Loading…
Reference in a new issue