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


Java ViewSwitcher.showNext方法代碼示例

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


在下文中一共展示了ViewSwitcher.showNext方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: renameFlow

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
/**
 * Hides the Options Menu and uses a ViewSwitcher to quick turn the exisiting TextView with the
 * Flow's name into an EditText for the user to rename.
 *
 * @param cardPosition position of cardview in adapter
 * @param cardViewClicked the cardview view object clicked
 */
private void renameFlow(final int cardPosition, final View cardViewClicked) {
    menuState = AppConstants.MENU_ITEMS_HIDE;
    invalidateOptionsMenu();
    final ViewSwitcher switcher = (ViewSwitcher) cardViewClicked.findViewById(R.id.hub_rename_switcher);
    final EditText rename = (EditText) switcher.findViewById(R.id.hub_item_flow_rename);

    AppUtils.setNameInputFilters(rename);

    rename.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (rename.hasFocus()) {
                showEditPopupWindow(rename, cardViewClicked, switcher, cardPosition);
            }
        }
    });

    switcher.showNext();

    rename.requestFocus();
    /* Forces keyboard */


}
 
開發者ID:robertsimoes,項目名稱:Flow,代碼行數:32,代碼來源:TheHubActivity.java

示例3: renameFlow

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
/**
 * Hides the Options Menu and uses a ViewSwitcher to quick turn the exisiting TextView with the
 * Flow's name into an EditText for the user to rename.
 *
 * @param cardPosition position of cardview in adapter
 * @param cardViewClicked the cardview view object clicked
 */
private void renameFlow(final int cardPosition, final View cardViewClicked) {
    menuState = AppConstants.MENU_ITEMS_HIDE;
    invalidateOptionsMenu();
    final ViewSwitcher switcher = (ViewSwitcher) cardViewClicked.findViewById(R.id.hub_rename_switcher);
    final EditText rename = (EditText) switcher.findViewById(R.id.hub_item_flow_rename);

    AppUtils.setNameInputFilters(rename);

    rename.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @RequiresApi(api = Build.VERSION_CODES.KITKAT)
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (rename.hasFocus()) {
                showEditPopupWindow(rename, cardViewClicked, switcher, cardPosition);
            }
        }
    });

    switcher.showNext();

    rename.requestFocus();
    /* Forces keyboard */


}
 
開發者ID:tortuvshin,項目名稱:yield,代碼行數:33,代碼來源:TheHubActivity.java

示例4: editListName

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
@Override
public void editListName(View _View, ShoppingList _ShoppingList, ViewSwitcher _ViewSwitcher) {
    ImageView cancelView;
    ImageView submitView;
    EditText editText;
    cancelView = (ImageView) _View.findViewById(R.id.expandable_list_view_edit_cancel);
    submitView = (ImageView) _View.findViewById(R.id.expandable_list_view_edit_submit);

    editText = (EditText) _View.findViewById(R.id.expandable_list_view_list_edit_name);

    cancelView.setOnClickListener(new OnCancelClickListenerWithData(_ViewSwitcher));
    submitView.setOnClickListener(new OnSubmitClickListenerWithChildData(mContext, _ViewSwitcher,
            editText, _ShoppingList.mUUID));

    editText.setText(_ShoppingList.mName);
    _ViewSwitcher.showNext();
}
 
開發者ID:InstaList,項目名稱:instalist-android,代碼行數:18,代碼來源:ContextItemClickedHelper.java

示例5: setContent

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
public void setContent(Fragment content) {
    Fragment last = mCurrentContent;
    mCurrentContent = content;
    FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
    if (last != null)
        ft.replace(R.id.content, mCurrentContent);
    else
        ft.add(R.id.content, mCurrentContent);
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    if (mContainer instanceof ViewSwitcher) {
        ViewSwitcher switcher = (ViewSwitcher)mContainer;
        if (mContent != switcher.getCurrentView())
            switcher.showNext();
    }
    ft.commit();
}
 
開發者ID:W2Cypher,項目名稱:LiIonSaver,代碼行數:17,代碼來源:ListContentFragment.java

示例6: switchersShowNext

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
private void switchersShowNext() {
    ViewSwitcher switcherName = (ViewSwitcher) getView().findViewById(R.id.fragment_se_switcher_name);
    ViewSwitcher switcherTime = (ViewSwitcher) getView().findViewById(R.id.fragment_se_switcher_time);
    ViewSwitcher switcherNotes = (ViewSwitcher) getView().findViewById(R.id.fragment_se_switcher_notes);
    switcherName.showNext();
    switcherTime.showNext();
    switcherNotes.showNext();
}
 
開發者ID:robertsimoes,項目名稱:Flow,代碼行數:9,代碼來源:ShowElementFragment.java

