From 63957250c5589f08080b579cf3709bdf5470bde3 Mon Sep 17 00:00:00 2001 From: Grishka Date: Fri, 13 May 2022 17:51:28 +0300 Subject: [PATCH] Fix #141 + crash fixes --- .../android/api/session/AccountSessionManager.java | 4 ++-- .../android/fragments/StatusListFragment.java | 11 ++++++++--- .../android/ui/ComposeAutocompleteViewController.java | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSessionManager.java b/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSessionManager.java index f3a05f9f..49ea70a7 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSessionManager.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSessionManager.java @@ -85,7 +85,7 @@ public class AccountSessionManager{ domains.add(session.domain.toLowerCase()); sessions.put(session.getID(), session); } - }catch(IOException|JsonParseException x){ + }catch(Exception x){ Log.e(TAG, "Error loading accounts", x); } lastActiveAccountID=prefs.getString("lastActiveAccount", null); @@ -358,7 +358,7 @@ public class AccountSessionManager{ customEmojis.put(domain, groupCustomEmojis(emojis)); instances.put(domain, emojis.instance); instancesLastUpdated.put(domain, emojis.lastUpdated); - }catch(IOException|JsonParseException x){ + }catch(Exception x){ Log.w(TAG, "Error reading instance info file for "+domain, x); } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java index 98721088..9cbbf378 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java @@ -113,10 +113,15 @@ public abstract class StatusListFragment extends BaseStatusListFragment{ return; data.remove(status); preloadedData.remove(status); - HeaderStatusDisplayItem item=findItemOfType(ev.id, HeaderStatusDisplayItem.class); - if(item==null) + int index=-1; + for(int i=0;ie1.emoji.shortcode.equals(e2.emoji.shortcode)); + imgLoader.updateImages(); } } @@ -186,6 +187,7 @@ public class ComposeAutocompleteViewController{ List oldList=users; users=result.accounts.stream().map(WrappedAccount::new).collect(Collectors.toList()); UiUtils.updateList(oldList, users, list, usersAdapter, (a1, a2)->a1.account.id.equals(a2.account.id)); + imgLoader.updateImages(); if(listIsHidden){ listIsHidden=false; V.setVisibilityAnimated(list, View.VISIBLE); @@ -210,6 +212,7 @@ public class ComposeAutocompleteViewController{ List oldList=hashtags; hashtags=result.hashtags; UiUtils.updateList(oldList, hashtags, list, hashtagsAdapter, (t1, t2)->t1.name.equals(t2.name)); + imgLoader.updateImages(); if(listIsHidden){ listIsHidden=false; V.setVisibilityAnimated(list, View.VISIBLE);