當前位置: 首頁>>代碼示例>>Java>>正文


Java BounceInterpolator類代碼示例

本文整理匯總了Java中android.view.animation.BounceInterpolator的典型用法代碼示例。如果您正苦於以下問題:Java BounceInterpolator類的具體用法?Java BounceInterpolator怎麽用?Java BounceInterpolator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BounceInterpolator類屬於android.view.animation包,在下文中一共展示了BounceInterpolator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initViewsAndEvents

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
@Override
protected void initViewsAndEvents() {
    Presenter splashPresenter = new SplashPresenter(this, this);
    splashPresenter.initialized();


    ViewCompat.animate(fullscreenContent)
            .scaleX(1.0f)
            .scaleY(1.0f)
            .translationY(-100)
            .alpha(1f)
            .setInterpolator(new BounceInterpolator())
            .setStartDelay(DateUtils.SECOND_IN_MILLIS)
            .setDuration(DateUtils.SECOND_IN_MILLIS * 2)
            .start();
}
 
開發者ID:hljwang3874149,項目名稱:ElephantReader,代碼行數:17,代碼來源:SplashActivty.java

示例2: bindHelpButton

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
private void bindHelpButton() {
    titleHelpButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ScaleAnimation bounce = new ScaleAnimation(1.2f, 1f, 1.2f, 1, helpButtonSizePx / 2, helpButtonSizePx / 2);
            bounce.setDuration(600);
            bounce.setInterpolator(new BounceInterpolator());

            if (helpLayout.getVisibility() == View.GONE) {
                showHelpOverlay();
                titleHelpButton.setBackgroundResource(R.drawable.sr_close_icon);
                titleHelpButton.startAnimation(bounce);
            } else {
                hideHelpOverlay();
                titleHelpButton.setBackgroundResource(R.drawable.sr_info_icon);
                titleHelpButton.startAnimation(bounce);
            }
        }
    });
}
 
開發者ID:Ramotion,項目名稱:showroom-android,代碼行數:21,代碼來源:ShowroomActivity.java

示例3: apply

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
@Override
public SkinAnimator apply(@NonNull View view, @Nullable final Action action) {
    this.targetView = view;
    preAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
            PropertyValuesHolder.ofFloat("translationX",
                    view.getLeft(), view.getRight()))
            .setDuration(PRE_DURATION * 3);
    preAnimator.setInterpolator(new AccelerateInterpolator());
    afterAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
            PropertyValuesHolder.ofFloat("translationX",
                    view.getLeft() - view.getWidth(), view.getLeft()))
            .setDuration(AFTER_DURATION * 3);
    afterAnimator.setInterpolator(new BounceInterpolator());

    preAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            if (action != null) {
                action.action();
            }
            afterAnimator.start();
        }
    });
    return this;
}
 
開發者ID:wutongke,項目名稱:AndroidSkinAnimator,代碼行數:27,代碼來源:TranslationAnimator2.java

示例4: onFinishInflate

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
protected void onFinishInflate() {
    super.onFinishInflate();
    if (!isInEditMode()) {

        TranslateAnimation translateAnimation = new TranslateAnimation(1, 2.0f, 1, 0.0f, 0, 0.0f, 0, 0.0f);
        translateAnimation.setDuration(1500);
        translateAnimation.setStartOffset(2500);
        translateAnimation.setInterpolator(new BounceInterpolator());

        animate().setStartDelay(5500).alpha(0.0f).setDuration(400).withEndAction(new Runnable() {
            public void run() {
                ((ViewGroup) SplashScreenView.this.getParent()).removeView(SplashScreenView.this);
            }
        });
    }
}
 
開發者ID:bunnyblue,項目名稱:NoticeDog,代碼行數:17,代碼來源:SplashScreenView.java

示例5: startBackAnimator

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
/**
 * 啟動動畫 回彈效果
 *
 */
private void startBackAnimator() {
    PropertyValuesHolder xValuesHolder = PropertyValuesHolder.ofFloat("x", canvasRotateX, 0);
    PropertyValuesHolder yValuesHolder = PropertyValuesHolder.ofFloat("y", canvasRotateY, 0);
    touchAnimator = ValueAnimator.ofPropertyValuesHolder(xValuesHolder, yValuesHolder).setDuration(700);
    touchAnimator.setInterpolator(new BounceInterpolator());
    touchAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            canvasRotateY = (Float) animation.getAnimatedValue("y");
            canvasRotateX = (Float) animation.getAnimatedValue("x");
            invalidate();
        }
    });
    touchAnimator.start();
}
 
