diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java index 90397070..0bae85f1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java @@ -103,6 +103,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{ public void setImage(int index, Drawable drawable){ if(index>0){ item.emojiHelper.setImageDrawable(index-1, drawable); + name.invalidate(); }else{ avatar.setImageDrawable(drawable); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java index 79acc8c7..be467da1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java @@ -67,6 +67,7 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{ @Override public void setImage(int index, Drawable image){ item.emojiHelper.setImageDrawable(index, image); + text.invalidate(); } @Override diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java index 5823de03..073461de 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java @@ -16,6 +16,7 @@ import android.view.TextureView; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; +import android.view.WindowInsets; import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.ImageView; @@ -65,6 +66,12 @@ public class PhotoViewer implements ZoomPanView.Listener{ } return true; } + + @Override + public WindowInsets dispatchApplyWindowInsets(WindowInsets insets){ + Log.w(TAG, "dispatchApplyWindowInsets() called with: insets = ["+insets+"]"); + return insets.consumeSystemWindowInsets(); + } }; windowView.setBackground(background); background.setAlpha(0); @@ -78,7 +85,8 @@ public class PhotoViewer implements ZoomPanView.Listener{ wlp.type=WindowManager.LayoutParams.TYPE_APPLICATION; wlp.flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; - wlp.format=PixelFormat.RGBA_8888; + wlp.format=PixelFormat.TRANSLUCENT; + windowView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); wm.addView(windowView, wlp); windowView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){ @@ -124,6 +132,7 @@ public class PhotoViewer implements ZoomPanView.Listener{ // stop receiving input events to allow the user to interact with the underlying UI while the animation is still running WindowManager.LayoutParams wlp=(WindowManager.LayoutParams) windowView.getLayoutParams(); wlp.flags|=WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; + windowView.setSystemUiVisibility(windowView.getSystemUiVisibility() | (activity.getWindow().getDecorView().getSystemUiVisibility() & (View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR))); wm.updateViewLayout(windowView, wlp); int index=pager.getCurrentItem(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java index 26060972..130d14c6 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java @@ -361,8 +361,7 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS } private void onTransitionAnimationEnd(DynamicAnimation animation, boolean canceled, float value, float velocity){ - runningTransitionAnimations.remove(animation); - if(runningTransitionAnimations.isEmpty()){ + if(runningTransitionAnimations.remove(animation) && runningTransitionAnimations.isEmpty()){ animatingTransition=false; wasAnimatingTransition=true; listener.onTransitionAnimationFinished(); @@ -389,8 +388,13 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS @Override public boolean onTouchEvent(MotionEvent ev){ boolean isUp=ev.getAction()==MotionEvent.ACTION_UP || ev.getAction()==MotionEvent.ACTION_CANCEL; - if(animatingTransition || (wasAnimatingTransition && ev.getAction()!=MotionEvent.ACTION_DOWN)) - return true; + if(animatingTransition && ev.getAction()==MotionEvent.ACTION_DOWN){ + ArrayList anims=new ArrayList<>(runningTransitionAnimations); + for(SpringAnimation anim:anims){ + anim.skipToEnd(); + onTransitionAnimationEnd(anim, true, 0f, 0f); + } + } scaleDetector.onTouchEvent(ev); if(!swipingToDismiss && isUp){ if(scrolling || wasScaling){