本文整理汇总了Java中android.widget.ViewAnimator.setOutAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java ViewAnimator.setOutAnimation方法的具体用法?Java ViewAnimator.setOutAnimation怎么用?Java ViewAnimator.setOutAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ViewAnimator
的用法示例。
在下文中一共展示了ViewAnimator.setOutAnimation方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: flipTransition
import android.widget.ViewAnimator; //导入方法依赖的package包/类
/**
* Flip to the next view of the {@code ViewAnimator}'s subviews. A call to this method will
* initiate a {@link FlipAnimation} to show the next View.
* If the currently visible view is the last view, flip direction will be reversed for this
* transition.
*
* @param viewAnimator the {@code ViewAnimator}
* @param dir the direction of flip
* @param duration the transition duration in milliseconds
*/
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir,
long duration) {
final View fromView = viewAnimator.getCurrentView();
final int currentIndex = viewAnimator.getDisplayedChild();
final int nextIndex = (currentIndex + 1) % viewAnimator.getChildCount();
final View toView = viewAnimator.getChildAt(nextIndex);
Animation[] animc = AnimationFactory.flipAnimation(fromView, toView,
(nextIndex < currentIndex ? dir.theOtherDirection() : dir), duration, null);
viewAnimator.setOutAnimation(animc[0]);
viewAnimator.setInAnimation(animc[1]);
viewAnimator.showNext();
}
示例2: flipTransition
import android.widget.ViewAnimator; //导入方法依赖的package包/类
/**
* Flip to the next view of the {@code ViewAnimator}'s subviews. A call
* to this method will initiate a {@link FlipAnimation} to show the next
* View. If the currently visible view is the last view, flip direction
* will be reversed for this transition.
*
* @param viewAnimator the {@code ViewAnimator}
* @param dir the direction of flip
* @param duration the transition duration in milliseconds
*/
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir, long duration) {
final View fromView = viewAnimator.getCurrentView();
final int currentIndex = viewAnimator.getDisplayedChild();
final int nextIndex = (currentIndex + 1)%viewAnimator.getChildCount();
final View toView = viewAnimator.getChildAt(nextIndex);
if(android.os.Build.VERSION.SDK_INT>=12) {
//New way of flipping.
flipTransition(fromView, toView);
}else{
//Traditional flip.
Animation[] animc = AnimationFactory.flipAnimation(fromView, toView,
(nextIndex < currentIndex?dir.theOtherDirection():dir), duration, null);
viewAnimator.setOutAnimation(animc[0]);
viewAnimator.setInAnimation(animc[1]);
viewAnimator.showNext();
}
}
示例3: onCreate
import android.widget.ViewAnimator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account);
mTxtWhether = (TextView) findViewById(R.id.account_txt_whether);
mTxtTitle = (TextView) findViewById(R.id.account_txt_title);
mViewAnimator = (ViewAnimator) findViewById(R.id.account_output);
mEditLoginEmail = (EditText) findViewById(R.id.account_edit_login_email);
mEditLoginPassword = (EditText) findViewById(R.id.account_edit_login_password);
mEditRegisterPasswordConfirm = (EditText) findViewById(R.id.account_edit_register_password_confirm);
mEditRegisterPassword = (EditText) findViewById(R.id.account_edit_register_password);
mEditRegisterEmail = (EditText) findViewById(R.id.account_edit_register_email);
mBtnSubmit = (Button) findViewById(R.id.account_btn_submit);
mBtnChange = (Button) findViewById(R.id.account_btn_change);
mLoading = (Loading) findViewById(R.id.loading);
mViewAnimator.setInAnimation(AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.anim_in_slide_right));
mViewAnimator.setOutAnimation(AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.anim_out_slide_left));
mBtnSubmit.setOnClickListener(this);
mBtnChange.setOnClickListener(this);
mRegisterPresenter = new AccountRegisterPresenterAccount(this);
mAccountLoginPresenter = mRegisterPresenter;
}
示例4: onCreate
import android.widget.ViewAnimator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
appContext = this.getApplicationContext();
loginButton = (Button) findViewById(R.id.loginButton);
registerButton = (Button) findViewById(R.id.registerButton);
usernameEt = (EditText) findViewById(R.id.usernameEt);
passwordEt = (EditText) findViewById(R.id.passwordEt);
regusernameEt = (EditText) findViewById(R.id.regusernameEt);
regpasswordEt = (EditText) findViewById(R.id.regpasswordEt);
passwordCheckEt = (EditText) findViewById(R.id.passwordCheckEt);
emailEt = (EditText) findViewById(R.id.emailEt);
loginProgressWheel = (LinearLayout) findViewById(R.id.mainloginprogresswheel);
registerProgressWheel = (LinearLayout) findViewById(R.id.mainregisterprogresswheel);
loginProgressWheel.setVisibility(View.GONE);
registerProgressWheel.setVisibility(View.GONE);
tologinnavigator = (LinearLayout) findViewById(R.id.tologintext);
toregisternavigator = (LinearLayout) findViewById(R.id.toregistertext);
viewAnimator = (ViewAnimator) findViewById(R.id.loginviewanimator);
credentialsanimator = (ViewAnimator) findViewById(R.id.credentialsanimator);
fade_in = AnimationUtils.loadAnimation(this, android.R.anim.fade_in);
fade_out = AnimationUtils.loadAnimation(this, android.R.anim.fade_out);
slide_left = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left);
slide_right = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right);
viewAnimator.setInAnimation(fade_in);
viewAnimator.setOutAnimation(fade_out);
credentialsanimator.setInAnimation(fade_in);
credentialsanimator.setOutAnimation(fade_out);
}
示例5: flipTransition
import android.widget.ViewAnimator; //导入方法依赖的package包/类
/**
* Flip to the next view of the {@code ViewAnimator}'s subviews. A call to this method will initiate a {@link FlipAnimation} to show the next View.
* If the currently visible view is the last view, flip direction will be reversed for this transition.
*
* @param viewAnimator the {@code ViewAnimator}
* @param dir the direction of flip
*/
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir) {
final View fromView = viewAnimator.getCurrentView();
final int currentIndex = viewAnimator.getDisplayedChild();
final int nextIndex = (currentIndex + 1)%viewAnimator.getChildCount();
final View toView = viewAnimator.getChildAt(nextIndex);
Animation[] animc = AnimationFactory.flipAnimation(fromView, toView, (nextIndex < currentIndex?dir.theOtherDirection():dir), 500, null);
viewAnimator.setOutAnimation(animc[0]);
viewAnimator.setInAnimation(animc[1]);
viewAnimator.showNext();
}
示例6: createView
import android.widget.ViewAnimator; //导入方法依赖的package包/类
/**
* Creates the base view of this object.
*/
public void createView() {
if (p == null)
return;
setTitle(p.getTitle());
View procedureView = wrapViewWithInterface(p.toView(this));
// Now that the view is active, go to the correct page.
if(p.getCurrentIndex() != startPage) {
p.jumpToPage(startPage);
updateNextPrev();
}
baseViews = new ViewAnimator(this);
baseViews.setBackgroundResource(android.R.drawable.alert_dark_frame);
baseViews.setInAnimation(AnimationUtils.loadAnimation(this,
R.anim.slide_from_right));
baseViews.setOutAnimation(AnimationUtils.loadAnimation(this,
R.anim.slide_to_left));
baseViews.addView(procedureView);
// This should add it to baseViews, so don't add it manually.
View procedureDonePage = getLayoutInflater().inflate(
R.layout.procedure_runner_done, baseViews);
((TextView)procedureDonePage.findViewById(R.id.procedure_done_text))
.setTextAppearance(this, android.R.style.TextAppearance_Large);
procedureDonePage.findViewById(R.id.procedure_done_back)
.setOnClickListener(this);
procedureDonePage.findViewById(R.id.procedure_done_upload)
.setOnClickListener(this);
if(onDonePage) {
baseViews.setInAnimation(null);
baseViews.setOutAnimation(null);
baseViews.showNext();
baseViews.setInAnimation(AnimationUtils.loadAnimation(this,
R.anim.slide_from_right));
baseViews.setOutAnimation(AnimationUtils.loadAnimation(this,
R.anim.slide_to_left));
}
setContentView(baseViews);
setProgressBarVisibility(true);
setProgress(0);
}
示例7: flipTransition
import android.widget.ViewAnimator; //导入方法依赖的package包/类
/**
* Flip to the next view of the {@code ViewAnimator}'s subviews. A call to this method will initiate a {@link FlipAnimation} to show the next View.
* If the currently visible view is the last view, flip direction will be reversed for this transition.
*
* @param viewAnimator the {@code ViewAnimator}
* @param dir the direction of flip
* @param duration the transition duration in milliseconds
*/
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir, long duration) {
final View fromView = viewAnimator.getCurrentView();
final int currentIndex = viewAnimator.getDisplayedChild();
final int nextIndex = (currentIndex + 1)%viewAnimator.getChildCount();
final View toView = viewAnimator.getChildAt(nextIndex);
Animation[] animc = AnimationFactory.flipAnimation(fromView, toView, (nextIndex < currentIndex?dir.theOtherDirection():dir), duration, null);
viewAnimator.setOutAnimation(animc[0]);
viewAnimator.setInAnimation(animc[1]);
viewAnimator.showNext();
}
示例8: createView
import android.widget.ViewAnimator; //导入方法依赖的package包/类
/** Creates the base view of this object. */
public void createView() {
Log.i(TAG, "createView()");
if (mProcedure == null)
return;
getActivity().setTitle(mProcedure.getTitle());
View procedureView = wrapViewWithInterface(mProcedure.toView(getActivity()));
// Now that the view is active, go to the correct page.
if (mProcedure.getCurrentIndex() != startPage) {
mProcedure.jumpToPage(startPage);
updateNextPrev();
}
baseViews = new ViewAnimator(getActivity());
baseViews.setBackgroundResource(android.R.drawable.alert_dark_frame);
baseViews.setInAnimation(AnimationUtils.loadAnimation(getActivity(),
R.anim.slide_from_right));
baseViews
.setOutAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.slide_to_left));
baseViews.addView(procedureView);
// This should add it to baseViews, so don't add it manually.
if(isShowCompleteConfirmation()) {
View procedureDonePage = getActivity().getLayoutInflater().inflate(
R.layout.procedure_runner_done, baseViews);
((TextView) procedureDonePage.findViewById(R.id.procedure_done_text)).setTextAppearance(
getActivity(), android.R.style.TextAppearance_Large);
procedureDonePage.findViewById(R.id.procedure_done_back).setOnClickListener(this);
procedureDonePage.findViewById(R.id.procedure_done_upload).setOnClickListener(this);
}
if (onDonePage) {
baseViews.setInAnimation(null);
baseViews.setOutAnimation(null);
baseViews.showNext();
baseViews.setInAnimation(AnimationUtils.loadAnimation(getActivity(),
R.anim.slide_from_right));
baseViews.setOutAnimation(AnimationUtils.loadAnimation(getActivity(),
R.anim.slide_to_left));
}
setContentView(baseViews);
getActivity().setProgressBarVisibility(true);
getActivity().setProgress(0);
}
示例9: flipTransition
import android.widget.ViewAnimator; //导入方法依赖的package包/类
/**
* Flip to the next view of the {@code ViewAnimator}'s subviews. A call to this method will initiate a {@link FlipAnimation} to show the next View.
* If the currently visible view is the last view, flip direction will be reversed for this transition.
*
* @param viewAnimator the {@code ViewAnimator}
* @param dir the direction of flip
*/
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir) {
final View fromView = viewAnimator.getCurrentView();
final int currentIndex = viewAnimator.getDisplayedChild();
final int nextIndex = (currentIndex + 1) % viewAnimator.getChildCount();
final View toView = viewAnimator.getChildAt(nextIndex);
Animation[] animc = AnimationFactory.flipAnimation(fromView, toView, (nextIndex < currentIndex ? dir.theOtherDirection() : dir), 500, null);
viewAnimator.setOutAnimation(animc[0]);
viewAnimator.setInAnimation(animc[1]);
viewAnimator.showNext();
}
示例10: fadeTransition
import android.widget.ViewAnimator; //导入方法依赖的package包/类
/**
* Fades out the current view to the next view of the {@code ViewAnimator}'s subviews with a fade in
* effect. If the currently visible view is the last view, fade will restore the front view.
*
* @param viewAnimator
* @param fadeOutDuration
* @param fadeInDuration
*/
public static void fadeTransition(final ViewAnimator viewAnimator, long fadeOutDuration, long fadeInDuration) {
final View fromView = viewAnimator.getCurrentView();
final int currentIndex = viewAnimator.getDisplayedChild();
final int nextIndex = (currentIndex + 1) % viewAnimator.getChildCount();
final View toView = viewAnimator.getChildAt(nextIndex);
Animation[] animc = fadeTransition(fromView, toView, fadeOutDuration, fadeInDuration);
viewAnimator.setOutAnimation(animc[0]);
viewAnimator.setInAnimation(animc[1]);
viewAnimator.showNext();
}
示例11: flipTransition
import android.widget.ViewAnimator; //导入方法依赖的package包/类
private static Animation[] flipTransition(final ViewAnimator viewAnimator, FlipDirection dir, long duration, Interpolator interpolator, @FloatRange(from = 0.0, to = 1.0) float scale) {
Animation[] animations = flipAnim(viewAnimator, dir, duration, interpolator, scale);
viewAnimator.setOutAnimation(animations[0]);
viewAnimator.setInAnimation(animations[1]);
viewAnimator.showNext();
return animations;
}