当前位置: 首页>>代码示例>>Java>>正文


Java ViewAnimator类代码示例

本文整理汇总了Java中android.widget.ViewAnimator的典型用法代码示例。如果您正苦于以下问题:Java ViewAnimator类的具体用法?Java ViewAnimator怎么用?Java ViewAnimator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ViewAnimator类属于android.widget包,在下文中一共展示了ViewAnimator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onOptionsItemSelected

import android.widget.ViewAnimator; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.menu_toggle_log:
            mLogShown = !mLogShown;
            ViewAnimator output = (ViewAnimator) findViewById(R.id.sample_output);
            if (mLogShown) {
                output.setDisplayedChild(1);
            } else {
                output.setDisplayedChild(0);
            }
            supportInvalidateOptionsMenu();
            return true;
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:MainActivity.java

示例2: onCreate

import android.widget.ViewAnimator; //导入依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.sample_gallery_activity);

  animator = (ViewAnimator) findViewById(R.id.animator);
  imageView = (ImageView) findViewById(R.id.image);

  findViewById(R.id.go).setOnClickListener(new View.OnClickListener() {
    @Override public void onClick(View view) {
      Intent gallery = new Intent(ACTION_PICK, EXTERNAL_CONTENT_URI);
      startActivityForResult(gallery, GALLERY_REQUEST);
    }
  });

  if (savedInstanceState != null) {
    image = savedInstanceState.getString(KEY_IMAGE);
    if (image != null) {
      loadImage();
    }
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:SampleGalleryActivity.java

示例3: newList

import android.widget.ViewAnimator; //导入依赖的package包/类
private View newList(
    final PickerQuery q, final ViewAnimator flip,
    AdapterView.OnItemClickListener click) {
  final View list = newList(q, click);
  list.setOnKeyListener(new View.OnKeyListener() {
      @Override
      public boolean onKey(View v, int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK &&
            event.getAction() == KeyEvent.ACTION_UP) {
          flip.setInAnimation(getContext(), R.anim.slide_in_left);
          flip.setOutAnimation(getContext(), R.anim.slide_out_right);
          flip.showPrevious();
          flip.removeView(list);
          flip.setInAnimation(getContext(), R.anim.slide_in_right);
          flip.setOutAnimation(getContext(), R.anim.slide_out_left);
          return true;
        }
        return false;
      }
    });
  return list;
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:23,代码来源:MediaPicker.java

示例4: onCreateView

import android.widget.ViewAnimator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment

    View v = inflater.inflate(R.layout.display_options_popup, container);
    final ViewAnimator viewAnimator = v.findViewById(R.id.settings_view_container);
    viewAnimator.setDisplayedChild(mCurrentView);
    Window window = getDialog().getWindow();
    if (window != null) {
        window.setGravity(Gravity.TOP | Gravity.END);
        // window.setDimAmount(0);
        window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        //getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
    return v;
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:19,代码来源:DisplayOptionsPopupFragment.java

示例5: setupViews

import android.widget.ViewAnimator; //导入依赖的package包/类
private void setupViews() {
    mContainer = (ViewGroup) findViewById(R.id.container_photo);
    mSwitcher = (ViewAnimator) findViewById(R.id.switcher_menu);
    mPhotoView = (ImageView) findViewById(R.id.image_photo);

    mPhotoTitle = (TextView) findViewById(R.id.caption_title);
    mPhotoDate = (TextView) findViewById(R.id.caption_date);

    findViewById(R.id.menu_back).setOnClickListener(this);
    findViewById(R.id.menu_set).setOnClickListener(this);

    mPhotoTitle.setText(mPhoto.getTitle());
    mPhotoDate.setText(mPhoto.getDate());

    mContainer.setVisibility(View.INVISIBLE);

    // Sets up a view tree observer. The photo will be scaled using the size
    // of one of our views so we must wait for the first layout pass to be
    // done to make sure we have the correct size.
    mContainer.getViewTreeObserver().addOnGlobalLayoutListener(this);
}
 
开发者ID:tgmarinho,项目名称:apps-for-android,代码行数:22,代码来源:ViewPhotoActivity.java

示例6: setupViews

import android.widget.ViewAnimator; //导入依赖的package包/类
private void setupViews() {
    mInflater = LayoutInflater.from(PhotostreamActivity.this);
    mNextAnimation = AnimationUtils.loadLayoutAnimation(this, R.anim.layout_slide_next);
    mBackAnimation = AnimationUtils.loadLayoutAnimation(this, R.anim.layout_slide_back);

    mSwitcher = (ViewAnimator) findViewById(R.id.switcher_menu);
    mMenuNext = findViewById(R.id.menu_next);
    mMenuBack = findViewById(R.id.menu_back);
    mMenuSeparator = findViewById(R.id.menu_separator);
    mGrid = (GridLayout) findViewById(R.id.grid_photos);

    mMenuNext.setOnClickListener(this);
    mMenuBack.setOnClickListener(this);
    mMenuBack.setVisibility(View.GONE);
    mMenuSeparator.setVisibility(View.GONE);
    mGrid.setClipToPadding(false);
}
 
开发者ID:tgmarinho,项目名称:apps-for-android,代码行数:18,代码来源:PhotostreamActivity.java

示例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();
}
 
开发者ID:whereuat,项目名称:whereuat-android,代码行数:28,代码来源:AnimationFactory.java

示例8: c

import android.widget.ViewAnimator; //导入依赖的package包/类
public final Dialog c(Bundle paramBundle)
{
  un localun = new un(this.ad);
  View localView = LayoutInflater.from(this.ad).inflate(efj.YN, null, false);
  this.ai = ((ViewAnimator)localView.findViewById(efj.YI));
  this.aj = ((RadioGroup)localView.findViewById(efj.YH));
  this.Z = new TextView(this.ad);
  int i = this.ai.getPaddingLeft();
  this.Z.setPadding(i, i, i, i);
  this.Z.setTextAppearance(this.ad, aaw.qG);
  TextView localTextView = this.Z;
  localun.a.f = localTextView;
  localun.a(localView);
  localun.a(fh.f, this);
  localun.b(fh.a, this);
  return localun.a();
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:18,代码来源:lit.java

示例9: makeButtonsView

import android.widget.ViewAnimator; //导入依赖的package包/类
private void makeButtonsView() {
	mButtonsView = getActivity().getLayoutInflater().inflate(R.layout.buttons,null);
	mFilenameView = (TextView)mButtonsView.findViewById(R.id.docNameText);
	mPageSlider = (SeekBar)mButtonsView.findViewById(R.id.pageSlider);
	mPageNumberView = (TextView)mButtonsView.findViewById(R.id.pageNumber);
	mInfoView = (TextView)mButtonsView.findViewById(R.id.info);
	mSearchButton = (ImageButton)mButtonsView.findViewById(R.id.searchButton);
	mReflowButton = (ImageButton)mButtonsView.findViewById(R.id.reflowButton);
	mOutlineButton = (ImageButton)mButtonsView.findViewById(R.id.outlineButton);
	mAnnotButton = (ImageButton)mButtonsView.findViewById(R.id.editAnnotButton);
	mAnnotTypeText = (TextView)mButtonsView.findViewById(R.id.annotType);
	mTopBarSwitcher = (ViewAnimator)mButtonsView.findViewById(R.id.switcher);
	mSearchBack = (ImageButton)mButtonsView.findViewById(R.id.searchBack);
	mSearchFwd = (ImageButton)mButtonsView.findViewById(R.id.searchForward);
	mSearchText = (EditText)mButtonsView.findViewById(R.id.searchText);
	mLinkButton = (ImageButton)mButtonsView.findViewById(R.id.linkButton);
	mMoreButton = (ImageButton)mButtonsView.findViewById(R.id.moreButton);
	mTopBarSwitcher.setVisibility(View.INVISIBLE);
	mPageNumberView.setVisibility(View.INVISIBLE);
	mInfoView.setVisibility(View.INVISIBLE);
	mPageSlider.setVisibility(View.INVISIBLE);
}
 
开发者ID:viavansi,项目名称:mupdf-android,代码行数:23,代码来源:MuPDFFragment.java

示例10: makeButtonsView

import android.widget.ViewAnimator; //导入依赖的package包/类
private void makeButtonsView() {
	mButtonsView = getLayoutInflater().inflate(R.layout.buttons,null);
	mFilenameView = (TextView)mButtonsView.findViewById(R.id.docNameText);
	mPageSlider = (SeekBar)mButtonsView.findViewById(R.id.pageSlider);
	mPageNumberView = (TextView)mButtonsView.findViewById(R.id.pageNumber);
	mInfoView = (TextView)mButtonsView.findViewById(R.id.info);
	mSearchButton = (ImageButton)mButtonsView.findViewById(R.id.searchButton);
	mReflowButton = (ImageButton)mButtonsView.findViewById(R.id.reflowButton);
	mOutlineButton = (ImageButton)mButtonsView.findViewById(R.id.outlineButton);
	mAnnotButton = (ImageButton)mButtonsView.findViewById(R.id.editAnnotButton);
	mAnnotTypeText = (TextView)mButtonsView.findViewById(R.id.annotType);
	mTopBarSwitcher = (ViewAnimator)mButtonsView.findViewById(R.id.switcher);
	mSearchBack = (ImageButton)mButtonsView.findViewById(R.id.searchBack);
	mSearchFwd = (ImageButton)mButtonsView.findViewById(R.id.searchForward);
	mSearchText = (EditText)mButtonsView.findViewById(R.id.searchText);
	mLinkButton = (ImageButton)mButtonsView.findViewById(R.id.linkButton);
	mMoreButton = (ImageButton)mButtonsView.findViewById(R.id.moreButton);
	mTopBarSwitcher.setVisibility(View.INVISIBLE);
	mPageNumberView.setVisibility(View.INVISIBLE);
	mInfoView.setVisibility(View.INVISIBLE);
	mPageSlider.setVisibility(View.INVISIBLE);
}
 
开发者ID:viavansi,项目名称:mupdf-android,代码行数:23,代码来源:MuPDFActivity.java

示例11: initFlipCard

import android.widget.ViewAnimator; //导入依赖的package包/类
private void initFlipCard() {
  viewAnimator = (ViewAnimator) this.findViewById(R.id.viewFlipper);
  cardFront = LayoutInflater.from(this).inflate(R.layout.card, null);
  cardBack = LayoutInflater.from(this).inflate(R.layout.card, null);
  viewAnimator.addView(cardFront);
  viewAnimator.addView(cardBack);
  currentCard = cardFront;

  viewAnimator.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
      flipCard();
      updateNavBar();
    }
  });
}
 