開發者ID:aohanyao,項目名稱:SafeView,代碼行數:20,代碼來源:SafeView.java

示例6: ToolTip

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
public ToolTip(){
    /* default values */
    mTitle = "";
    mDescription = "";
    mBackgroundColor = Color.parseColor("#3498db");
    mTextColor = Color.parseColor("#FFFFFF");

    mEnterAnimation = new AlphaAnimation(0f, 1f);
    mEnterAnimation.setDuration(1000);
    mEnterAnimation.setFillAfter(true);
    mEnterAnimation.setInterpolator(new BounceInterpolator());
    mShadow = true;

    // TODO: exit animation
    mGravity = Gravity.CENTER;
}
 
開發者ID:AmulaySoftGroup,項目名稱:TaBeTa,代碼行數:17,代碼來源:ToolTip.java

示例7: onViewClicked

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
@OnClick({R.id.start_window, R.id.jump_other})
public void onViewClicked(View view) {
    switch (view.getId()) {
        case R.id.start_window:
            if (FloatWindow.get() != null) {
                return;
            }
            FloatPlayerView floatPlayerView = new FloatPlayerView(getApplicationContext());
            FloatWindow
                    .with(getApplicationContext())
                    .setView(floatPlayerView)
                    .setWidth(Screen.width, 0.4f)
                    .setHeight(Screen.width, 0.4f)
                    .setX(Screen.width, 0.8f)
                    .setY(Screen.height, 0.3f)
                    .setMoveType(MoveType.slide)
                    .setFilter(false)
                    .setMoveStyle(500, new BounceInterpolator())
                    .build();
            FloatWindow.get().show();
            break;
        case R.id.jump_other:
            startActivity(new Intent(this, EmptyActivity.class));
            break;
    }
}
 
開發者ID:CarGuo,項目名稱:GSYVideoPlayer,代碼行數:27,代碼來源:WindowActivity.java

示例8: initInterpolations

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
private void initInterpolations() {
    ArrayList<Class> interpolatorList = new ArrayList<Class>() {{
        add(FastOutSlowInInterpolator.class);
        add(BounceInterpolator.class);
        add(LinearInterpolator.class);
        add(DecelerateInterpolator.class);
        add(CycleInterpolator.class);
        add(AnticipateInterpolator.class);
        add(AccelerateDecelerateInterpolator.class);
        add(AccelerateInterpolator.class);
        add(AnticipateOvershootInterpolator.class);
        add(FastOutLinearInInterpolator.class);
        add(LinearOutSlowInInterpolator.class);
        add(OvershootInterpolator.class);
    }};

    try {
        interpolatorSelector = (Interpolator) interpolatorList.get(animateSelector).newInstance();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:ceryle,項目名稱:SegmentedButton,代碼行數:23,代碼來源:SegmentedButtonGroup.java

示例9: setPosition

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
public void setPosition(Position position) {
    this.position = position;

    if (position == Position.BOTTOM) {
        if (getLayoutParams() instanceof FrameLayout.LayoutParams) {
            ((LayoutParams) getLayoutParams()).gravity = Gravity.BOTTOM;
        } else if (getLayoutParams() instanceof RelativeLayout.LayoutParams) {
            ((RelativeLayout.LayoutParams) getLayoutParams()).addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        }
        setAnimationInterpolator(new LinearInterpolator(), null);
    } else {
        if (getLayoutParams() instanceof FrameLayout.LayoutParams) {
            ((LayoutParams) getLayoutParams()).gravity = Gravity.TOP;
        } else if (getLayoutParams() instanceof RelativeLayout.LayoutParams) {
            ((RelativeLayout.LayoutParams) getLayoutParams()).addRule(RelativeLayout.ALIGN_PARENT_TOP);
        }
        setAnimationInterpolator(new BounceInterpolator(), null);
    }
}
 
開發者ID:SwiftyWang,項目名稱:ToastBar,代碼行數:20,代碼來源:Toast.java

示例10: dropPinEffect

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
private void dropPinEffect(Marker marker) {
    final Handler handler = new Handler();
    final long start = SystemClock.uptimeMillis();
    final long duration = 1500;
    final Interpolator interpolator = new BounceInterpolator();
    handler.post(new Runnable() {
        @Override
        public void run() {
            long elapsed = SystemClock.uptimeMillis() - start;
            float t = Math.max(1 - interpolator.getInterpolation((float) elapsed / duration), 0);
            marker.setAnchor(0.5f, 1.0f + 14 * t);
            if (t > 0.0) {
                handler.postDelayed(this, 15);
            } else {
                marker.showInfoWindow();
            }
        }
    });
}
 
開發者ID:RubitOrganization,項目名稱:Rubit,代碼行數:20,代碼來源:DetailsTaskFragment.java

示例11: setupView

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
private void setupView() {

		// 這個Interpolator你可以設置別的 我這裏選擇的是有彈跳效果的Interpolator
		Interpolator polator = new BounceInterpolator();
		mScroller = new Scroller(mContext, polator);

		// 獲取屏幕分辨率
		WindowManager wm = (WindowManager) (mContext
				.getSystemService(Context.WINDOW_SERVICE));
		DisplayMetrics dm = new DisplayMetrics();
		wm.getDefaultDisplay().getMetrics(dm);
		mScreenHeigh = dm.heightPixels;
		mScreenWidth = dm.widthPixels;

		// 這裏你一定要設置成透明背景,不然會影響你看到底層布局
		this.setBackgroundColor(Color.argb(0, 0, 0, 0));
		mImgView = new ImageView(mContext);
		mImgView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.MATCH_PARENT));
		mImgView.setScaleType(ImageView.ScaleType.FIT_XY);// 填充整個屏幕
		// mImgView.setImageResource(R.drawable.ic_launcher); // 默認背景
		mImgView.setBackgroundColor(Color.parseColor("#60000000"));
		addView(mImgView);
	}
 
