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"
minSdk 23
targetSdk 31
versionCode 23
versionCode 24
versionName "0.1"
}

View File

@ -45,3 +45,5 @@
}
-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){
@Override
public void onSuccess(List<Status> result){
if(getActivity()==null)
return;
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){
@Override
public void onSuccess(List<Notification> result){
if(getActivity()==null)
return;
if(refreshing)
relationships.clear();
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);
}
@Override
public void onDestroyView(){
super.onDestroyView();
if(relationshipsRequest!=null){
relationshipsRequest.cancel();
relationshipsRequest=null;
}
}
@Override
public void scrollToTop(){
smoothScrollRecyclerViewToTop(list);