public final boolean p()
 {
   if (!z.b()) {
     return false;
   }
   if (!ab) {
     return false;
   }
   ab = false;
   Object localObject = AnimationUtils.loadAnimation(getActivity(), 2131034115);
   if (localObject != null) {
     ((RelativeLayout)z.a()).startAnimation((Animation)localObject);
   }
   r.setVisibility(0);
   localObject = new AlphaAnimation(0.0F, 1.0F);
   ((AlphaAnimation)localObject).setDuration(350L);
   r.startAnimation((Animation)localObject);
   z.a(8);
   B = ((SnapchatTimePicker)x.a()).getValue();
   h.setText(Integer.toString(B));
   localObject = w.edit();
   ((SharedPreferences.Editor)localObject).putInt(SharedPreferenceKey.SNAP_PREFERRED_TIME.getKey(), B);
   ((SharedPreferences.Editor)localObject).apply();
   return true;
 }
  @OnClick(R.id.fab)
  public void clicked() {
    AnimationUtils.revealView(mFrame1, null, -1, null);
    AnimationUtils.revealView(mFrame2, null, -1, null);
    AnimationUtils.hideView(mFab, null, -1, null);

    mHandler.postDelayed(
        new Runnable() {
          @Override
          public void run() {
            AnimationUtils.hideView(mFrame1, null, -1, null);
            AnimationUtils.hideView(mFrame2, null, -1, null);
            AnimationUtils.revealView(mFab, null, -1, null);
          }
        },
        2000);
  }
  private void setDrawableToImageView(ImageView view, Drawable photo) {
    if (photo == null) {
      photo = view.getResources().getDrawable(R.drawable.picture_unknown);
    }

    final Drawable current = view.getDrawable();
    if (current == null) {
      view.setImageDrawable(photo);
      AnimationUtils.Fade.show(view);
    } else {
      AnimationUtils.startCrossFade(view, current, photo);
      view.setVisibility(View.VISIBLE);
    }
  }
 @Override
 public float getAnimatedFloatValue() {
   return AnimationUtils.lerp(mFloatValues[0], mFloatValues[1], getAnimatedFraction());
 }
 @Override
 public int getAnimatedIntValue() {
   return AnimationUtils.lerp(mIntValues[0], mIntValues[1], getAnimatedFraction());
 }
