This commit is contained in:
Grishka 2022-02-12 01:29:35 +03:00
parent 3e605253e9
commit ebba838606
4 changed files with 20 additions and 5 deletions

View File

@ -103,6 +103,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
public void setImage(int index, Drawable drawable){ public void setImage(int index, Drawable drawable){
if(index>0){ if(index>0){
item.emojiHelper.setImageDrawable(index-1, drawable); item.emojiHelper.setImageDrawable(index-1, drawable);
name.invalidate();
}else{ }else{
avatar.setImageDrawable(drawable); avatar.setImageDrawable(drawable);
} }

View File

@ -67,6 +67,7 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{
@Override @Override
public void setImage(int index, Drawable image){ public void setImage(int index, Drawable image){
item.emojiHelper.setImageDrawable(index, image); item.emojiHelper.setImageDrawable(index, image);
text.invalidate();
} }
@Override @Override

View File

@ -16,6 +16,7 @@ import android.view.TextureView;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.WindowInsets;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
@ -65,6 +66,12 @@ public class PhotoViewer implements ZoomPanView.Listener{
} }
return true; return true;
} }
@Override
public WindowInsets dispatchApplyWindowInsets(WindowInsets insets){
Log.w(TAG, "dispatchApplyWindowInsets() called with: insets = ["+insets+"]");
return insets.consumeSystemWindowInsets();
}
}; };
windowView.setBackground(background); windowView.setBackground(background);
background.setAlpha(0); background.setAlpha(0);
@ -78,7 +85,8 @@ public class PhotoViewer implements ZoomPanView.Listener{
wlp.type=WindowManager.LayoutParams.TYPE_APPLICATION; wlp.type=WindowManager.LayoutParams.TYPE_APPLICATION;
wlp.flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR wlp.flags=WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR
| WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; | 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); wm.addView(windowView, wlp);
windowView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){ 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 // 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(); WindowManager.LayoutParams wlp=(WindowManager.LayoutParams) windowView.getLayoutParams();
wlp.flags|=WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; 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); wm.updateViewLayout(windowView, wlp);
int index=pager.getCurrentItem(); int index=pager.getCurrentItem();

View File

@ -361,8 +361,7 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS
} }
private void onTransitionAnimationEnd(DynamicAnimation<?> animation, boolean canceled, float value, float velocity){ private void onTransitionAnimationEnd(DynamicAnimation<?> animation, boolean canceled, float value, float velocity){
runningTransitionAnimations.remove(animation); if(runningTransitionAnimations.remove(animation) && runningTransitionAnimations.isEmpty()){
if(runningTransitionAnimations.isEmpty()){
animatingTransition=false; animatingTransition=false;
wasAnimatingTransition=true; wasAnimatingTransition=true;
listener.onTransitionAnimationFinished(); listener.onTransitionAnimationFinished();
@ -389,8 +388,13 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS
@Override @Override
public boolean onTouchEvent(MotionEvent ev){ public boolean onTouchEvent(MotionEvent ev){
boolean isUp=ev.getAction()==MotionEvent.ACTION_UP || ev.getAction()==MotionEvent.ACTION_CANCEL; boolean isUp=ev.getAction()==MotionEvent.ACTION_UP || ev.getAction()==MotionEvent.ACTION_CANCEL;
if(animatingTransition || (wasAnimatingTransition && ev.getAction()!=MotionEvent.ACTION_DOWN)) if(animatingTransition && ev.getAction()==MotionEvent.ACTION_DOWN){
return true; ArrayList<SpringAnimation> anims=new ArrayList<>(runningTransitionAnimations);
for(SpringAnimation anim:anims){
anim.skipToEnd();
onTransitionAnimationEnd(anim, true, 0f, 0f);
}
}
scaleDetector.onTouchEvent(ev); scaleDetector.onTouchEvent(ev);
if(!swipingToDismiss && isUp){ if(!swipingToDismiss && isUp){
if(scrolling || wasScaling){ if(scrolling || wasScaling){