示例7: showFirstStart

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
private void showFirstStart() {
    stopRefreshAnimation();
    LayoutInflater inflater = LayoutInflater.from(getActivity());
    ViewGroup parent = (ViewGroup) ((ViewGroup) getActivity().findViewById(R.id.scrollview)).getChildAt(0);
    if (parent.findViewById(R.id.tracks_msg) == null)
        inflater.inflate(R.layout.no_tracks, parent);

    TypedValue typedValue = new TypedValue();
    getActivity().getTheme().resolveAttribute(R.attr.firstLaunchCoverDrawable, typedValue, true);
    int firstLaunchBGid = typedValue.resourceId;
    @SuppressWarnings("deprecation")
    BitmapDrawable bd = ((BitmapDrawable) getResources().getDrawable(firstLaunchBGid));

    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());

    setCoverArt(bd != null ? bd.getBitmap() : null, null, true);
    ViewSwitcher viewSwitcher = getActivity().findViewById(R.id.switcher);
    if (viewSwitcher.getChildCount() > 1)
        viewSwitcher.removeViewAt(0);
    viewSwitcher.addView(new View(getActivity()));
    viewSwitcher.showNext();

    int themeNum = Integer.valueOf(sharedPref.getString("pref_theme", "0"));
    if (themeNum > 0 && themeNum != 7) {
        TypedValue darkColorValue = new TypedValue();
        getActivity().getTheme().resolveAttribute(R.attr.colorPrimaryDark, darkColorValue, true);
        ((FadeInNetworkImageView) getActivity().findViewById(R.id.cover))
                .setColorFilter(darkColorValue.data, PorterDuff.Mode.OVERLAY);
    }

    getActivity().findViewById(R.id.error_msg).setVisibility(View.INVISIBLE);
    ((TextView) getActivity().findViewById(R.id.artist)).setText("");
    ((TextView) getActivity().findViewById(R.id.song)).setText("");
    getActivity().findViewById(R.id.top_gradient).setVisibility(View.INVISIBLE);
    getActivity().findViewById(R.id.bottom_gradient).setVisibility(View.INVISIBLE);
    getActivity().findViewById(R.id.edit_tags_btn).setVisibility(View.INVISIBLE);
}
 
開發者ID:QuickLyric,項目名稱:QuickLyric,代碼行數:38,代碼來源:LyricsViewFragment.java

示例8: onCreate

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	setContentView(R.layout.request_grid);
	switcherLoad = (ViewSwitcher)findViewById(R.id.viewSwitcherLoadingMain);
	context = this;

	getActionBar().setDisplayHomeAsUpEnabled(true);

	if(savedInstanceState == null){

		//Loading Logo Animation
		ImageView logo = (ImageView)findViewById(R.id.imageViewLogo);
		ObjectAnimator logoAni = (ObjectAnimator)AnimatorInflater.loadAnimator(context, R.animator.request_flip);
		logoAni.setRepeatCount(Animation.INFINITE);
		logoAni.setRepeatMode(Animation.RESTART);
		logoAni.setTarget(logo);
		logoAni.setDuration(2000);
		logoAni.start();

		taskList.execute();
	}
	else 
	{
		populateView(list_activities_final);
		switcherLoad.showNext();
	}
}
 
開發者ID:numixproject,項目名稱:org.numixproject.iconsubmit,代碼行數:30,代碼來源:RequestActivity.java

示例9: onObjectUpdated

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
public void onObjectUpdated() {
    Log.i(TAG, "Object " + m_id + " updated");

    View rootView = getView();
    if(rootView != null) {
        ViewSwitcher sw = (ViewSwitcher) getView().findViewById(R.id.switcher);
        if(m_child != null) {
            if(sw.getCurrentView().getId() != R.id.objectDisplayFragment)
                sw.showNext();

            // Notify the child
            m_child.objectUpdated(m_object);
            return;
        }

        // Construct the child fragment
        ObjectFragment frag = null;
        if(m_object == null) {
            frag = new NullObjectFragment();
        } else if("person".equals(m_object.optString("objectType"))) {
            frag = new PersonObjectFragment();
        } else {
            frag = new StandardObjectFragment();
        }

        FragmentManager mgr = getChildFragmentManager();
        m_child = ObjectFragment.prepare(frag, m_id, m_intId);

        mgr.beginTransaction()
                .add(R.id.objectDisplayFragment, m_child)
                .commit();

        sw.showNext();
    } else {
        // Nothing to do - our UI hasn't yet been created
        // We will update when we have a child
    }
}
 
開發者ID:erincandescent,項目名稱:Impeller,代碼行數:39,代碼來源:ObjectContainerFragment.java

示例10: do_flip

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
public void do_flip (View view)
{
	ViewSwitcher vs_buttonrow = (ViewSwitcher) findViewById(R.id.vs_buttonrow);
	vs_buttonrow.showNext();
	ViewSwitcher vs_cardsides = (ViewSwitcher) findViewById(R.id.vs_cardsides);
	vs_cardsides.showNext();
}
 
