本文整理匯總了Java中android.widget.ViewSwitcher.setInAnimation方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewSwitcher.setInAnimation方法的具體用法?Java ViewSwitcher.setInAnimation怎麽用?Java ViewSwitcher.setInAnimation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ViewSwitcher
的用法示例。
在下文中一共展示了ViewSwitcher.setInAnimation方法的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);
}