當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewSwitcher.setDisplayedChild方法代碼示例

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


在下文中一共展示了ViewSwitcher.setDisplayedChild方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: listSelected

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
private void listSelected(ListDesc list, boolean animate)
{
    //Log.v(L.TAG, "SimplyDoActivity.listSelected() called on list " + list.getId());
    
    setTitle(list.getLabel());
    
    dataViewer.setSelectedList(list);
    itemListSorter.sort(dataViewer.getItemData());
    itemPropertiesAdapter.notifyDataSetChanged();
    
    ViewSwitcher viewSwitch = (ViewSwitcher)findViewById(R.id.ListsItemsSwitcher);
    
    if(animate)
    {
        viewSwitch.showNext();
    }
    else
    {
        viewSwitch.reset();
        viewSwitch.setAnimateFirstView(false);
        viewSwitch.setDisplayedChild(1);
    }
}
 
開發者ID:sdrausty,項目名稱:buildAPKsApps,代碼行數:24,代碼來源:SimplyDoActivity.java

示例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));
    }
}
 
開發者ID:gateship-one,項目名稱:malp,代碼行數:25,代碼來源:AbsImageListViewItem.java

示例3: 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();
}
 
開發者ID:fcannizzaro,項目名稱:material-stepper,代碼行數:41,代碼來源:TabStepper.java

示例4: 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);
    };
}
 
開發者ID:twotoasters,項目名稱:SectionCursorAdapter,代碼行數:14,代碼來源:ToastersAdapter.java

示例5: Console

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
public Console(Activity activity, Bundle inState, int testMode,
               ListView listView, ViewSwitcher switcher) {
    mActivity = activity;
    mTestMode = testMode;
    mListView = listView;

    // persistent data in shared prefs
    SharedPreferences ss = activity.getSharedPreferences("prefs", Context.MODE_PRIVATE);
    mEditor = ss.edit();
    mHandler = new Handler();

    mMsgAdapter = new MessageAdapter(activity.getLayoutInflater(), inState, this);
    listView.setAdapter(mMsgAdapter);

    mSwitcher = switcher;
    if (switcher != null) {
        if (activity.getResources().getConfiguration().orientation ==
                Configuration.ORIENTATION_LANDSCAPE) {
            // in landscape, switch to console messages and disable switching
            switcher.setDisplayedChild(VIEW_MESSAGES);
            mSwitcher = null;
        } else {
            if (mMsgAdapter.getCount() > 0) {
                switcher.setDisplayedChild(VIEW_MESSAGES);
            }
        }
    }
}
 
開發者ID:doc-rj,項目名稱:smartcard-reader,代碼行數:29,代碼來源:Console.java

示例6: 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);
}
 
開發者ID:RandoApp,項目名稱:Rando-android,代碼行數:8,代碼來源:RandoListAdapter.java

示例7: showCard

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
protected void showCard(int cardID)
{
	currentCard = db.queryForCard(cardID);
	if (currentCard == null)
	{
		Toast.makeText(getApplicationContext(), "No such card", Toast.LENGTH_LONG).show();
		ViewSwitcher vs = (ViewSwitcher) findViewById(R.id.vs_welcome);
		vs.setDisplayedChild(0);
		return;
	}
	do_actualDisplay();
}
 
開發者ID:jcuenod,項目名稱:brainrot,代碼行數:13,代碼來源:MainActivity.java

示例8: BaseSearchWidget

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
public BaseSearchWidget(Context context, final int spanCount, int orientation, boolean autoSearchEnabled, @ResultView.ResultViewSize int resultViewSize,
                        WidgetDisplayOptions options, SearchResultAdapter.ImageLoader imageLoader) {
    super(context);
    inflate(getContext(), R.layout.imoji_base_widget, this);
    this.context = context;
    this.options = options;

    this.searchHandler = new SearchHandler(autoSearchEnabled) {

        @Override
        public void onSearchCompleted(List<SearchResult> newResults, int dividerPosition, boolean isRecents) {
            repopulateAdapter(newResults, dividerPosition, isRecents);
        }

        @Override
        public void beforeSearchStarted() {
            switcher.setDisplayedChild(0);
        }

        @Override
        public void onHistoryChanged() {
            updateText();
        }
    };

    switcher = (ViewSwitcher) this.findViewById(R.id.widget_switcher);
    recyclerView = (RecyclerView) this.findViewById(R.id.widget_recycler);
    searchBarLayout = (SearchBarLayout) this.findViewById(R.id.widget_search);
    searchBarLayout.setImojiSearchListener(this);
    searchBarLayout.setActionButtonsVisibility(options.isIncludeRecentsAndCreate());

    resultAdapter = new SearchResultAdapter(context, imageLoader, resultViewSize, orientation, options);
    resultAdapter.setSearchTapListener(this);
    gridLayoutManager = new GridLayoutManager(context, spanCount, orientation, false);
    gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {
            switch (resultAdapter.getItemViewType(position)) {
                case SearchResultAdapter.DIVIDER_VIEW_TYPE:
                    return spanCount;
                default:
                    return 1;
            }
        }
    });
    recyclerView.setLayoutManager(gridLayoutManager);
    recyclerView.setHasFixedSize(true);
    recyclerView.setItemAnimator(null);
    recyclerView.setAdapter(resultAdapter);

    searchHandler.searchTrending(context);

    imojiCreatedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            searchHandler.searchRecents(context);
            searchBarLayout.showRecentsView();
            LocalBroadcastManager.getInstance(context).unregisterReceiver(this);
        }
    };
}
 
開發者ID:imojiengineering,項目名稱:imoji-android-sdk-ui,代碼行數:62,代碼來源:BaseSearchWidget.java


注:本文中的android.widget.ViewSwitcher.setDisplayedChild方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。