Example usage for android.view.animation AccelerateInterpolator AccelerateInterpolator

List of usage examples for android.view.animation AccelerateInterpolator AccelerateInterpolator

Introduction

In this page you can find the example usage for android.view.animation AccelerateInterpolator AccelerateInterpolator.

Prototype

public AccelerateInterpolator() 

Source Link

Usage

From source file:com.tanmay.blip.activities.ImageActivity.java

@Override
public void onBackPressed() {
    topBar.animate().translationY(-(topBar.getHeight() + getStatusBarHeight())).setDuration(500)
            .setInterpolator(new AccelerateInterpolator()).start();
    super.onBackPressed();
}

From source file:org.horaapps.leafpic.activities.PlayerActivity.java

@SuppressWarnings("ResourceAsColor")
private void initUI() {
    setSupportActionBar(toolbar);/*from   w  w  w  .ja  v a 2  s.  c om*/
    toolbar.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.transparent_black));
    toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    getSupportActionBar().setDisplayShowTitleEnabled(false);

    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            // | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
            | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
            | View.SYSTEM_UI_FLAG_IMMERSIVE);

    toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())
            .setDuration(0).start();
    mediController_anchor.setPadding(0, 0, 0, Measure.getNavBarHeight(PlayerActivity.this));

    mediaController
            .setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.transparent_black));

    setStatusBarColor();
    setNavBarColor();
    setRecentApp(getString(org.horaapps.leafpic.R.string.app_name));
}

From source file:android.support.designox.widget.TextInputLayout.java

public TextInputLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    // Can't call through to super(Context, AttributeSet, int) since it doesn't exist on API 10
    super(context, attrs);

    ThemeUtils.checkAppCompatTheme(context);

    setOrientation(VERTICAL);/*from w ww.  j  av a 2s. c  o  m*/
    setWillNotDraw(false);
    setAddStatesFromChildren(true);

    mCollapsingTextHelper.setTextSizeInterpolator(AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR);
    mCollapsingTextHelper.setPositionInterpolator(new AccelerateInterpolator());
    mCollapsingTextHelper.setCollapsedTextGravity(Gravity.TOP | GravityCompat.START);

    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TextInputLayout, defStyleAttr,
            R.style.Widget_Design_TextInputLayout);
    mHintEnabled = a.getBoolean(R.styleable.TextInputLayout_hintEnabled, true);
    setHint(a.getText(R.styleable.TextInputLayout_android_hint));
    mHintAnimationEnabled = a.getBoolean(R.styleable.TextInputLayout_hintAnimationEnabled, true);

    if (a.hasValue(R.styleable.TextInputLayout_android_textColorHint)) {
        mDefaultTextColor = mFocusedTextColor = a
                .getColorStateList(R.styleable.TextInputLayout_android_textColorHint);
    }

    final int hintAppearance = a.getResourceId(R.styleable.TextInputLayout_hintTextAppearance, -1);
    if (hintAppearance != -1) {
        setHintTextAppearance(a.getResourceId(R.styleable.TextInputLayout_hintTextAppearance, 0));
    }

    mErrorTextAppearance = a.getResourceId(R.styleable.TextInputLayout_errorTextAppearance, 0);
    final boolean errorEnabled = a.getBoolean(R.styleable.TextInputLayout_errorEnabled, false);

    final boolean counterEnabled = a.getBoolean(R.styleable.TextInputLayout_counterEnabled, false);
    setCounterMaxLength(a.getInt(R.styleable.TextInputLayout_counterMaxLength, INVALID_MAX_LENGTH));
    mCounterTextAppearance = a.getResourceId(R.styleable.TextInputLayout_counterTextAppearance, 0);
    mCounterOverflowTextAppearance = a.getResourceId(R.styleable.TextInputLayout_counterOverflowTextAppearance,
            0);
    a.recycle();

    setErrorEnabled(errorEnabled);
    setCounterEnabled(counterEnabled);

    if (ViewCompat.getImportantForAccessibility(this) == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
        // Make sure we're important for accessibility if we haven't been explicitly not
        ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
    }

    ViewCompat.setAccessibilityDelegate(this, new TextInputAccessibilityDelegate());
}

From source file:pl.mg6.android.maps.extensions.demo.AnimateMarkersActivity.java

private Interpolator randomInterpolator() {
    int val = random.nextInt(14);
    switch (val) {
    case 0:/*from ww  w .  j a va  2s .c  o m*/
        return new LinearInterpolator();
    case 1:
        return new AccelerateDecelerateInterpolator();
    case 2:
        return new AccelerateInterpolator();
    case 3:
        return new AccelerateInterpolator(6.0f);
    case 4:
        return new DecelerateInterpolator();
    case 5:
        return new DecelerateInterpolator(6.0f);
    case 6:
        return new BounceInterpolator();
    case 7:
        return new AnticipateOvershootInterpolator();
    case 8:
        return new AnticipateOvershootInterpolator(6.0f);
    case 9:
        return new AnticipateInterpolator();
    case 10:
        return new AnticipateInterpolator(6.0f);
    case 11:
        return new OvershootInterpolator();
    case 12:
        return new OvershootInterpolator(6.0f);
    case 13:
        return new CycleInterpolator(1.25f);
    }
    throw new RuntimeException();
}

From source file:com.jaspervanriet.huntingthatproduct.Activities.WebActivity.java

private void startIntroAnimation() {
    mWebView.setScaleY(0.1f);/*ww w.  ja va 2s  . c o m*/
    mWebView.setPivotY(mDrawingStartLocation);
    mWebView.animate().scaleY(1).setDuration(ANIM_LAYOUT_INTRO_DURATION)
            .setInterpolator(new AccelerateInterpolator()).start();
}

