本文整理汇总了Java中kankan.wheel.widget.adapters.ArrayWheelAdapter类的典型用法代码示例。如果您正苦于以下问题:Java ArrayWheelAdapter类的具体用法?Java ArrayWheelAdapter怎么用?Java ArrayWheelAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArrayWheelAdapter类属于kankan.wheel.widget.adapters包,在下文中一共展示了ArrayWheelAdapter类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: locationToRegions
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
private void locationToRegions() {
if (this.mProvinceDatas != null && this.mProvinceDatas.length > 0) {
this.mProvince.setViewAdapter(new ArrayWheelAdapter(this.mContext, this
.mProvinceDatas));
this.mCurrentProviceName = this.mProvinceDatas[0];
String[] cities = (String[]) this.mCitisDatasMap.get(this.mCurrentProviceName);
this.mCurrentCityName = cities[0];
this.mCity.setViewAdapter(new ArrayWheelAdapter(this.mContext, cities));
this.mCity.setCurrentItem(0);
String[] areas = (String[]) this.mAreaDatasMap.get(this.mCurrentCityName);
this.mCurrentDistrictName = areas[0];
this.mArea.setViewAdapter(new ArrayWheelAdapter(this.mContext, areas));
this.mArea.setCurrentItem(0);
if (this.isAdd && this.regionChangeListener != null) {
this.regionChangeListener.onChange(this.mCurrentProviceName, this
.mCurrentCityName, this.mCurrentDistrictName);
}
this.mProvince.addChangingListener(this);
this.mCity.addChangingListener(this);
this.mArea.addChangingListener(this);
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:RegionsPopwindow.java
示例2: setWheelAdapter
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
/**
* Sets adapter for wheel
*
* @param context
* application context
* @param wheel
* object for sets adapter
* @param values
* values for adapter
* @param textSizeResourceId
* text size resource id for wheels
* @param isFirstEmpty
* true if need first empty item
*/
public static void setWheelAdapter(Context context, WheelView wheel,
String values[], int textSizeResourceId, boolean isFirstEmpty) {
AbstractWheelTextAdapter adapter;
int textSize = (int) (context.getResources().getDimension(
textSizeResourceId) / context.getResources()
.getDisplayMetrics().density);
Log.variable("textSize", String.valueOf(textSize));
if (!isFirstEmpty) {
adapter = new ArrayWheelAdapter<>(context, values);
} else {
adapter = new WheelAdapter<>(context, values);
}
adapter.setTextSize(textSize);
wheel.setViewAdapter(adapter);
}
开发者ID:yankovskiy,项目名称:PhotoTools,代码行数:32,代码来源:Common.java
示例3: locationToRegions
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
private void locationToRegions() {
this.mUnit.setViewAdapter(new ArrayWheelAdapter(this.mContext, this.mUnits));
int index = getUnitIndex();
this.mCurrentUnitName = this.mUnits[index];
this.mUnit.setCurrentItem(index);
if (this.mOnChangeListener != null) {
this.mOnChangeListener.onChange(this.mCurrentUnitName);
}
this.mUnit.addChangingListener(this);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:CustomUnitPopupWindow.java
示例4: updateCities
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
private void updateCities() {
this.mCurrentProviceName = this.mProvinceDatas[this.mProvince.getCurrentItem()];
String[] cities = (String[]) this.mCitisDatasMap.get(this.mCurrentProviceName);
if (cities == null) {
cities = new String[]{""};
}
this.mCity.setViewAdapter(new ArrayWheelAdapter(this.mContext, cities));
this.mCity.setCurrentItem(0);
updateAreas();
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:RegionsPopwindow.java
示例5: updateAreas
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
private void updateAreas() {
this.mCurrentCityName = ((String[]) this.mCitisDatasMap.get(this.mCurrentProviceName))
[this.mCity.getCurrentItem()];
String[] areas = (String[]) this.mAreaDatasMap.get(this.mCurrentCityName);
if (areas == null) {
areas = new String[]{""};
}
this.mArea.setViewAdapter(new ArrayWheelAdapter(this.mContext, areas));
this.mArea.setCurrentItem(0);
if (areas != null && areas.length > 0) {
this.mCurrentDistrictName = areas[0];
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:RegionsPopwindow.java
示例6: initPopupWindow
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的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
示例7: updateCities
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
/**
* 根据当前的省,更新市WheelView的信息
*/
private void updateCities()
{
int pCurrent = mProvince.getCurrentItem();
mCurrentProviceName = mProvinceDatas[pCurrent];
String[] cities = mCitisDatasMap.get(mCurrentProviceName);
if (cities == null)
{
cities = new String[] { "" };
}
mCity.setViewAdapter(new ArrayWheelAdapter<String>(this, cities));
mCity.setCurrentItem(0);
updateAreas();
}
开发者ID:androidWeq,项目名称:ItHome,代码行数:17,代码来源:LaPinAddressAdd.java
示例8: updateAreas
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
/**
* 根据当前的市,更新区WheelView的信息
*/
private void updateAreas()
{
int pCurrent = mCity.getCurrentItem();
mCurrentCityName = mCitisDatasMap.get(mCurrentProviceName)[pCurrent];
String[] areas = mAreaDatasMap.get(mCurrentCityName);
if (areas == null)
{
areas = new String[] { "" };
}
mArea.setViewAdapter(new ArrayWheelAdapter<String>(this, areas));
mArea.setCurrentItem(0);
}
开发者ID:androidWeq,项目名称:ItHome,代码行数:17,代码来源:LaPinAddressAdd.java
示例9: initAreaSelect
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
/**
* 初始化城市选择器
*/
private void initAreaSelect(int state) {
Animation animation = AnimationUtils.loadAnimation(
getApplicationContext(), R.anim.wheel_move_in);
if (state == 0) {// 地区选择的wheel
main_ll_area.startAnimation(animation);
main_ll_area.setVisibility(View.VISIBLE);
// 地区选择时的双击监听
wheel_district.setOnTouchListener(new onDoubleClickListener());
wheel_province.setViewAdapter(new ArrayWheelAdapter<String>(
MainActivity.this, mProvinceDatas));
// 设置显示的最大条数
wheel_province.setVisibleItems(7);
wheel_district.setVisibleItems(7);
updateDistricts();
} else {
main_ll_plate.startAnimation(animation);
main_ll_plate.setVisibility(View.VISIBLE);
// 展示车牌号的wheel
wheel_plate_province.setViewAdapter(new ArrayWheelAdapter<String>(
MainActivity.this, mPlateProDatas));
// Log.e("mPlateProDatas", "" + mPlateProDatas[0]);
// 设置显示的最大条数
wheel_plate_province.setVisibleItems(7);
wheel_plate.setVisibleItems(7);
wheel_area.setVisibleItems(7);
updatePlates();
}
}
开发者ID:PengSen,项目名称:work_sen,代码行数:32,代码来源:MainActivity.java
示例10: updateDistricts
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
/**
* 根据当前省更新市一级数据
*/
private void updateDistricts() {
int provinceId = wheel_province.getCurrentItem();
mDistrictDatas = new SqlHelper(this).getDistrictData(String
.valueOf(provinceId));
// 设置适配器,与province数组数据相对应的数据即可~
wheel_district.setViewAdapter(new ArrayWheelAdapter<String>(this,
mDistrictDatas));
wheel_district.setCurrentItem(0);
}
开发者ID:PengSen,项目名称:work_sen,代码行数:13,代码来源:MainActivity.java
示例11: updatePlates
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
private void updatePlates() {
int currentItem = wheel_plate_province.getCurrentItem();
// 从数据库得到数据放入wheel控件~
List<String[]> plateData = new SqlHelper(this).getPlateData(String
.valueOf(currentItem));
wheel_plate.setViewAdapter(new ArrayWheelAdapter<String>(this,
plateData.get(0)));
wheel_area.setViewAdapter(new ArrayWheelAdapter<String>(this, plateData
.get(1)));
wheel_plate.setCurrentItem(0);
wheel_area.setCurrentItem(0);
}
开发者ID:PengSen,项目名称:work_sen,代码行数:13,代码来源:MainActivity.java
示例12: initNumberWheel
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
private void initNumberWheel() {
numberWheel = (WheelView) view.findViewById(R.id.current_position);
Integer[] indexs = new Integer[total];
for (int i = 0; i < total; i++) {
indexs[i] = i + 1;
}
ArrayWheelAdapter<Integer> adapter =
new ArrayWheelAdapter<Integer>(ctx, indexs);
numberWheel.setViewAdapter(adapter);
}
开发者ID:Vosie,项目名称:WikiCards,代码行数:11,代码来源:CardPositionSelector.java
示例13: updateCities
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
/**
* Updates the city wheel
*/
private void updateCities(WheelView city, String cities[][], int index) {
ArrayWheelAdapter<String> adapter =
new ArrayWheelAdapter<String>(this, cities[index]);
adapter.setTextSize(18);
city.setViewAdapter(adapter);
city.setCurrentItem(cities[index].length / 2);
}
开发者ID:yankovskiy,项目名称:WheelWidget,代码行数:11,代码来源:CitiesActivity.java
示例14: onCreate
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的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
示例15: onCreate
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.time2_layout);
final WheelView hours = (WheelView) findViewById(R.id.hour);
NumericWheelAdapter hourAdapter = new NumericWheelAdapter(this, 0, 23);
hourAdapter.setItemResource(R.layout.wheel_text_item);
hourAdapter.setItemTextResource(R.id.text);
hours.setViewAdapter(hourAdapter);
final WheelView mins = (WheelView) findViewById(R.id.mins);
NumericWheelAdapter minAdapter = new NumericWheelAdapter(this, 0, 59, "%02d");
minAdapter.setItemResource(R.layout.wheel_text_item);
minAdapter.setItemTextResource(R.id.text);
mins.setViewAdapter(minAdapter);
mins.setCyclic(true);
final WheelView ampm = (WheelView) findViewById(R.id.ampm);
ArrayWheelAdapter<String> ampmAdapter =
new ArrayWheelAdapter<String>(this, new String[] {"AM", "PM"});
ampmAdapter.setItemResource(R.layout.wheel_text_item);
ampmAdapter.setItemTextResource(R.id.text);
ampm.setViewAdapter(ampmAdapter);
// set current time
Calendar calendar = Calendar.getInstance(Locale.US);
hours.setCurrentItem(calendar.get(Calendar.HOUR));
mins.setCurrentItem(calendar.get(Calendar.MINUTE));
ampm.setCurrentItem(calendar.get(Calendar.AM_PM));
final WheelView day = (WheelView) findViewById(R.id.day);
day.setViewAdapter(new DayArrayAdapter(this, calendar));
}
开发者ID:yankovskiy,项目名称:WheelWidget,代码行数:36,代码来源:Time2Activity.java
示例16: setWheelArrayText
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
public static void setWheelArrayText(WheelView wheel, Context context, String[] strings) {
ArrayWheelAdapter arrayWheelAdapter = new ArrayWheelAdapter(context, strings);
arrayWheelAdapter.setTextColor(context.getResources().getColor(R.color.jt));
arrayWheelAdapter.setTextSize(17);
wheel.setViewAdapter(arrayWheelAdapter);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:7,代码来源:WheelUtils.java
示例17: initNumPicker
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
private void initNumPicker() {
this.num_picker_wheel.setViewAdapter(new NumericWheelAdapter(this.context, 1, 120));
this.num_picker_wheel.setCurrentItem(this.default_index);
((WheelView) findViewById(R.id.unit_picker)).setViewAdapter(new ArrayWheelAdapter(this
.context, new String[]{this.context.getString(R.string.u1)}));
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:7,代码来源:SportUnitPicker.java
示例18: initPicker
import kankan.wheel.widget.adapters.ArrayWheelAdapter; //导入依赖的package包/类
private void initPicker() {
this.areaPicker.setViewAdapter(new ArrayWheelAdapter(this.context, this.addressString));
this.areaPicker.setCurrentItem(this.defaultItem);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:5,代码来源:AreaPicker.java
注:本文中的kankan.wheel.widget.adapters.ArrayWheelAdapter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论