本文整理汇总了Java中android.widget.ViewSwitcher.setOutAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java ViewSwitcher.setOutAnimation方法的具体用法?Java ViewSwitcher.setOutAnimation怎么用?Java ViewSwitcher.setOutAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ViewSwitcher
的用法示例。
在下文中一共展示了ViewSwitcher.setOutAnimation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PinView
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
public PinView(Context context, PinListener listener, String pin, int layoutId) {
this.context = context;
this.listener = listener;
this.confirmPin = pin == null;
this.pin1 = pin;
LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = layoutInflater.inflate(layoutId, null);
for (int id : buttons) {
v.findViewById(id).setOnClickListener(this);
}
result = (TextView)v.findViewById(R.id.result1);
switcher = (ViewSwitcher)v.findViewById(R.id.switcher);
switcher.setInAnimation(inFromRightAnimation());
switcher.setOutAnimation(outToLeftAnimation());
try {
digest = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
this.vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
}
示例2: AbsImageListViewItem
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
public AbsImageListViewItem(Context context, int layoutID, int imageviewID, int switcherID, ScrollSpeedAdapter adapter) {
super(context);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(layoutID, this, true);
mImageView = (ImageView) findViewById(imageviewID);
mSwitcher = (ViewSwitcher) findViewById(switcherID);
mHolder = new AsyncLoader.CoverViewHolder();
mHolder.coverLoadable = this;
mHolder.mAdapter = adapter;
mHolder.imageDimension = new Pair<>(0,0);
mCoverDone = false;
if ( null != mImageView && null != mSwitcher) {
mSwitcher.setOutAnimation(null);
mSwitcher.setInAnimation(null);
mImageView.setImageDrawable(null);
mSwitcher.setDisplayedChild(0);
mSwitcher.setOutAnimation(AnimationUtils.loadAnimation(getContext(), android.R.anim.fade_out));
mSwitcher.setInAnimation(AnimationUtils.loadAnimation(getContext(), android.R.anim.fade_in));
}
}
示例3: updateAnimation
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
private void updateAnimation() {
View view = getView();
if (view == null) {
return;
}
ViewSwitcher viewSwitcher = (ViewSwitcher) view;
if (viewSwitcher.getInAnimation() != mInAnimation || mInAnimation == null) {
if (mInAnimation == null) {
mInAnimation = AnimationFactory.pushDownIn();
}
if (viewSwitcher instanceof TextSwitcher) {
mInAnimation.setAnimationListener(mTextViewInAnimationListener);
}
mInAnimation.setDuration(mInDuration);
viewSwitcher.setInAnimation(mInAnimation);
}
if (viewSwitcher.getOutAnimation() != mOutAnimation || mOutAnimation == null) {
if (mOutAnimation == null) {
mOutAnimation = AnimationFactory.pushDownOut();
}
mOutAnimation.setDuration(mOutDuration);
viewSwitcher.setOutAnimation(mOutAnimation);
}
}
示例4: getView
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
public View getView(LayoutInflater inflater, Setting setting, View convertView, Context context) {
// reuse if view already created
//if (mView != null) return mView;
// re-create view every time to disable unwanted animation every time window is opened
mSliderRenderer = null;
mBaseRenderer = null;
mChildView = -1;
mInflater = inflater;
mContext = context;
mSetting = (RangeSetting) setting;
RangeSetting rangeSetting = (RangeSetting) setting;
LinearLayout view = /*mView =*/ (LinearLayout) inflater.inflate(R.layout.row_switchable_slider_view, null);
ViewSwitcher switcher = mSwitcher = (ViewSwitcher) view.findViewById(R.id.switcher);
switcher.setOutAnimation(AnimationUtils.loadAnimation(mContext, R.anim.slide_out_down));
switcher.setInAnimation(AnimationUtils.loadAnimation(mContext, R.anim.slide_in_up));
switcher.setAnimateFirstView(false);
ToggleButton toggle = mToggle = (ToggleButton) view.findViewById(R.id.toggle);
toggle.setOnClickListener(this);
// initialize currently active view
updateView(rangeSetting, toggle);
return view;
}
示例5: onCreate
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
applyTheme();
if (getSupportActionBar() != null)
getSupportActionBar().setElevation(0);
setContentView(R.layout.style_horizontal_tabs);
init();
mTabs = (HorizontalScrollView) findViewById(R.id.steps);
mStepTabs = (LinearLayout) mTabs.findViewById(R.id.stepTabs);
mSwitch = (ViewSwitcher) findViewById(R.id.stepSwitcher);
mError = (TextView) findViewById(R.id.stepError);
mPreviousButton = (TextView) findViewById(R.id.stepPrev);
mContinue = (Button) findViewById(R.id.continueButton);
mContinue.setTextColor(primaryColor);
mContinue.setOnClickListener(this);
mSwitch.setDisplayedChild(0);
mSwitch.setInAnimation(TabStepper.this, R.anim.in_from_bottom);
mSwitch.setOutAnimation(TabStepper.this, R.anim.out_to_bottom);
mLinearity = new LinearityChecker(mSteps.total());
if (!showPrevButton)
mPreviousButton.setVisibility(View.GONE);
mPreviousButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onPrevious();
}
});
onUpdate();
}
示例6: switchWithoutAnimation
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
private void switchWithoutAnimation(ViewSwitcher switcher) {
if (switcher.getDisplayedChild() != 0) {
Animation in = switcher.getInAnimation();
Animation out = switcher.getOutAnimation();
switcher.setInAnimation(null);
switcher.setOutAnimation(null);
switcher.setDisplayedChild(0);
switcher.setInAnimation(in);
switcher.setOutAnimation(out);
};
}
示例7: recycleViewSwitcher
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
private void recycleViewSwitcher(ViewSwitcher viewSwitcher) {
//disable animation for immediately and undetectable switching to zero child:
viewSwitcher.clearAnimation();
viewSwitcher.setInAnimation(null);
viewSwitcher.setOutAnimation(null);
viewSwitcher.setDisplayedChild(0);
}