diff --git a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java index a9e9265ee..2eb148a76 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java +++ b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java @@ -160,7 +160,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{ case FOLLOW -> builder.setSmallIcon(R.drawable.ic_fluent_person_add_24_filled); case MENTION -> builder.setSmallIcon(R.drawable.ic_fluent_mention_24_filled); case POLL -> builder.setSmallIcon(R.drawable.ic_fluent_poll_24_filled); - case STATUS -> R.drawable.ic_fluent_chat_24_filled; + case STATUS -> builder.setSmallIcon(R.drawable.ic_fluent_chat_24_filled); default -> builder.setSmallIcon(R.drawable.ic_ntf_logo); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java index 4bb9ea4c8..93e6d29eb 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java @@ -98,24 +98,26 @@ public class HomeTimelineFragment extends FabStatusListFragment { @Override protected void onHidden(){ super.onHidden(); -// if(!data.isEmpty()){ -// String topPostID=displayItems.get(list.getChildAdapterPosition(list.getChildAt(0))-getMainAdapterOffset()).parentID; -// if(!topPostID.equals(lastSavedMarkerID)){ -// lastSavedMarkerID=topPostID; -// new SaveMarkers(topPostID, null) -// .setCallback(new Callback<>(){ -// @Override -// public void onSuccess(SaveMarkers.Response result){ -// } -// -// @Override -// public void onError(ErrorResponse error){ -// lastSavedMarkerID=null; -// } -// }) -// .exec(accountID); -// } -// } + // workaround for mastodon#512. revert if fixed otherwise + int position = list.getChildAdapterPosition(list.getChildAt(0))-getMainAdapterOffset(); + if(!data.isEmpty() && position >= 0 && position < displayItems.size()){ + String topPostID=displayItems.get(position).parentID; + if(!topPostID.equals(lastSavedMarkerID)){ + lastSavedMarkerID=topPostID; + new SaveMarkers(topPostID, null) + .setCallback(new Callback<>(){ + @Override + public void onSuccess(SaveMarkers.Response result){ + } + + @Override + public void onError(ErrorResponse error){ + lastSavedMarkerID=null; + } + }) + .exec(accountID); + } + } } public void onStatusCreated(StatusCreatedEvent ev){ diff --git a/mastodon/src/main/res/drawable/ic_fluent_chat_24_filled.xml b/mastodon/src/main/res/drawable/ic_fluent_chat_24_filled.xml index 4757c7084..f9f5537c5 100644 --- a/mastodon/src/main/res/drawable/ic_fluent_chat_24_filled.xml +++ b/mastodon/src/main/res/drawable/ic_fluent_chat_24_filled.xml @@ -1,3 +1,3 @@ - +