More crash fixes

This commit is contained in:
Grishka 2022-04-12 03:54:51 +03:00
parent 9b2f50d726
commit 6e6f73f2c0
5 changed files with 17 additions and 2 deletions

View File

@ -10,7 +10,7 @@ android {
applicationId "org.joinmastodon.android" applicationId "org.joinmastodon.android"
minSdk 23 minSdk 23
targetSdk 31 targetSdk 31
versionCode 23 versionCode 24
versionName "0.1" versionName "0.1"
} }

View File

@ -44,4 +44,6 @@
*; *;
} }
-keep class org.joinmastodon.android.AppCenterWrapper { *; } -keep class org.joinmastodon.android.AppCenterWrapper { *; }
-keepattributes LineNumberTable

View File

@ -48,6 +48,8 @@ public class HomeTimelineFragment extends StatusListFragment{
.getHomeTimeline(offset>0 ? getMaxID() : null, count, refreshing, new SimpleCallback<>(this){ .getHomeTimeline(offset>0 ? getMaxID() : null, count, refreshing, new SimpleCallback<>(this){
@Override @Override
public void onSuccess(List<Status> result){ public void onSuccess(List<Status> result){
if(getActivity()==null)
return;
onDataLoaded(result, !result.isEmpty()); onDataLoaded(result, !result.isEmpty());
} }
}); });

View File

@ -103,6 +103,8 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
.getNotifications(offset>0 ? getMaxID() : null, count, onlyMentions, refreshing, new SimpleCallback<>(this){ .getNotifications(offset>0 ? getMaxID() : null, count, onlyMentions, refreshing, new SimpleCallback<>(this){
@Override @Override
public void onSuccess(List<Notification> result){ public void onSuccess(List<Notification> result){
if(getActivity()==null)
return;
if(refreshing) if(refreshing)
relationships.clear(); relationships.clear();
onDataLoaded(result.stream().filter(n->n.type!=null).collect(Collectors.toList()), !result.isEmpty()); onDataLoaded(result.stream().filter(n->n.type!=null).collect(Collectors.toList()), !result.isEmpty());

View File

@ -121,6 +121,15 @@ public class DiscoverAccountsFragment extends BaseRecyclerFragment<DiscoverAccou
}).exec(accountID); }).exec(accountID);
} }
@Override
public void onDestroyView(){
super.onDestroyView();
if(relationshipsRequest!=null){
relationshipsRequest.cancel();
relationshipsRequest=null;
}
}
@Override @Override
public void scrollToTop(){ public void scrollToTop(){
smoothScrollRecyclerViewToTop(list); smoothScrollRecyclerViewToTop(list);