本文整理汇总了Java中android.widget.ViewAnimator.showNext方法的典型用法代码示例。如果您正苦于以下问题:Java ViewAnimator.showNext方法的具体用法?Java ViewAnimator.showNext怎么用?Java ViewAnimator.showNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ViewAnimator
的用法示例。
在下文中一共展示了ViewAnimator.showNext方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onItemLongClick
import android.widget.ViewAnimator; //导入方法依赖的package包/类
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
// tryFlipToPreviousView(viewAnimator);
if (view instanceof ViewAnimator) {
final ViewAnimator viewAnimator = (ViewAnimator)view;
viewAnimator.showNext();
return true;
}
return false;
}
示例4: 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();
}
示例5: 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);
}
示例6: 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();
}
示例7: 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);
}
示例8: 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();
}
示例9: 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();
}
示例10: 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;
}