本文整理汇总了Java中kankan.wheel.widget.WheelView.setVisibleItems方法的典型用法代码示例。如果您正苦于以下问题:Java WheelView.setVisibleItems方法的具体用法?Java WheelView.setVisibleItems怎么用?Java WheelView.setVisibleItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kankan.wheel.widget.WheelView
的用法示例。
在下文中一共展示了WheelView.setVisibleItems方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// ---Inflate the layout for this fragment---
View rootView = inflater.inflate(R.layout.fragment2, container, false);
wheelView = (WheelView)rootView.findViewById(R.id.wheelView);
wheelView.setVisibleItems(5);
wheelView.setCyclic(true);
wheelView.setViewAdapter(new AbstractWheelTextAdapter(getActivity(), R.layout.wheel_text_view)
{
@Override
protected CharSequence getItemText(int index)
{
return new Date( ( (new Date().getTime())/1000+index)*1000 ).toString();
}
@Override
public int getItemsCount() {
return 60;
}
});
return rootView;
}
示例2: 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();
}
示例3: 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);
}
}
示例4: 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);
}
});
}