开发者ID:Vosie,项目名称:WikiCards,代码行数:17,代码来源:CardActivity.java

示例12: switchView

import android.widget.ViewAnimator; //导入依赖的package包/类
@UiThread
void switchView(View parentView, int showView) {
    if (parentView == null)
        return;
    FilesListAdapter.ViewHolder holder = (FilesListAdapter.ViewHolder) parentView.getTag();

    ViewAnimator viewAnimator = holder.animator;
    viewAnimator.setInAnimation(context, R.anim.slide_down);
    int viewIndex = 0;
    switch (showView) {
        case R.id.dataLayout:
            viewIndex = 0;
            break;
        case R.id.DecryptLayout:
            viewIndex = 1;
            break;
    }
    viewAnimator.setDisplayedChild(viewIndex);
    holder.page = viewIndex;
}
 
开发者ID:SecrecySupportTeam,项目名称:Secrecy_fDroid_DEPRECIATED,代码行数:21,代码来源:FilesListFragment.java

示例13: switchView

import android.widget.ViewAnimator; //导入依赖的package包/类
void switchView(final View frame, final int showView) {
    getActivity().runOnUiThread(new Runnable() {
        @Override
        public void run() {
            if (frame == null) {
                return;
            }
            FilesListAdapter.ViewHolder holder = (FilesListAdapter.ViewHolder) frame.getTag();
            ViewAnimator viewAnimator = holder.animator;
            int viewIndex = 0;
            switch (showView) {
                case R.id.dataLayout:
                    viewIndex = 0;
                    break;
                case R.id.DecryptLayout:
                    viewIndex = 1;
                    break;
            }
            viewAnimator.setDisplayedChild(viewIndex);
            viewAnimator.setInAnimation(null);
            holder.page = viewIndex;
        }
    });
}
 