開發者ID:Alex-Jerry,項目名稱:LLApp,代碼行數:25,代碼來源:PullDoorView.java

示例12: onCreate

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list);
    mContext = this;
    users = getUsers();
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
            swipeRefreshLayout.setRefreshing(false);
        }
    });
    mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
    mRecyclerView.addItemDecoration(new VerticalSpaceItemDecoration(3));
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    // interpolator setting
    mRecyclerView.setOpenInterpolator(new BounceInterpolator());
    mRecyclerView.setCloseInterpolator(new BounceInterpolator());
    mAdapter = new AppAdapter(this, users);
    mRecyclerView.setAdapter(mAdapter);
}
 
開發者ID:PhongHuynh93,項目名稱:SwipeMenuRecyclerView-master,代碼行數:24,代碼來源:SimpleRvActivity.java

示例13: onCreate

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list);
    mContext = this;
    users = getUsers();
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
            swipeRefreshLayout.setRefreshing(false);
        }
    });
    mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
    mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
    mRecyclerView.addItemDecoration(new StaggeredSpaceItemDecoration(15, 0, 15, 45));
    // interpolator setting
    mRecyclerView.setOpenInterpolator(new BounceInterpolator());
    mRecyclerView.setCloseInterpolator(new BounceInterpolator());
    mAdapter = new AppAdapter(this, users);
    mRecyclerView.setAdapter(mAdapter);
}
 
開發者ID:PhongHuynh93,項目名稱:SwipeMenuRecyclerView-master,代碼行數:24,代碼來源:StaggeredGridRvActivity.java

示例14: onCreate

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list);
    mContext = this;
    users = getUsers();
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
            swipeRefreshLayout.setRefreshing(false);
        }
    });
    mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    // interpolator setting
    mRecyclerView.setOpenInterpolator(new BounceInterpolator());
    mRecyclerView.setCloseInterpolator(new BounceInterpolator());
    mAdapter = new AppAdapter(this, users);
    mRecyclerView.setAdapter(mAdapter);
}
 
開發者ID:PhongHuynh93,項目名稱:SwipeMenuRecyclerView-master,代碼行數:23,代碼來源:DifferentRvActivity.java

示例15: onCreate

import android.view.animation.BounceInterpolator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list);
    mContext = this;
    users = getUsers();
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
            swipeRefreshLayout.setRefreshing(false);
        }
    });
    mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
    mRecyclerView.addItemDecoration(new GridSpaceItemDecoration(3, 3));
    mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
    mRecyclerView.setOpenInterpolator(new BounceInterpolator());
    mRecyclerView.setCloseInterpolator(new BounceInterpolator());
    mAdapter = new AppAdapter(this, users);
    mRecyclerView.setAdapter(mAdapter);
}
 
開發者ID:PhongHuynh93,項目名稱:SwipeMenuRecyclerView-master,代碼行數:23,代碼來源:GridRvActivity.java


注:本文中的android.view.animation.BounceInterpolator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。