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


Java WheelView.addChangingListener方法代码示例

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


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

示例1: initPopupWindow

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public void initPopupWindow(){
	// 利用layoutInflater获得View
			LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			View view = layoutInflater.inflate(R.layout.citys, null);
			mProvince = (WheelView) view.findViewById(R.id.id_province);
			mCity = (WheelView) view.findViewById(R.id.id_city);
			mArea = (WheelView) view.findViewById(R.id.id_area);
			

			// 下面是两种方法得到宽度和高度 getWindow().getDecorView().getWidth()

			popupWindow = new PopupWindow(view,
					WindowManager.LayoutParams.MATCH_PARENT,
					WindowManager.LayoutParams.WRAP_CONTENT);
			// 设置popWindow弹出窗体可点击,这句话必须添加,并且是true
			popupWindow.setFocusable(true);

			// 必须要给调用这个方法,否则点击popWindow以外部分,popWindow不会消失
		     popupWindow.setBackgroundDrawable(new BitmapDrawable());
		     
		     
		    mProvince.setViewAdapter(new ArrayWheelAdapter<String>(LaPinAddressAdd.this, mProvinceDatas));
				// 添加change事件
			mProvince.addChangingListener(this);
				// 添加change事件
			mCity.addChangingListener(this);
				// 添加change事件
			mArea.addChangingListener(this);

			mProvince.setVisibleItems(5);
			mCity.setVisibleItems(5);
			mArea.setVisibleItems(5);
		    popupWindow.setOnDismissListener(new OnDismissListener() {
				public void onDismiss() {						
					city.setText(mCurrentProviceName+mCurrentCityName+mCurrentAreaName);
				}
			});
		     
}
 
开发者ID:androidWeq,项目名称:ItHome,代码行数:40,代码来源:LaPinAddressAdd.java

示例2: 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

示例3: onCreate

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.date_layout);

    Calendar calendar = Calendar.getInstance();

    final WheelView month = (WheelView) findViewById(R.id.month);
    final WheelView year = (WheelView) findViewById(R.id.year);
    final WheelView day = (WheelView) findViewById(R.id.day);
    
    OnWheelChangedListener listener = new OnWheelChangedListener() {
        public void onChanged(WheelView wheel, int oldValue, int newValue) {
            updateDays(year, month, day);
        }
    };

    // month
    int curMonth = calendar.get(Calendar.MONTH);
    String months[] = new String[] {"January", "February", "March", "April", "May",
            "June", "July", "August", "September", "October", "November", "December"};
    month.setViewAdapter(new DateArrayAdapter(this, months, curMonth));
    month.setCurrentItem(curMonth);
    month.addChangingListener(listener);

    // year
    int curYear = calendar.get(Calendar.YEAR);
    year.setViewAdapter(new DateNumericAdapter(this, curYear, curYear + 10, 0));
    year.setCurrentItem(curYear);
    year.addChangingListener(listener);
    
    //day
    updateDays(year, month, day);
    day.setCurrentItem(calendar.get(Calendar.DAY_OF_MONTH) - 1);
}
 
开发者ID:yankovskiy,项目名称:WheelWidget,代码行数:36,代码来源:DateActivity.java

示例4: initWheel

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
/**
 * Initializes wheel
 * @param id the wheel widget Id
 */
private void initWheel(int id) {
    WheelView wheel = getWheel(id);
    wheel.setViewAdapter(new NumericWheelAdapter(this, 0, 9));
    wheel.setCurrentItem((int)(Math.random() * 10));
    
    wheel.addChangingListener(changedListener);
    wheel.addScrollingListener(scrolledListener);
    wheel.setCyclic(true);
    wheel.setInterpolator(new AnticipateOvershootInterpolator());
}
 
开发者ID:yankovskiy,项目名称:WheelWidget,代码行数:15,代码来源:PasswActivity.java

示例5: onCreate

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.speed1_layout);
    final WheelView speed = (WheelView) findViewById(R.id.speed);
    final SpeedAdapter speedAdapter = new SpeedAdapter(this, 245, 5);
    speed.setViewAdapter(speedAdapter);
    
    final String unitsValues[] = new String[] {
            "km/h",
            "m/h",
            "m/s",
    };
    
    final WheelView units = (WheelView) findViewById(R.id.units);
    ArrayWheelAdapter<String> unitsAdapter =
        new ArrayWheelAdapter<String>(this, unitsValues);
    unitsAdapter.setItemResource(R.layout.units_item);
    unitsAdapter.setItemTextResource(R.id.text);
    unitsAdapter.setEmptyItemResource(R.layout.units_item);
    units.setViewAdapter(unitsAdapter);
    //units.setVisibleItems(3);
    
    units.addChangingListener(new OnWheelChangedListener() {
        @Override
        public void onChanged(WheelView wheel, int oldValue, int newValue) {
            String value = unitsValues[units.getCurrentItem()];
            speedAdapter.setUnits(" " + value);
            speed.invalidateWheel(false);
        }
    });
    
    units.setCurrentItem(1);
}
 
开发者ID:yankovskiy,项目名称:WheelWidget,代码行数:36,代码来源:SpeedActivity.java

示例6: initWheel

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
/**
 * Initializes wheel
 * @param id the wheel widget Id
 */
private void initWheel(int id) {
    WheelView wheel = getWheel(id);
    wheel.setViewAdapter(new SlotMachineAdapter(this));
    wheel.setCurrentItem((int)(Math.random() * 10));
    
    wheel.addChangingListener(changedListener);
    wheel.addScrollingListener(scrolledListener);
    wheel.setCyclic(true);
    wheel.setEnabled(false);
}
 
