當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。