示例#1
0
  /** Some simple animations run on user login */
  private void animateUserWelcome() {
    mUserImage.setImageResource(mCurrentUser.getUserImageResource());

    ViewUtils.setScale(mUserImage, 1);
    ScaleAnimation scale_in =
        new ScaleAnimation(
            0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    scale_in.setDuration(1000);
    scale_in.setFillAfter(true);
    scale_in.setInterpolator(new DecelerateInterpolator());
    mUserImage.startAnimation(scale_in);

    final long button_scale_time = 1000;
    final long button_scale_increment_time = 250;

    // Animate the buttons coming in
    ViewUtils.animateButtonShow(
        mLitterButton, button_scale_time + (button_scale_increment_time * 0));
    ViewUtils.animateButtonShow(
        mSearchButton, button_scale_time + (button_scale_increment_time * 1));
    ViewUtils.animateButtonShow(
        mFollowersButton, button_scale_time + (button_scale_increment_time * 2));
    ViewUtils.animateButtonShow(
        mSettingsButton, button_scale_time + (button_scale_increment_time * 3));

    // Make the background of the button bar visible
    mButtonBar.setAlpha(1);
  }
示例#2
0
  /** Shows the litterLayout view */
  public void showLitterLayout() {

    // Show the litterLayout view
    View litterView = mView.findViewById(R.id.litterLayout);
    litterView.setVisibility(View.VISIBLE);

    // Animate the buttons so the user has a clear indication that they are not just graphics
    long button_scale_time = 750;
    long button_scale_increment_time = 250;

    // Animate the buttons coming in
    ViewUtils.animateButtonShow(
        mTakePictureButton, button_scale_time + (button_scale_increment_time * 0));
    ViewUtils.animateButtonShow(
        mPostLitterPanel, button_scale_time + (button_scale_increment_time * 1));
    ViewUtils.animateButtonShow(
        mCancelLitterPanel, button_scale_time + (button_scale_increment_time * 2));

    // Set keyboard focus to the message component
    mLitterMessage.requestFocus();
    InputMethodManager inputMethodManager =
        (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(mLitterMessage, InputMethodManager.SHOW_IMPLICIT);
  }