From source file:com.zhihu.android.app.mirror.app.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    setTaskDescription(new ActivityManager.TaskDescription(getString(R.string.app_name),
            BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher),
            ContextCompat.getColor(this, R.color.black)));
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    mRootLayout = (FrameLayout) findViewById(R.id.root);
    mLinearInterpolator = new LinearInterpolator();
    mAccelerateInterpolator = new AccelerateInterpolator();
    mCurrentFlag = FLAG_MIRROR_LIST;/*ww  w.  ja v a2s .  c o m*/

    setupFresco();
    setupMirrorListView();
    setupArtboardListView();
    setupArtboardPagerView();
    setupConnectStatusLayout();
    setupRxBus();

    Intent intent = new Intent(this, MirrorService.class);
    startService(intent);
}

From source file:com.horaapps.leafpic.PlayerActivity.java

private void initUI() {

    toolbar.setBackgroundColor(//from   ww w.  j a  v  a 2 s  .  c o m
            isApplyThemeOnImgAct() ? ColorPalette.getTransparentColor(getPrimaryColor(), getTransparency())
                    : ColorPalette.getTransparentColor(getDefaultThemeToolbarColor3th(), 175));

    setSupportActionBar(toolbar);
    toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    getSupportActionBar().setDisplayShowTitleEnabled(false);

    getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
                    | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
                    | View.SYSTEM_UI_FLAG_IMMERSIVE);

    getWindow().getDecorView()
            .setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
                @Override
                public void onSystemUiVisibilityChange(int visibility) {
                    if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0)
                        showControls();
                    else
                        hideControls();
                }
            });
    toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())
            .setDuration(0).start();
    mediController_anchor.setPadding(0, 0, 0, Measure.getNavBarHeight(PlayerActivity.this));

    setStatusBarColor();
    setNavBarColor();
    setRecentApp(getString(R.string.app_name));
}

From source file:org.fossasia.phimpme.leafpic.activities.PlayerActivity.java

@SuppressWarnings("ResourceAsColor")
private void initUI() {
    setSupportActionBar(toolbar);//from w  w w.  j  a v a  2s .  c  o m
    toolbar.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.transparent_black));
    toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    getSupportActionBar().setDisplayShowTitleEnabled(false);

    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            // | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
            | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
            | View.SYSTEM_UI_FLAG_IMMERSIVE);

    toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())
            .setDuration(0).start();
    mediController_anchor.setPadding(0, 0, 0, Measure.getNavBarHeight(PlayerActivity.this));

    mediaController
            .setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.transparent_black));

    setStatusBarColor();
    setNavBarColor();
    setRecentApp(getString(R.string.app_name));
}

From source file:com.cleanwiz.applock.ui.activity.LockMainActivity.java

private void initAnim() {

    long duration = 300;
    long durationS = 160;
    float alpha = 0.3f;
    AccelerateInterpolator accInterpolator = new AccelerateInterpolator();

    tab_left = new TranslateAnimation(tabW, 0, 0, 0);
    tab_right = new TranslateAnimation(0, tabW, 0, 0);
    tab_alpha_1 = new AlphaAnimation(1.0f, alpha);
    tab_alpha_2 = new AlphaAnimation(alpha, 1.0f);
    pop_in = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF, 0);
    pop_out = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF, 0);

    pop_in.setDuration(durationS);//  w ww .j  ava2 s. co  m
    pop_in.setInterpolator(accInterpolator);
    pop_in.setAnimationListener(new PopListener(popView, PopListener.TYPE_IN));

    pop_out.setDuration(durationS);
    pop_out.setInterpolator(accInterpolator);
    pop_out.setAnimationListener(new PopListener(popView, PopListener.TYPE_OUT));

    tab_left.setFillAfter(true);
    tab_left.setFillEnabled(true);
    tab_left.setDuration(duration);
    tab_left.setInterpolator(accInterpolator);

    tab_right.setFillAfter(true);
    tab_right.setFillEnabled(true);
    tab_right.setDuration(duration);
    tab_right.setInterpolator(accInterpolator);

    tab_alpha_1.setFillAfter(true);
    tab_alpha_1.setFillEnabled(true);
    tab_alpha_1.setDuration(duration);
    tab_alpha_1.setInterpolator(accInterpolator);

    tab_alpha_2.setFillAfter(true);
    tab_alpha_2.setFillEnabled(true);
    tab_alpha_2.setDuration(duration);
    tab_alpha_2.setInterpolator(accInterpolator);

    AlphaAnimation alphaInit = new AlphaAnimation(alpha, alpha);
    alphaInit.setFillAfter(true);
    alphaInit.setFillEnabled(true);
    tv_tab_box.startAnimation(alphaInit);
}

From source file:com.jungle.toolbaractivity.layout.HorizontalSwipeBackLayout.java

private void continueAnimation(float horzOffset, int width) {
    ValueAnimator animator = ValueAnimator.ofFloat(horzOffset, width);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.setDuration((long) (150 * Math.abs(width - horzOffset) / width));
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override/*from w  w  w .  ja  va  2s  . c  o  m*/
        public void onAnimationUpdate(ValueAnimator animation) {
            float value = (float) animation.getAnimatedValue();
            updateSlideOffset(value);
        }
    });

    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            if (mSlideListener != null) {
                mSlideListener.onSlideFinished();
            }
        }
    });

    animator.start();
}