Beispiel #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);
  }
Beispiel #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_litter);

    // Create an instance of the Database
    LitterDBHandler.makeInstance(this);

    // Get an instance to the API
    mGlitterAPI = new LitterAPI();

    // The components
    mGlitterLogo = (ImageView) findViewById(R.id.glitterLogo);
    mUserImage = (ImageView) findViewById(R.id.userImage);

    mButtonBar = findViewById(R.id.buttonBar);

    mLitterButton = (ImageButton) findViewById(R.id.litterButton);
    mSearchButton = (ImageButton) findViewById(R.id.searchButton);
    mFollowersButton = (ImageButton) findViewById(R.id.followersButton);
    mSettingsButton = (ImageButton) findViewById(R.id.settingsButton);

    // Hide the bar

    mButtonBar.setAlpha(0);

    // Scale down these things for latter animated showing
    ViewUtils.setScale(mUserImage, 0);

    ViewUtils.setScale(mLitterButton, 0);
    ViewUtils.setScale(mSearchButton, 0);
    ViewUtils.setScale(mFollowersButton, 0);
    ViewUtils.setScale(mSettingsButton, 0);

    // Listeners
    setupButtonListeners();

    // Startup sequence
    animateLogoIn();
    showLoginFragment();
  }
Beispiel #3
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);
  }