zhaozihanzzh吧 关注:13贴子:475
  • 11回复贴,共1

ME Material RecentDialog 部分回顾

只看楼主收藏回复

双刀双掷长这样。不过这和本帖好像关系不大。


IP属地:上海来自Android客户端1楼2018-08-13 11:15回复
    RecentDialog 调用 startActivity(Intent) 时要确保 Intent 有 Intent.FLAG_ACTIVITY_NEW_TASK。

       --来自『天生急性子』版 Cherry Mini Plus 好 · 快,不等待!


    IP属地:上海来自Android客户端2楼2018-08-13 11:17
    收起回复
      用 ViewPropertyAnimator 动画时,在同一个 View 设定的 AnimatorListener 不会随着动画的结束而停止监听,如果 View 在 Listener 执行后执行另一并未设定 Listener 的动画,那么仍“沿用”之前的 Listener。所以:
      ViewPropertyAnimator.animate(getChildAt(i)).setDuration(duration).setInterpolator(new DecelerateInterpolator()).setListener(new Animator.AnimatorListener() {
      @Override
      public void onAnimationStart(Animator animation) {}
      @Override
      public void onAnimationEnd(Animator animation) {
      ViewPropertyAnimator.animate(getChildAt(finalI)).setDuration(100).translationX(getPaddingLeft()).setListener(new Animator.AnimatorListener(){
      @Override
      public void onAnimationStart(Animator animation) {
      }
      @Override
      public void onAnimationEnd(Animator animation) {
      …………ViewPropertyAnimator.animate(getChildAt(finalI)).setListener(null);
      }
      @Override
      public void onAnimationCancel(Animator animation) {
      }
      @Override
      public void onAnimationRepeat(Animator animation) {
      }
      }).start();
      }
      @Override
      public void onAnimationCancel(Animator animation) {}
      @Override
      public void onAnimationRepeat(Animator animation) {}
      }).translationX(deltaX > 0 ? getWidth() : -getWidth()).start();
      如果不手动赋值 null,那么动画好像会一直执行。


      IP属地:上海来自Android客户端3楼2018-08-13 11:23
      回复
        NineOldAndroids backport 了 Android 较高版本的动画接口,但在 2.3 的机器上这些动画仍然是传统的补间动画而不是在高版本上的属性动画,也就是说,在高版本机器上用 NineOldAndroids 的 ViewHelper.translationX(xxx) 后该 View 的实际位置发生变化,但在 2.3 上仅仅移动了画布,View 实际上仍然在原位置,如果在视觉位置点击它,View 不会触发点击事件。听说可以在动画进行时手动改变 LayoutParams,但 ZieIony 采用了建立 Rect 数组 childTouchRect 的方法移动点击区域。


        IP属地:上海来自Android客户端4楼2018-08-13 11:31
        回复
          如果从源码编译 RecentDialog,确保 onCreate 中:
          Window window = getWindow();
          ……
          window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);// You must have this line in your smail code !


          IP属地:上海来自Android客户端5楼2018-08-13 11:33
          收起回复
            该楼层疑似违规已被系统折叠 查看此楼


            IP属地:上海来自Android客户端6楼2018-08-13 11:38
            回复(1)
              感谢:https://zhidao.baidu.com/question/179446986439624404.html?word=判断是否%20onFling&ms=1&rid=12156914645111297043
              判断 onScroll 后是否触发 onFling 可以用 VelocityTracker。


              IP属地:上海来自Android客户端7楼2018-08-13 13:13
              收起回复
                前排


                IP属地:上海来自iPhone客户端8楼2018-08-13 13:27
                回复