Release 3.20.2

This commit is contained in:
Thomas 2023-03-13 18:09:48 +01:00
parent 0383007451
commit 3746673f9d
5 changed files with 31 additions and 11 deletions

View File

@ -13,8 +13,8 @@ android {
defaultConfig { defaultConfig {
minSdk 21 minSdk 21
targetSdk 33 targetSdk 33
versionCode 484 versionCode 485
versionName "3.20.1" versionName "3.20.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
flavorDimensions "default" flavorDimensions "default"

View File

@ -1,4 +1,9 @@
[ [
{
"version": "3.20.2",
"code": "485",
"note": "Added:\n- Visual indicator when fetching missing messages\n- Open media description when it is missing from the warning dialog\n\nChanged:\n- Maths formula aligned to the left\n- Faster access to delete all notifications\n\nFixed:\n- Fix an issue with Nitter and some URLs\n- Fix refresh issue with notifications\n- Fix an issue when entering a Peertube instance\n- Fix jumps with Akkoma/Pleroma when media preview size is not set\n- Some crashes"
},
{ {
"version": "3.20.1", "version": "3.20.1",
"code": "484", "code": "484",

View File

@ -17,6 +17,7 @@ package app.fedilab.android.mastodon.ui.fragment.timeline;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -106,6 +107,9 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
route(null, false); route(null, false);
} }
} }
if (conversationList != null && conversationList.size() > 0) {
route(FragmentMastodonTimeline.DIRECTION.FETCH_NEW, true);
}
} }
/** /**
@ -209,11 +213,11 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
} else if (direction == FragmentMastodonTimeline.DIRECTION.TOP) { } else if (direction == FragmentMastodonTimeline.DIRECTION.TOP) {
timelinesVM.getConversations(conversationList, timelineParams) timelinesVM.getConversations(conversationList, timelineParams)
.observe(getViewLifecycleOwner(), conversationsTop -> dealWithPagination(conversationsTop, FragmentMastodonTimeline.DIRECTION.TOP, fetchingMissing, conversationToUpdate)); .observe(getViewLifecycleOwner(), conversationsTop -> dealWithPagination(conversationsTop, FragmentMastodonTimeline.DIRECTION.TOP, fetchingMissing, conversationToUpdate));
} else if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH) { } else if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH || direction == FragmentMastodonTimeline.DIRECTION.SCROLL_TOP || direction == FragmentMastodonTimeline.DIRECTION.FETCH_NEW) {
timelinesVM.getConversations(conversationList, timelineParams) timelinesVM.getConversations(conversationList, timelineParams)
.observe(getViewLifecycleOwner(), conversationsRefresh -> { .observe(getViewLifecycleOwner(), conversationsRefresh -> {
if (conversationAdapter != null) { if (conversationAdapter != null) {
dealWithPagination(conversationsRefresh, FragmentMastodonTimeline.DIRECTION.REFRESH, true, conversationToUpdate); dealWithPagination(conversationsRefresh, direction, true, conversationToUpdate);
} else { } else {
initializeConversationCommonView(conversationsRefresh); initializeConversationCommonView(conversationsRefresh);
} }
@ -416,7 +420,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
flagLoading = true; flagLoading = true;
} }
if (direction == FragmentMastodonTimeline.DIRECTION.SCROLL_TOP) { if (direction == FragmentMastodonTimeline.DIRECTION.SCROLL_TOP) {
binding.recyclerView.scrollToPosition(0); new Handler().postDelayed(() -> binding.recyclerView.scrollToPosition(0), 200);
} }
} }
@ -481,7 +485,11 @@ public class FragmentMastodonConversation extends Fragment implements Conversati
public void scrollToTop() { public void scrollToTop() {
binding.recyclerView.scrollToPosition(0); if (binding != null) {
binding.swipeContainer.setRefreshing(true);
flagLoading = false;
route(FragmentMastodonTimeline.DIRECTION.SCROLL_TOP, true);
}
} }
@Override @Override

View File

@ -20,6 +20,7 @@ import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -110,6 +111,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
private LinearLayoutManager mLayoutManager; private LinearLayoutManager mLayoutManager;
private NotificationTypeEnum notificationType; private NotificationTypeEnum notificationType;
private boolean aggregateNotification; private boolean aggregateNotification;
private final BroadcastReceiver receive_refresh = new BroadcastReceiver() { private final BroadcastReceiver receive_refresh = new BroadcastReceiver() {
@Override @Override
@ -475,11 +477,11 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
} else if (direction == FragmentMastodonTimeline.DIRECTION.TOP) { } else if (direction == FragmentMastodonTimeline.DIRECTION.TOP) {
notificationsVM.getNotifications(notificationList, timelineParams) notificationsVM.getNotifications(notificationList, timelineParams)
.observe(getViewLifecycleOwner(), notificationsTop -> dealWithPagination(notificationsTop, FragmentMastodonTimeline.DIRECTION.TOP, fetchingMissing, notificationToUpdate)); .observe(getViewLifecycleOwner(), notificationsTop -> dealWithPagination(notificationsTop, FragmentMastodonTimeline.DIRECTION.TOP, fetchingMissing, notificationToUpdate));
} else if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH) { } else if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH || direction == FragmentMastodonTimeline.DIRECTION.SCROLL_TOP || direction == FragmentMastodonTimeline.DIRECTION.FETCH_NEW) {
notificationsVM.getNotifications(notificationList, timelineParams) notificationsVM.getNotifications(notificationList, timelineParams)
.observe(getViewLifecycleOwner(), notificationsRefresh -> { .observe(getViewLifecycleOwner(), notificationsRefresh -> {
if (notificationAdapter != null) { if (notificationAdapter != null) {
dealWithPagination(notificationsRefresh, FragmentMastodonTimeline.DIRECTION.REFRESH, true, notificationToUpdate); dealWithPagination(notificationsRefresh, direction, true, notificationToUpdate);
} else { } else {
initializeNotificationView(notificationsRefresh); initializeNotificationView(notificationsRefresh);
} }
@ -532,7 +534,11 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
} }
public void scrollToTop() { public void scrollToTop() {
binding.recyclerView.scrollToPosition(0); if (binding != null) {
binding.swipeContainer.setRefreshing(true);
flagLoading = false;
route(FragmentMastodonTimeline.DIRECTION.SCROLL_TOP, true);
}
} }
@ -618,7 +624,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
flagLoading = true; flagLoading = true;
} }
if (direction == FragmentMastodonTimeline.DIRECTION.SCROLL_TOP) { if (direction == FragmentMastodonTimeline.DIRECTION.SCROLL_TOP) {
binding.recyclerView.scrollToPosition(0); new Handler().postDelayed(() -> binding.recyclerView.scrollToPosition(0), 200);
} }
} }

View File

@ -1,6 +1,6 @@
Added: Added:
- Visual indicator when fetching missing messages - Visual indicator when fetching missing messages
- Open media description when it is missing in the warning dialog - Open media description when it is missing from the warning dialog
Changed: Changed:
- Maths formula aligned to the left - Maths formula aligned to the left
@ -8,6 +8,7 @@ Changed:
Fixed: Fixed:
- Fix an issue with Nitter and some URLs - Fix an issue with Nitter and some URLs
- Fix refresh issue with notifications
- Fix an issue when entering a Peertube instance - Fix an issue when entering a Peertube instance
- Fix jumps with Akkoma/Pleroma when media preview size is not set - Fix jumps with Akkoma/Pleroma when media preview size is not set
- Some crashes - Some crashes