Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.     //=================================
  2.     @Override
  3.     public void onAttachedToWindow(){
  4.         super.onAttachedToWindow();
  5.         if(android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.LOLLIPOP)
  6.             setElevation(20f);
  7.         setOnTouchListener(this);
  8.         animate().alpha(0).setDuration(0).start();
  9.         startX = getX();
  10.         postDelayed(new Runnable(){public void run(){
  11.            
  12.             WindowManager mgr = (WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE);
  13.             DisplayMetrics dm = new DisplayMetrics();
  14.             mgr.getDefaultDisplay().getMetrics(dm);
  15.             dwidth = dm.widthPixels;
  16.            
  17.             View parent = (View)getParent();
  18.             ValueAnimator anim = ObjectAnimator.ofFloat(CategoriesSlideView.this, "translationX", 0, parent.getX()+parent.getWidth()-Offset);
  19.             anim.setDuration(0);
  20.             anim.start();
  21.         }}, 400);
  22.     }