本文整理了Java中android.widget.ViewFlipper.setOutAnimation()
方法的一些代码示例,展示了ViewFlipper.setOutAnimation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViewFlipper.setOutAnimation()
方法的具体详情如下:
包路径:android.widget.ViewFlipper
类名称:ViewFlipper
方法名:setOutAnimation
暂无
代码示例来源:origin: aporter/coursera-android
private void switchLayoutStateTo(int switchTo) {
mCurrentLayoutState = switchTo;
mFlipper.setInAnimation(inFromRightAnimation());
mFlipper.setOutAnimation(outToLeftAnimation());
mCount++;
if (switchTo == 0) {
mTextView1.setText(String.valueOf(mCount));
} else {
mTextView2.setText(String.valueOf(mCount));
}
mFlipper.showPrevious();
}
代码示例来源:origin: stackoverflow.com
handler.removeCallbacks(runnable);
imageFrame.setInAnimation(inFromRightAnimation());
imageFrame.setOutAnimation(outToLeftAnimation());
imageFrame.showNext();
} else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE
handler.removeCallbacks(runnable);
imageFrame.setInAnimation(inFromLeftAnimation());
imageFrame.setOutAnimation(outToRightAnimation());
imageFrame.showPrevious();
代码示例来源:origin: stackoverflow.com
vf.setOutAnimation(outToRightAnimation());
vf.showNext();
vf.setOutAnimation(outToLeftAnimation());
vf.showPrevious();
代码示例来源:origin: stackoverflow.com
viewFlipper.setOutAnimation(this, R.anim.out_to_right);
viewFlipper.setOutAnimation(this, R.anim.out_to_left);
代码示例来源:origin: jjhesk/KickAssSlidingMenu
@Override
public void onClick(View v) {
PushLeftPushRightAnimation me = PushLeftPushRightAnimation.this;
Context context = me;
int curView = mFlipper.getCurrentView().getId();
if (R.id.view1 == curView) {
in = AnimationUtils.loadAnimation(context, R.anim.push_right_in);
out = AnimationUtils.loadAnimation(context, R.anim.push_right_out);
} else {
in = AnimationUtils.loadAnimation(context, R.anim.push_left_in);
out = AnimationUtils.loadAnimation(context, R.anim.push_left_out);
}
in.setAnimationListener(me);
out.setAnimationListener(me);
mFlipper.setInAnimation(in);
mFlipper.setOutAnimation(out);
mFlipper.showNext();
}
}
代码示例来源:origin: stackoverflow.com
ViewFlipper vflipper;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
vflipper = (ViewFlipper) findViewById(R.id.viewFlipper);
vflipper.setInAnimation(this, android.R.anim.slide_in_left);
vflipper.setOutAnimation(this, android.R.anim.slide_out_right);
Button btn = (Button) findViewById(R.id.btn);
btn.setOnClickListener(this);
}
public void onClick(View v)
{
vflipper.showNext();
}
代码示例来源:origin: davideas/FlipView
@Override
public void setOutAnimation(Context context, @AnimRes int animationResId) {
if (!isInEditMode()) super.setOutAnimation(context, animationResId);
}
代码示例来源:origin: livroandroid/5ed
private void proximaView() {
ViewFlipper flip = (ViewFlipper) findViewById(R.id.flip);
// animação de saída da view atual
Animation out = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right);
out.setDuration(2000);
// animação de entrada da próxima view
Animation in = AnimationUtils.loadAnimation(this, R.anim.fade_in);
in.setDuration(2000);
// Configura a animação de entrada e saída
flip.setInAnimation(in);
flip.setOutAnimation(out);
// Troca para a próxima view
flip.showNext();
}
}
代码示例来源:origin: stackoverflow.com
ViewFlipper flipper = (ViewFlipper) findViewById(R.id.flipper);
flipper.setInAnimation(this, R.anim.in);
flipper.setOutAnimation(this, R.anim.out);
flipper.startFlipping();
代码示例来源:origin: nvllsvm/Audinaut
private void toggleFullscreenAlbumArt() {
if (playlistFlipper.getDisplayedChild() == 1) {
playlistFlipper.setInAnimation(AnimationUtils.loadAnimation(context, R.anim.push_down_in));
playlistFlipper.setOutAnimation(AnimationUtils.loadAnimation(context, R.anim.push_down_out));
playlistFlipper.setDisplayedChild(0);
} else {
scrollToCurrent();
playlistFlipper.setInAnimation(AnimationUtils.loadAnimation(context, R.anim.push_up_in));
playlistFlipper.setOutAnimation(AnimationUtils.loadAnimation(context, R.anim.push_up_out));
playlistFlipper.setDisplayedChild(1);
UpdateView.triggerUpdate();
}
}
代码示例来源:origin: stackoverflow.com
private ViewFlipper vf;
private float lastX;
case MotionEvent.ACTION_UP: {
float currentX = touchevent.getX();
if (lastX < currentX) {
vf.setInAnimation(this, R.anim.in_from_left);
vf.setOutAnimation(this, R.anim.out_to_right);
vf.showNext();
}
if (lastX > currentX) {
vf.setInAnimation(this, R.anim.in_from_right);
vf.setOutAnimation(this, R.anim.out_to_left);
vf.showPrevious();
}
break;
}
代码示例来源:origin: ChessLuo/TextBannerView
/**
* 设置进入动画和离开动画
*
* @param inAnimResId 进入动画的resID
* @param outAnimResID 离开动画的resID
*/
private void setInAndOutAnimation(@AnimRes int inAnimResId, @AnimRes int outAnimResID) {
Animation inAnim = AnimationUtils.loadAnimation(getContext(), inAnimResId);
inAnim.setDuration(animDuration);
mViewFlipper.setInAnimation(inAnim);
Animation outAnim = AnimationUtils.loadAnimation(getContext(), outAnimResID);
outAnim.setDuration(animDuration);
mViewFlipper.setOutAnimation(outAnim);
}
代码示例来源:origin: MinTate/Mleaf
private void showPrevious(){
if (mPosition>0){
mPosition--;
//记录当前新闻编号
HashMap<String, Object> hashMap = mNewsData.get(mPosition);
mNid = (Integer) hashMap.get("nid");
if (mCursor > mPosition){
mCursor = mPosition;
inflateView(0);
System.out.println(mNewsBodyFlipper.getChildCount());
mNewsBodyFlipper.showNext();// 显示下一页
}
mNewsBodyFlipper.setInAnimation(this, R.anim.push_right_in);// 定义下一页进来时的动画
mNewsBodyFlipper.setOutAnimation(this, R.anim.push_right_out);// 定义当前页出去的动画
mNewsBodyFlipper.showPrevious();// 显示上一页
}
else{
Toast.makeText(this, R.string.no_pre_news, Toast.LENGTH_SHORT).show();
}
System.out.println(mCursor +";"+mPosition);
}
代码示例来源:origin: davideas/FlipView
/**
* Shows a specific View immediately, no animation will be performed.
* <p>Command is always performed even if the view is disabled.</p>
*
* @param whichChild the index of the child view to display (first View has {@code index=0}).
*/
public final void flipSilently(int whichChild) {
if (DEBUG) Log.d(TAG, "flipSilently whichChild=" + whichChild);
whichChild = checkIndex(whichChild);
Animation inAnimation = super.getInAnimation();
Animation outAnimation = super.getOutAnimation();
super.setInAnimation(null);
super.setOutAnimation(null);
super.setDisplayedChild(whichChild);
super.setInAnimation(inAnimation);
super.setOutAnimation(outAnimation);
}
代码示例来源:origin: MinTate/Mleaf
private void showNext(){
if (mPosition<mNewsData.size()-1){
//设置下一屏动画
mNewsBodyFlipper.setInAnimation(this, R.anim.push_left_in);
mNewsBodyFlipper.setOutAnimation(this, R.anim.push_left_out);
mPosition++;
if (mPosition >= mNewsBodyFlipper.getChildCount()){
inflateView(mNewsBodyFlipper.getChildCount());
}
// 显示下一屏
mNewsBodyFlipper.showNext();
}
else{
Toast.makeText(this, R.string.no_next_news, Toast.LENGTH_SHORT).show();
}
}
代码示例来源:origin: jruesga/rview
public void hideSecondaryHierarchyPage() {
mBinding.flipper.setInAnimation(getContext(), R.anim.slide_in_left);
mBinding.flipper.setOutAnimation(getContext(), R.anim.slide_out_right);
mBinding.flipper.showPrevious();
}
代码示例来源:origin: jruesga/rview
public void showSecondaryHierarchyPage(T o) {
mBinding.flipper.setInAnimation(getContext(), R.anim.slide_in_right);
mBinding.flipper.setOutAnimation(getContext(), R.anim.slide_out_left);
mBinding.flipper.showNext();
fetchSecondaryData(o);
}
}
代码示例来源:origin: stackoverflow.com
Animation fade_in, fade_out, rowanimation;
ViewFlipper viewFlipper;
ScrollView myView;
TextView date;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewFlipper = (ViewFlipper) this.findViewById(R.id.bckgrndViewFlipper1);
fade_in = AnimationUtils.loadAnimation(this,
android.R.anim.fade_in);
fade_out = AnimationUtils.loadAnimation(this,
android.R.anim.fade_out);
viewFlipper.setInAnimation(fade_in);
viewFlipper.setOutAnimation(fade_out);
viewFlipper.setAutoStart(true);
viewFlipper.setFlipInterval(5000);
viewFlipper.startFlipping();
}
代码示例来源:origin: ymback/NGA-CLIENT-VER-OPEN-SOURCE
@Override
public void updateHeaderView() {
mHeaderView.removeAllViews();
UserManager um = UserManagerImpl.getInstance();
final List<User> userList = um.getUserList();
if (userList.isEmpty()) {
mHeaderView.addView(getUserView(null, 0));
} else {
for (int i = 0; i < userList.size(); i++) {
mHeaderView.addView(getUserView(userList, i));
}
mHeaderView.setDisplayedChild(um.getActiveUserIndex());
}
mHeaderView.setOnClickListener(v -> mPresenter.toggleUser(userList));
mHeaderView.setInAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.right_in));
mHeaderView.setOutAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.right_out));
}
代码示例来源:origin: arnowelzel/periodical
/**
* Handler for "previous month" button in main view
*/
@SuppressWarnings({"UnusedParameters", "SameParameterValue"})
public void goPrev(View v) {
// Update calendar
monthCurrent--;
if (monthCurrent < 1) {
monthCurrent = 12;
yearCurrent--;
}
if (viewCurrent == R.id.calendar) {
viewCurrent = R.id.calendar_2;
} else {
viewCurrent = R.id.calendar;
}
calendarUpdate();
// Show slide animation from left to right
ViewFlipper flipper = findViewById(R.id.mainwidget);
flipper.setInAnimation(AnimationHelper.inFromLeftAnimation());
flipper.setOutAnimation(AnimationHelper.outToRightAnimation());
flipper.showNext();
}
内容来源于网络,如有侵权,请联系作者删除!