開發者ID:jcuenod,項目名稱:brainrot,代碼行數:8,代碼來源:MainActivity.java

示例11: editUserName

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
public void editUserName(View v) {
    ViewSwitcher switcher = (ViewSwitcher) findViewById(R.id.username_switcher);
    switcher.showNext();

    editUserName(switcher.getDisplayedChild() == 1);
}
 
開發者ID:Gchorba,項目名稱:NickleAndDimed,代碼行數:7,代碼來源:EventDetails.java

示例12: onCreateView

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_add_note, container, false);

        notePreview = (TextView) rootView.findViewById(R.id.add_note_preview);
//		ViewGroup.LayoutParams maxParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
//		noteEdit = new EditText(getActivity());
//		notePreview = new EditText(getActivity());
//		noteEdit.setLayoutParams(maxParams);
//		notePreview.setLayoutParams(maxParams);
//		notePreview.setClickable(true);
//		notePreview.setOnClickListener(this);
//		noteEdit.setId(R.id.note_view_edit);
//		notePreview.setId(R.id.note_view_preview);
        noteEdit = (EditText) rootView.findViewById(R.id.add_note_edit);
        noteDate = (TextView) rootView.findViewById(R.id.add_note_date);

		fillFromNote(shownNote);

		switcher = (ViewSwitcher) rootView.findViewById(R.id.switcher);
//		switcher.addView(noteEdit);
//		switcher.addView(notePreview);

		if(viewType == TYPE_PREVIEW)
		{
//			switcher.showPrevious();
		}
		else
		{
			switcher.showNext();
		}

		activityCommunicator.onMessage(REQUEST_CHANGE_TYPE, viewType);

        notePreview.setText(shownNote.getContent());

        if(Utils.isDateToday(shownNote.getLastModified()))
        {
            noteDate.setText(
                    getString(R.string.today_capital)
            );
        }
        else if(Utils.isDateToday(shownNote.getLastModified()))
        {
            noteDate.setText(
                    getString(R.string.yesterday_capital)
            );
        }
        else
        {
            Date lastModifiedDate = new Date((long)shownNote.getLastModified()*1000);
            Calendar lastModifiedCalendar = Calendar.getInstance();
            lastModifiedCalendar.setTime(lastModifiedDate);

                SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, MMM d, yyyy HH:mm");
                noteDate.setText(
                        dateFormat.format(new Date(((long)shownNote.getLastModified()*1000))));
        }

        return rootView;
    }
 
開發者ID:oguzbilgener,項目名稱:tuo-android,代碼行數:63,代碼來源:ViewNoteFragment.java

示例13: updateList

import android.widget.ViewSwitcher; //導入方法依賴的package包/類
public void updateList() {
    progressContainer = findViewById(R.id.progress_bar_container);
    progressBar = (ProgressBar)findViewById(R.id.analyze_progress);
    progressContainer.setVisibility(View.GONE);

    loadText = (TextView) findViewById(R.id.load_text);

    TextView stopScan = (TextView) findViewById(R.id.stop_scan);
    Typeface font = Typeface.createFromAsset(getAssets(), "fontawesome-webfont.ttf");
    stopScan.setTypeface(font);
    stopScan.setClickable(true);
    stopScan.setOnClickListener(this);

    startScan = (Button) findViewById(R.id.start_scan);
    startScan.setOnClickListener(this);

    ViewSwitcher switcher = (ViewSwitcher)findViewById(R.id.switcher);
    ViewSwitcher switcher_list = (ViewSwitcher)findViewById(R.id.switcher_list);

    Context context = getApplicationContext();
    File path = context.getDatabasePath("contactsgraph");
    File modelFile = new File(path, "model.kryo.gz");

    if (path.exists() && modelFile.exists()) {
        this.adapter.update();
        while (switcher.getCurrentView().getId() != R.id.switcher_list) {
            switcher.showNext();
        }
        if (adapter.getCount() == 0) {
            while (switcher_list.getCurrentView().getId() != R.id.all_done) {
                switcher_list.showNext();
            }
        } else {
            while (switcher_list.getCurrentView().getId() != R.id.contact_merge_list) {
                switcher_list.showPrevious();
            }
        }
        switcher_list.postInvalidate();
    } else {
        if (switcher.getCurrentView().getId() == R.id.contact_merge_list) {
            switcher.showPrevious();
        }
        Intent intent = new Intent(getApplicationContext(), AnalyzerService.class);
        intent.putExtra("forceRunning", true);
        startService(intent);
    }
    switcher.postInvalidate();
}
 
開發者ID:rtreffer,項目名稱:ContactMerger,代碼行數:49,代碼來源:MergeActivity.java


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