Example #6
0
  /**
   * (�� Javadoc,��д�ķ���) @Title: onFling @Description: �����л�ͼ
   *
   * @param e1
   * @param e2
   * @param velocityX
   * @param velocityY
   * @return
   * @see android.view.GestureDetector.OnGestureListener#onFling(android.view.MotionEvent,
   *     android.view.MotionEvent, float, float)
   */
  @Override
  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
    if (!touchEnable) return false;
    touchEnable = false;
    handler.postDelayed(runnable, 500);

    try {
      if (e1.getX() - e2.getX() > 120) {
        // ��һ�β�ִ�У��Ժ�ÿ�ζ�ִ��
        if (!once) {
          if (BitmapList[middleView].isRecycled() == false) // ���û�л���
          BitmapList[middleView].recycle();
          System.gc();

          // �ϴ������󻬶�
          if (LeftIsTrue) {
            if (currentNum == photoCount - 1)
              BitmapList[middleView] =
                  decodeBitmap(PhotoAlbumActivity.AlbumsFloderPath.get(AlbumName).get(0), 400);
            else
              BitmapList[middleView] =
                  decodeBitmap(
                      PhotoAlbumActivity.AlbumsFloderPath.get(AlbumName).get(currentNum + 1), 400);

          }
          // �ϴ����һ���
          else {
            if (currentNum == 0)
              BitmapList[middleView] =
                  decodeBitmap(
                      PhotoAlbumActivity.AlbumsFloderPath.get(AlbumName).get(photoCount - 1), 400);
            else
              BitmapList[middleView] =
                  decodeBitmap(
                      PhotoAlbumActivity.AlbumsFloderPath.get(AlbumName).get(currentNum - 1), 400);
          }
          ImageViewList.get(middleView).destroyDrawingCache();
          ImageViewList.get(middleView).setImageBitmap(BitmapList[middleView]);
        }

        // ���������¼��ǰ״̬
        if (firstView == 2) firstView = 0;
        else firstView++;

        if (middleView == 2) middleView = 0;
        else middleView++;

        if (lastView == 2) lastView = 0;
        else lastView++;

        if (currentNum == photoCount - 1) currentNum = 0;
        else currentNum++;

        once = false;
        LeftIsTrue = true;

        flipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_left_in));
        flipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.push_left_out));
        flipper.showNext();

      } else if (e1.getX() - e2.getX() < -120) {
        if (!once) {
          if (BitmapList[lastView].isRecycled() == false) // ���û�л���
          BitmapList[lastView].recycle();
          System.gc();

          if (LeftIsTrue) {
            if (currentNum == photoCount - 1)
              BitmapList[lastView] =
                  decodeBitmap(PhotoAlbumActivity.AlbumsFloderPath.get(AlbumName).get(0), 400);
            else
              BitmapList[lastView] =
                  decodeBitmap(
                      PhotoAlbumActivity.AlbumsFloderPath.get(AlbumName).get(currentNum + 1), 400);

          } else {
            if (currentNum == 0)
              BitmapList[lastView] =
                  decodeBitmap(
                      PhotoAlbumActivity.AlbumsFloderPath.get(AlbumName).get(photoCount - 1), 400);
            else
              BitmapList[lastView] =
                  decodeBitmap(
                      PhotoAlbumActivity.AlbumsFloderPath.get(AlbumName).get(currentNum - 1), 400);
          }

          ImageViewList.get(lastView).destroyDrawingCache();
          ImageViewList.get(lastView).setImageBitmap(BitmapList[lastView]);
        }

        if (firstView == 0) firstView = 2;
        else firstView--;

        if (middleView == 0) middleView = 2;
        else middleView--;

        if (lastView == 0) lastView = 2;
        else lastView--;

        if (currentNum == 0) currentNum = photoCount - 1;
        else currentNum--;

        LeftIsTrue = false;
        once = false;

        flipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_right_in));
        flipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.push_right_out));
        flipper.showPrevious();
      }

      titleTextView.setText(PhotoAlbumActivity.AlbumsFloderTitle.get(AlbumName).get(currentNum));
    } catch (Exception e) {
      e.printStackTrace();
    }

    return false;
  }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setHasOptionsMenu(true);
   animTranslate = AnimationUtils.loadAnimation(getContext(), R.anim.anim_translate_button);
 }
Example #8
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tweenlistener);

    mLinear = (LinearLayout) findViewById(R.id.linear);

    mBtn = (Button) findViewById(R.id.start);
    mBtn.setOnClickListener(
        new Button.OnClickListener() {
          public void onClick(View v) {
            // * 리스너로 연결하기
            mBtn.startAnimation(mAni1);
            // */
            /* 오프셋으로 연결하기
            mBtn.startAnimation(AnimationUtils.loadAnimation(
            		TweenListener.this, R.anim.offset));
            //*/
          }
        });

    mAni1 = AnimationUtils.loadAnimation(this, R.anim.rotate2);
    mAni2 = AnimationUtils.loadAnimation(this, R.anim.alpha2);
    mAni3 = AnimationUtils.loadAnimation(this, R.anim.scale2);

    mAni1.setAnimationListener(
        new AnimationListener() {
          public void onAnimationEnd(Animation animation) {
            mBtn.startAnimation(mAni2);
          }

          public void onAnimationRepeat(Animation animation) {
            ;
          }

          public void onAnimationStart(Animation animation) {
            ;
          }
        });

    mAni2.setAnimationListener(
        new AnimationListener() {
          public void onAnimationEnd(Animation animation) {
            mBtn.startAnimation(mAni3);
          }

          public void onAnimationRepeat(Animation animation) {
            ;
          }

          public void onAnimationStart(Animation animation) {
            ;
          }
        });

    mAni3.setAnimationListener(
        new AnimationListener() {
          public void onAnimationEnd(Animation animation) {
            Toast.makeText(TweenListener.this, "Animation End", 0).show();
          }

          public void onAnimationRepeat(Animation animation) {
            ;
          }

          public void onAnimationStart(Animation animation) {
            ;
          }
        });
  }