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


Java SpinnerAdapter.getCount方法代码示例

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


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

示例1: getNavigationItemCount

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
@Override
public int getNavigationItemCount() {
    switch (mActionView.getNavigationMode()) {
        case NAVIGATION_MODE_TABS:
            return mTabs.size();
        case NAVIGATION_MODE_LIST:
            SpinnerAdapter adapter = mActionView.getDropdownAdapter();
            return adapter != null ? adapter.getCount() : 0;
        default:
            return 0;
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:13,代码来源:ActionBarImpl.java

示例2: setSpinnerPosition

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
private static void setSpinnerPosition(final Spinner spinner, final Object itemToSelect) {
    final SpinnerAdapter adapter = spinner.getAdapter();
    final int count = adapter.getCount();
    for (int i = 0; i < count; i++) {
        final Object item = spinner.getItemAtPosition(i);
        if (item.equals(itemToSelect)) {
            spinner.setSelection(i);
            return;
        }
    }
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:12,代码来源:CustomInputStylePreference.java

示例3: editRecur

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
private void editRecur(Recur recur) {
	editStartDate(recur.startDate);
	RecurInterval interval = recur.interval;
	SpinnerAdapter adapter = sInterval.getAdapter();
	int count = adapter.getCount();
	for (int i=0; i<count; i++) {
		SpinnerItem item = (SpinnerItem)adapter.getItem(i);
		if (interval == RecurInterval.valueOf(item.value)) {
			sInterval.setSelection(i);
			break;
		}
	}		
	View v = selectInterval(interval);
	switch (interval) {
	case EVERY_X_DAY:
		editEveryXDay(v, recur);
		break;
	case WEEKLY:
		editWeekly(v, recur);
		break;
	case SEMI_MONTHLY:
		editSemiMonthly(v, recur);
		break;
	}
	RecurPeriod period = recur.period;
	sPeriod.setSelection(period.ordinal());
	v = selectPeriod(period);
	switch (period) {
	case EXACTLY_TIMES:
		editExactlyTimes(v, recur.periodParam);
		break;
	case STOPS_ON_DATE:
		editStopsOnDate(v, recur.periodParam);
		break;
	}
}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:37,代码来源:RecurActivity.java

示例4: setSpinnerSelection

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
private void setSpinnerSelection(Spinner spinner, int position) {
    SpinnerAdapter adapter = spinner.getAdapter();
    if (adapter != null) {
        final int count = adapter.getCount();
        if (count > 0 && position < count) {
            spinner.setSelection(position, true);
        }
    }
}
 
开发者ID:nairbspace,项目名称:octoandroid,代码行数:10,代码来源:ConnectionFragment.java

示例5: setSpinnerItemSelectedByValue

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
/**
 * ����ֵ, ����spinnerĬ��ѡ��:
 * 
 * @param spinner
 * @param value
 */
public static void setSpinnerItemSelectedByValue(Spinner spinner,
		String value) {
	SpinnerAdapter apsAdapter = spinner.getAdapter(); // �õ�SpinnerAdapter����
	int k = apsAdapter.getCount();
	for (int i = 0; i < k; i++) {
		if (value.equals(apsAdapter.getItem(i).toString())) {
			spinner.setSelection(i, true);// Ĭ��ѡ����
			break;
		}
	}
}
 
开发者ID:nighthary,项目名称:phoneContact,代码行数:18,代码来源:Tools.java

示例6: selectItemOfSpinner

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
private void selectItemOfSpinner( Spinner spinner , String s )
{
    SpinnerAdapter adapter = spinner.getAdapter();
    int max = adapter.getCount();
    for( int i=0;i<max;i++ ){
        String item = (String)adapter.getItem(i);
        if ( s.equals(item) ){
            spinner.setSelection(i);
            break;
        }
    }
    return;
}
 
开发者ID:jiro-aqua,项目名称:JotaTextEditor,代码行数:14,代码来源:FileSelectorActivity.java

示例7: onMeasure

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    int selectedPosition = getSelectedItemPosition();
    SpinnerAdapter adapter = getAdapter();
    if (selectedPosition >= 0 && adapter != null && selectedPosition < adapter.getCount()) {
        View view = adapter.getView(selectedPosition, null, this);
        measureChild(view, widthMeasureSpec, heightMeasureSpec);
        float padding = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, ARROW_PADDING,
                getResources().getDisplayMetrics());
        setMeasuredDimension(Math.min((int) (view.getMeasuredWidth() + padding),
                MeasureSpec.getSize(widthMeasureSpec)), getMeasuredHeight());
    }
}
 
开发者ID:googlesamples,项目名称:attendee-checkin,代码行数:15,代码来源:FlexSpinner.java

示例8: setSpinnerSelection

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
void setSpinnerSelection(String notebookSummary){
    Spinner spinner = (Spinner) activity.findViewById(R.id.spinner_notebook);
    SpinnerAdapter adapter = spinner.getAdapter();
    for(int i=0;i<adapter.getCount();i++){
        String nbsummary = adapter.getItem(i).toString();
        if(nbsummary.equals(notebookSummary)){
            spinner.setSelection(i);
            break;
        }
    }
}
 
开发者ID:konradrenner,项目名称:kolabnotes-android,代码行数:12,代码来源:DetailFragment.java

示例9: setAdapter

import android.widget.SpinnerAdapter; //导入方法依赖的package包/类
public void setAdapter(SpinnerAdapter adapter) {
    if (adapter.getCount() > 0) {
        lastPosition = 0;
    }
    spinner.setAdapter(adapter);
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:7,代码来源:SpinnerHelper.java


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