开发者ID:yankovskiy,项目名称:WheelWidget,代码行数:15,代码来源:SlotMachineActivity.java

示例7: init

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
/**
 * 相关view的初始化和is本地数据操作
 */
private void init() {
	main_rl_all_view = (RelativeLayout) findViewById(R.id.main_rl_all_view);
	main_edit_number = (EditText) findViewById(R.id.main_edit_number);
	main_iv_search = (ImageView) findViewById(R.id.main_iv_search);
	main_circle_layout = (CircleLayout) findViewById(R.id.main_circle_layout);
	main_tv_show_information = (TextView) findViewById(R.id.main_tv_show_information);
	main_tv_zipcode = (TextView) findViewById(R.id.main_tv_zipcode);
	main_pb_circle = (ProgressBar) findViewById(R.id.main_pb_circle);
	main_ll_area = (LinearLayout) findViewById(R.id.main_ll_area);
	wheel_province = (WheelView) findViewById(R.id.wheel_province);
	wheel_district = (WheelView) findViewById(R.id.wheel_district);
	main_ll_plate = (LinearLayout) findViewById(R.id.main_ll_plate);
	wheel_plate_province = (WheelView) findViewById(R.id.wheel_plate_province);
	wheel_plate = (WheelView) findViewById(R.id.wheel_plate);
	wheel_area = (WheelView) findViewById(R.id.wheel_area);
	main_iv_search.setOnClickListener(this);
	// 滑动改变的监听
	wheel_province.addChangingListener(this);
	wheel_district.addChangingListener(this);
	main_rl_all_view.setOnTouchListener(this);
	wheel_plate_province.addChangingListener(this);
	wheel_plate.addChangingListener(this);
	wheel_area.addChangingListener(this);

	if (!new CopyDbToSdcard(this).isDbFile()) {// 查看有没有数据库文件
		Log.e(tag, "没有数据库");
		showCustomMessage("首次使用提示", "下载初始数据——耗时\n拷贝初始数据——不耗时");

	} else {// 有文件
		String sql = "Select provinceId From district Where provinceId = ?";
		Boolean isDB = new SqlHelper(this).isSelectDbInfomation(sql, "33");
		if (isDB) {// 有文件有数据
			initLocation();
		} else {// 有文件没数据
				// 删除文件重新创建
			CopyDbToSdcard copyDbFile = new CopyDbToSdcard(this);
			Boolean deleteDbFile = copyDbFile.deleteDbFile();
			if (deleteDbFile) {
				copyDbFile.copyDatabase();
			}
		}
	}

}
 
开发者ID:PengSen,项目名称:work_sen,代码行数:48,代码来源:MainActivity.java

示例8: onCreate

import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
		setContentView(R.layout.activity_rqxx);

		this.age = "2013-10-1-10-30";//默认时间
		
		btn_cancel = (ImageButton) findViewById(R.id.cancel);
		btn_submit = (ImageButton) findViewById(R.id.submit);
		year = (WheelView) findViewById(R.id.year);
		month = (WheelView)findViewById(R.id.month);
		day = (WheelView) findViewById(R.id.day);
		hour = (WheelView) findViewById(R.id.hour);
		minute = (WheelView) findViewById(R.id.minute);

		btn_submit.setOnClickListener(this);
		btn_cancel.setOnClickListener(this);
		
		Calendar calendar = Calendar.getInstance();//使用默认时区和语言环境获得一个日历。
		
		OnWheelChangedListener listener = new OnWheelChangedListener() {
			public void onChanged(WheelView wheel, int oldValue, int newValue) {
				updateDays(year, month, day, hour, minute);

			}
		};
		int curYear = calendar.get(Calendar.YEAR);
		if (age != null && age.contains("-")) {
			String str[] = age.split("-");
			mCurYear = 100 - (curYear - Integer.parseInt(str[0]));
			mCurMonth = Integer.parseInt(str[1]) - 1;
			mCurDay = Integer.parseInt(str[2]) - 1;
			mCurHour = Integer.parseInt(str[3]) - 1;
			mCurMinute = Integer.parseInt(str[4]) - 1;
			;
		}
		monthAdapter = new DateNumericAdapter(this, 1, 12, 5);
		month.setViewAdapter(monthAdapter);
		month.setCurrentItem(mCurMonth);
		month.addChangingListener(listener);
		// year

		yearAdapter = new DateNumericAdapter(this, curYear - 100,
				curYear + 100, 100 - 20);
		year.setViewAdapter(yearAdapter);
		year.setCurrentItem(mCurYear);
		year.addChangingListener(listener);
		// day

//		updateDays(year, month, day, hour, minute);
		day.setCurrentItem(mCurDay);
		updateDays(year, month, day, hour, minute);
		day.addChangingListener(listener);

		hourAdapter = new DateNumericAdapter(this, 1, 24, 5);
		hour.setViewAdapter(hourAdapter);
		hour.setCurrentItem(mCurHour);
		updateDays(year, month, day, hour, minute);
		hour.addChangingListener(listener);

		minuteAdapter = new DateNumericAdapter(this, 1, 60, 30);
		minute.setViewAdapter(minuteAdapter);
		minute.setCurrentItem(mCurMinute);
		updateDays(year, month, day, hour, minute);
		minute.addChangingListener(listener);

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


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