Fix issue #69 - App kept all notification position

This commit is contained in:
Thomas 2022-05-19 15:54:44 +02:00
parent 42df8dfcb6
commit 59df0d65a7
2 changed files with 6 additions and 3 deletions

View file

@ -252,8 +252,11 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.OPEN_NOTIFICATION) {
final Handler handler = new Handler();
handler.postDelayed(() -> {
binding.bottomNavView.getMenu().getItem(3).setChecked(true);
binding.viewPager.setCurrentItem(3);
int position = BottomMenu.getPosition(bottomMenu, R.id.nav_notifications);
if (position > 0) {
binding.bottomNavView.getMenu().getItem(position).setChecked(true);
binding.viewPager.setCurrentItem(position);
}
}, 1000);
intent.removeExtra(Helper.INTENT_ACTION);

View file

@ -393,7 +393,7 @@ public class FragmentMastodonTimeline extends Fragment {
if (max_id == null || (fetched_statuses.pagination.max_id != null && fetched_statuses.pagination.max_id.compareTo(max_id) < 0)) {
max_id = fetched_statuses.pagination.max_id;
}
if (min_id == null || (fetched_statuses.pagination.max_id != null && fetched_statuses.pagination.min_id.compareTo(min_id) > 0)) {
if (min_id == null || (fetched_statuses.pagination.min_id != null && fetched_statuses.pagination.min_id.compareTo(min_id) > 0)) {
min_id = fetched_statuses.pagination.min_id;
}
}