开发者ID:SecrecySupportTeam,项目名称:secrecy,代码行数:25,代码来源:FilesListFragment.java

示例14: onCreate

import android.widget.ViewAnimator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	getWindow().requestFeature(Window.FEATURE_PROGRESS);
	getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);

	setContentView(
			getLayoutInflater().inflate(R.layout.main, null));

	this.viewAnimator = (ViewAnimator) findViewById(R.id.mainViewAnimatorLayout);

	this.myWebView = new MyWebView(this);
	this.myMenu = new MyMenu(this, myWebView, viewAnimator);

	viewAnimator.addView(myWebView);
	viewAnimator.addView(
			getLayoutInflater().inflate(R.layout.web_source, null));
	
	if(!startActivityFromWidget(getIntent())){
		startActivity();
	}
}
 
开发者ID:joakim-ribier,项目名称:NavBro-WebView,代码行数:24,代码来源:NavBroActivity.java

示例15: MyMenu

import android.widget.ViewAnimator; //导入依赖的package包/类
public MyMenu(NavBroActivity navAppActivity, MyWebView myWebView, ViewAnimator viewAnimator) {
	this.navAppActivity = navAppActivity;
	this.myWebView = myWebView;
	this.viewAnimator = viewAnimator;
	this.slidingMenu = new SlidingMenu(navAppActivity);
	slidingMenu.setMode(SlidingMenu.LEFT);
	slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
	slidingMenu.setShadowWidthRes(R.dimen.shadow_width);
	slidingMenu.setShadowDrawable(R.drawable.my_menu_shadow);
	slidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
	slidingMenu.setFadeDegree(0.35f);
	slidingMenu.attachToActivity(navAppActivity, SlidingMenu.SLIDING_CONTENT);
	slidingMenu.setMenu(R.layout.left_menu);
	
	this.view = slidingMenu.getMenu();
	
	setEventOnClickButton();
	setWebViewSettings();
}
 
开发者ID:joakim-ribier,项目名称:NavBro-WebView,代码行数:20,代码来源:MyMenu.java


注:本文中的android.widget.ViewAnimator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。