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


Java WheelView.setCurrentItem方法代码示例

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


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

示例1: initWheel

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
private void initWheel(View dialog_exitView, Dict dCountry) {
	WheelView country = (WheelView) dialog_exitView
			.findViewById(R.id.country);
	WheelView province = (WheelView) dialog_exitView
			.findViewById(R.id.province);
	WheelView city = (WheelView) dialog_exitView.findViewById(R.id.city);
	country.setViewAdapter(new DictAdapter(countries, UserInfoActivity.this));
	country.setVisibleItems(10);
	country.setCurrentItem(countries.indexOf(dCountry));
	updateProvince(province, provinces);
	DictAdapter adapter = new DictAdapter(citys, UserInfoActivity.this);
	city.setViewAdapter(adapter);
	city.setVisibleItems(10);
	if (user != null && user.getArea3() > 0) {
		for (Dict dict : citys) {
			if (user.getArea3() == dict.getDict_id()) {
				city.setCurrentItem(citys.indexOf(dict));
				break;
			}
		}
	} else {
		city.setCurrentItem(0);
	}
	removeProgressDialog();
}
 
开发者ID:entboost,项目名称:EntboostIM,代码行数:26,代码来源:UserInfoActivity.java

示例2: updateProvince

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
private void updateProvince(WheelView dictView, Vector<Dict> dicts) {
	DictAdapter adapter = new DictAdapter(dicts, this);
	dictView.setViewAdapter(adapter);
	dictView.setVisibleItems(10);
	
	if (dicts.size()==0) {
		return;
	}
	
	if (user != null && user.getArea2() > 0) {
		for (Dict dict : dicts) {
			if (user.getArea2() == dict.getDict_id()) {
				dictView.setCurrentItem(dicts.indexOf(dict));
				return;
			}
		}
	} else {
		dictView.setCurrentItem(0);
	}
}
 
开发者ID:entboost,项目名称:EntboostIM,代码行数:21,代码来源:UserInfoActivity.java

