A fork of the Mastodon Android client with Bluesky/ATProto support.

Crash fixes

fixes #1060

Grishka 0e2ed61f dbc4f4ed

+13 -6
+2 -2
mastodon/build.gradle
··· 13 13 applicationId "org.joinmastodon.android" 14 14 minSdk 23 15 15 targetSdk 35 16 - versionCode 157 17 - versionName "2.11.8" 16 + versionCode 158 17 + versionName "2.11.9" 18 18 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 19 19 } 20 20
+7 -1
mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java
··· 132 132 if(asyncRefreshID!=null){ 133 133 contentView.removeCallbacks(asyncRefreshPartialRunnable); 134 134 } 135 + if(highlightAlphaAnimator!=null){ 136 + highlightAlphaAnimator.cancel(); 137 + } 135 138 super.onDestroyView(); 136 139 } 137 140 ··· 226 229 diff.dispatchUpdatesTo(new ListUpdateCallback(){ 227 230 @Override 228 231 public void onInserted(int position, int count){ 229 - newReplyIDs.add(displayItems.get(position).parentID); 232 + if(position<displayItems.size()) // TODO figure out how this could possibly be a thing 233 + newReplyIDs.add(displayItems.get(position).parentID); 234 + else if(BuildConfig.DEBUG) 235 + throw new IllegalStateException("onInserted called with position="+position+" count="+count+", but list size is "+displayItems.size()); 230 236 } 231 237 232 238 @Override
+4 -3
mastodon/src/main/java/org/joinmastodon/android/ui/Snackbar.java
··· 22 22 import android.widget.FrameLayout; 23 23 import android.widget.LinearLayout; 24 24 import android.widget.TextView; 25 - import android.widget.Toast; 26 25 27 26 import org.joinmastodon.android.R; 28 27 import org.joinmastodon.android.ui.utils.UiUtils; ··· 182 181 183 182 private void disableTouchEvents(){ 184 183 if(containerView==null){ 185 - windowLayoutParams.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; 186 - context.getSystemService(WindowManager.class).updateViewLayout(windowView, windowLayoutParams); 184 + if(windowView.isAttachedToWindow()){ 185 + windowLayoutParams.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; 186 + context.getSystemService(WindowManager.class).updateViewLayout(windowView, windowLayoutParams); 187 + } 187 188 }else{ 188 189 ignoreTouchEvents=true; 189 190 }