示例3: b

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
private void b(int i1)
{
    Debug.i("NewAlarmActivity", (new StringBuilder()).append("updateAmPmByHour hour=").append(i1).toString());
    if (q != null && !r)
    {
        WheelView wheelview = q;
        int j1;
        if (i1 >= 12)
        {
            j1 = 1;
        } else
        {
            j1 = 0;
        }
        wheelview.setCurrentItem(j1);
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:18,代码来源:NewAlarmActivity.java

示例4: onCreate

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle)
{
    setContentView(0x7f03000c);
    super.onCreate(bundle);
    b = (WheelView)findViewById(0x7f0a0056);
    b.setVisibleItems(5).setCenterDrawable(0x7f0200b9).setCenterStyle(getString(0x7f0d0046), 0x7f090014, 12, 40F, 5.5F).setViewAdapter(new PickAdapter(this, 90, 230, b, getResources().getColor(0x7f090052), getResources().getColor(0x7f090014), getResources().getColor(0x7f090016), false, 50, 16, 15, 15));
    if (mPersonInfo.height > 0)
    {
        b.setCurrentItem(-90 + mPersonInfo.height);
        return;
    } else
    {
        b.setCurrentItem(80);
        return;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:17,代码来源:PersonInfoSetHeightActivity.java

示例5: onCreate

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle)
{
    setContentView(0x7f03000e);
    super.onCreate(bundle);
    b = (WheelView)findViewById(0x7f0a0059);
    b.setVisibleItems(5).setCenterDrawable(0x7f0200b9).setCenterStyle(getString(0x7f0d00da), 0x7f090014, 12, 40F, 5.5F).setViewAdapter(new PickAdapter(this, 20, 205, b, getResources().getColor(0x7f090052), getResources().getColor(0x7f090014), getResources().getColor(0x7f090016), false, 50, 16, 15, 15));
    if (mPersonInfo.weight > 0)
    {
        b.setCurrentItem(-20 + mPersonInfo.weight);
        return;
    } else
    {
        b.setCurrentItem(40);
        return;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:17,代码来源:PersonInfoSetWeightActivity.java

示例6: TimeSleep

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public TimeSleep(Context context, AttributeSet attrs) {
    super(context, attrs);
    setTitle(R.string.sleep_title);
    setIcon(Util.getResourceFromAttribute(context, R.attr.ic_sleep_normal_style));
    setContent(context, R.layout.expandable_time_sleep);

    mHourWheel = (WheelView) findViewById(R.id.hour);
    mMinWheel = (WheelView) findViewById(R.id.min);
    final Button okButton = (Button) findViewById(R.id.ok);
    final Button cancelButton = (Button) findViewById(R.id.cancel);

    mHourWheel.setViewAdapter(new NumericWheelAdapter(context, 0, 23, "%02d"));
    mHourWheel.setCyclic(true);
    mMinWheel.setViewAdapter(new NumericWheelAdapter(context, 0, 59, "%02d"));
    mMinWheel.setCyclic(true);
    okButton.setOnClickListener(mOnOkListener);
    cancelButton.setOnClickListener(mOnCancelListener);

    if (mTime != null && mTime.before(Calendar.getInstance()))
        mTime = null;
    Calendar c = mTime != null ? mTime : Calendar.getInstance();
    mHourWheel.setCurrentItem(c.get(Calendar.HOUR_OF_DAY));
    mMinWheel.setCurrentItem(c.get(Calendar.MINUTE));
    setText();
}
 
开发者ID:smyhvae,项目名称:VlcTest,代码行数:26,代码来源:TimeSleep.java

示例7: TimeSleep

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public TimeSleep(Context context, AttributeSet attrs) {
    super(context, attrs);
    setTitle(R.string.sleep_title);
    setIcon(R.drawable.sleep);
    setContent(context, R.layout.expandable_time_sleep);

    mHourWheel = (WheelView) findViewById(R.id.hour);
    mMinWheel = (WheelView) findViewById(R.id.min);
    final Button okButton = (Button) findViewById(R.id.ok);
    final Button cancelButton = (Button) findViewById(R.id.cancel);

    mHourWheel.setViewAdapter(new NumericWheelAdapter(context, 0, 23, "%02d"));
    mHourWheel.setCyclic(true);
    mMinWheel.setViewAdapter(new NumericWheelAdapter(context, 0, 59, "%02d"));
    mMinWheel.setCyclic(true);
    okButton.setOnClickListener(mOnOkListener);
    cancelButton.setOnClickListener(mOnCancelListener);

    if (mTime != null && mTime.before(Calendar.getInstance()))
        mTime = null;
    Calendar c = mTime != null ? mTime : Calendar.getInstance();
    mHourWheel.setCurrentItem(c.get(Calendar.HOUR_OF_DAY));
    mMinWheel.setCurrentItem(c.get(Calendar.MINUTE));
    setText();
}
 
开发者ID:KlepikovMD,项目名称:popcorntime-android-kitkat,代码行数:26,代码来源:TimeSleep.java

示例8: updateDays

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
/**
 * Updates day wheel. Sets max days according to selected month and year
 */
private void updateDays(WheelView year, WheelView month, WheelView day) {
	Calendar calendar = Calendar.getInstance();
	if(year.getCurrentItem() == MaxYearCount && 
			month.getCurrentItem() == calendar.get(Calendar.MONTH)) {
		int today = calendar.get(Calendar.DAY_OF_MONTH);
		day.setViewAdapter(new DateNumericAdapter(mActivity, 1, today, -1));
		day.setCurrentItem(today - 1);
	} else {
		calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + year.getCurrentItem());
		calendar.set(Calendar.MONTH, month.getCurrentItem());

		int maxDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
		day.setViewAdapter(new DateNumericAdapter(mActivity, 1, maxDays, -1));
		int curDay = Math.min(maxDays, day.getCurrentItem() + 1);
		day.setCurrentItem(curDay - 1);
	}
}
 
开发者ID:tassadar2002,项目名称:ouser,代码行数:21,代码来源:DateDialogBuilder.java

示例9: updateDays

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
private void updateDays(WheelView year, WheelView month, WheelView day,
		WheelView hour, WheelView minute) {

	Calendar calendar = Calendar.getInstance();
	calendar.set(Calendar.YEAR,calendar.get(Calendar.YEAR) + year.getCurrentItem());// 将给定的日历字段设置为给定值。
	calendar.set(Calendar.MONTH, month.getCurrentItem());

	int maxDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);//给定此 Calendar 的时间值,返回指定日历字段可能拥有的最大值。
	dayAdapter = new DateNumericAdapter(this, 1, maxDays,calendar.get(Calendar.DAY_OF_MONTH) - 1);//calendar.get(Calendar.DAY_OF_MONTH)返回给定日历字段的值。
	day.setViewAdapter(dayAdapter);

	int curDay = Math.min(maxDays, day.getCurrentItem() + 1);// 返回两个
																// int值中较大的一个。

	day.setCurrentItem(curDay - 1, true);
	int years = calendar.get(Calendar.YEAR) - 100;
	age = years + "-" + (month.getCurrentItem() + 1) + "-"
			+ (day.getCurrentItem() + 1) + "-"
			+ (hour.getCurrentItem() + 1) + "-"
			+ (minute.getCurrentItem() + 1);

}
 
开发者ID:SYCndroid,项目名称:Android-Date-Address-Selector,代码行数:23,代码来源:RqxxActivity.java

示例10: updateDays

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
void updateDays(WheelView year, WheelView month, WheelView day) {
    this.calendar.clear();
    this.calendar.set(1, this.calendar.get(1) + year.getCurrentItem());
    this.calendar.set(2, month.getCurrentItem());
    int maxDays = this.calendar.getActualMaximum(5);
    day.setViewAdapter(new DateNumericAdapter(this.ctx, 1, maxDays, this.calendar.get(5) - 1,
            false));
    day.setCurrentItem(Math.min(maxDays, day.getCurrentItem() + 1) - 1, true);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:DatePickerWheelView.java

示例11: setCurrentItem

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public static void setCurrentItem(WheelView wheel, int value, int wheel_min, int defaultValue) {
    int index = value - wheel_min;
    if (index < 0) {
        index = defaultValue;
    }
    wheel.setCurrentItem(index, true);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:WheelUtils.java

示例12: onCreateView

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public View onCreateView(LayoutInflater layoutinflater, ViewGroup viewgroup, Bundle bundle)
{
    View view = super.onCreateView(layoutinflater, viewgroup, bundle);
    b = (WheelView)view.findViewById(0x7f0a00f8);
    b.setVisibleItems(5).setCenterDrawable(0x7f0200bb).setCenterStyle(getString(0x7f0d000c), 24F).setViewAdapter(new PickAdapter(getActivity(), 5, 100, b, getResources().getColor(0x7f090027), getResources().getColor(0x7f090036), 0x88999999, false, 46, 8, 7, 7, 1));
    if (a.age > 0)
    {
        b.setCurrentItem(-5 + a.age);
        return view;
    } else
    {
        b.setCurrentItem(19);
        return view;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:16,代码来源:PersonInfoSettingAgeFragment.java

示例13: onCreateView

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public View onCreateView(LayoutInflater layoutinflater, ViewGroup viewgroup, Bundle bundle)
{
    View view = super.onCreateView(layoutinflater, viewgroup, bundle);
    c = (WheelView)view.findViewById(0x7f0a011f);
    c.setVisibleItems(5).setCenterDrawable(0x7f0200bb).setCenterStyle(getString(0x7f0d0144), 24F).setViewAdapter(new PickAdapter(getActivity(), 3, 30, c, getResources().getColor(0x7f090027), getResources().getColor(0x7f090036), 0x88999999, false, 46, 8, 7, 7, 1));
    if (b.getInComingCallTime() >= 0)
    {
        c.setCurrentItem(-3 + b.getInComingCallTime());
        return view;
    } else
    {
        c.setCurrentItem(9997);
        return view;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:16,代码来源:SettingInComingCallTimeFragment.java

示例14: onCreate

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle)
{
    setContentView(0x7f03000a);
    super.onCreate(bundle);
    b = (WheelView)findViewById(0x7f0a0050);
    b.setVisibleItems(5).setCenterDrawable(0x7f0200b9).setCenterStyle(getString(0x7f0d000c), 0x7f090014, 12, 40F, 5.5F).setViewAdapter(new PickAdapter(this, 5, 100, b, getResources().getColor(0x7f090052), getResources().getColor(0x7f090014), getResources().getColor(0x7f090016), false, 50, 16, 15, 15));
    Intent intent;
    String s;
    String s1;
    if (mPersonInfo.age > 0)
    {
        b.setCurrentItem(-5 + mPersonInfo.age);
    } else
    {
        b.setCurrentItem(15);
    }
    intent = getIntent();
    s = intent.getStringExtra("miliao_icon_url");
    if (s != null && s.length() > 0)
    {
        mPersonInfo.avatarUrl = s;
    }
    s1 = intent.getStringExtra("miliao_nick_name");
    if (s1 != null && s1.length() > 0)
    {
        mPersonInfo.nickname = intent.getStringExtra("miliao_nick_name");
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:29,代码来源:PersonInfoSetAgeActivity.java

示例15: DialogEditVanityLength

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public DialogEditVanityLength(Context context, Address address) {
    super(context);
    this.address = address;
    setContentView(R.layout.dialog_edit_vanity_length);
    setOnDismissListener(this);
    findViewById(R.id.btn_cancel).setOnClickListener(this);
    findViewById(R.id.btn_ok).setOnClickListener(this);
    tvAddress = (TextView) findViewById(R.id.tv_address);
    wvLength = (WheelView) findViewById(R.id.wv_length);
    wvLength.setViewAdapter(lengthAdapter);
    wvLength.setCurrentItem(address.exsitsVanityLen() ? Math.max(address.getVanityLen() - 1,
            0) : 0);
    wvLength.addChangingListener(this);
    showVanityLength(address.getVanityLen());
}
 
开发者ID:bither,项目名称:bither-android,代码行数:16,代码来源:DialogEditVanityLength.java


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