本文整理汇总了Java中com.bigkoo.pickerview.OptionsPickerView类的典型用法代码示例。如果您正苦于以下问题:Java OptionsPickerView类的具体用法?Java OptionsPickerView怎么用?Java OptionsPickerView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OptionsPickerView类属于com.bigkoo.pickerview包,在下文中一共展示了OptionsPickerView类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ShowPickerView
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
private void ShowPickerView() {// 弹出选择器
OptionsPickerView pvOptions = new OptionsPickerView.Builder(this, new OptionsPickerView
.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
//返回的分别是三个级别的选中位置
String tx = options1Items.get(options1).getPickerViewText() +
options2Items.get(options1).get(options2) +
options3Items.get(options1).get(options2).get(options3);
mTxtAddress.setText(tx);
}
})
.setTitleText("城市选择")
.setDividerColor(Color.BLACK)
.setTextColorCenter(Color.BLACK) //设置选中项文字颜色
.setContentTextSize(20)
.build();
pvOptions.setPicker(options1Items, options2Items, options3Items); //三级选择器
pvOptions.show();
}
示例2: showSafeValueDialog
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
private void showSafeValueDialog() {
if (mOptionsPickerView == null) {
mOptionsPickerView = new OptionsPickerView.Builder(getActivity(), new OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
if (mSafeArr.size() > options1) {
mSelectedIndex = options1;
String selectStr = mSafeArr.get(options1);
mTvSafeValue.setText(selectStr + " %");
}
}
}).setTitleText(getString(R.string.dialog_title_safe_factor))
.setTitleBgColor(Color.parseColor(getString(R.string.color_titile_safe_dialog)))
.setTitleSize(16)
.setSubCalSize(14)
.setContentTextSize(23)
.setCancelColor(Color.parseColor(getString(R.string.color_cancle_text_safe_dialog)))
.setSubmitColor(Color.parseColor(getString(R.string.color_submit_text_safe_dialog)))
.build();
mOptionsPickerView.setPicker(mSafeArr);
}
mOptionsPickerView.setSelectOptions(mSelectedIndex);
mOptionsPickerView.show(true);
}
示例3: initView
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
public void initView(ArrayList<VideoQuality> qualityList) {
final ArrayList<VideoQualityWrapper> arrayList = new ArrayList<>(qualityList.size());
for (VideoQuality quality : qualityList) {
VideoQualityWrapper wrapper = new VideoQualityWrapper(mContext, quality);
arrayList.add(wrapper);
}
mPickerView.setPicker(arrayList);
mPickerView.setCyclic(false);
mPickerView.setCancelable(true);
mPickerView.setOnoptionsSelectListener(new OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int i, int i1, int i2) {
if (mCallback != null) {
VideoQuality videoQuality = arrayList.get(i).getQuality();
mCallback.onVideoQualitySelected(videoQuality);
}
}
});
}
示例4: ShowPickerView
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
private void ShowPickerView() {// 弹出选择器
OptionsPickerView pvOptions = new OptionsPickerView.Builder(this, new OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
//返回的分别是三个级别的选中位置
String tx = options1Items.get(options1).getPickerViewText()+
options2Items.get(options1).get(options2)+
options3Items.get(options1).get(options2).get(options3);
Toast.makeText(JsonDataActivity.this,tx,Toast.LENGTH_SHORT).show();
}
})
.setTitleText("城市选择")
.setDividerColor(Color.BLACK)
.setTextColorCenter(Color.BLACK) //设置选中项文字颜色
.setContentTextSize(20)
.build();
/*pvOptions.setPicker(options1Items);//一级选择器
pvOptions.setPicker(options1Items, options2Items);//二级选择器*/
pvOptions.setPicker(options1Items, options2Items,options3Items);//三级选择器
pvOptions.show();
}
示例5: initView
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
private void initView() {
//选项选择器
pvOptions = new OptionsPickerView<String>(this);
//三级联动
pvOptions.setPicker(optionsOne, optionsTwo, optionsThree, true);
//设置标题
pvOptions.setTitle("选择城市");
//设置是否可循环
pvOptions.setCyclic(false, false, false);
//设置标题
//pvOptions.setLabels("国家", "省", "市");
//设置确定监听
pvOptions.setOnoptionsSelectListener(new OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int option2, int options3) {
Log.e("MainActivity", "选择的是:"
+ optionsOne.get(options1)
+ optionsTwo.get(options1).get(option2)
+ optionsThree.get(options1).get(option2).get(options3));
}
});
//设置消失监听
pvOptions.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(Object o) {
if (o instanceof OptionsPickerView) {
Log.e("MainActivity", "消失了是OptionsPickerView");
} else {
Log.e("MainActivity", "消失了不是OptionsPickerView");
}
}
});
//显示
pvOptions.show();
}
示例6: initOptionPicker
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
private void initOptionPicker() {//条件选择器初始化
/**
* 注意 :如果是三级联动的数据(省市区等),请参照 JsonDataActivity 类里面的写法。
*/
pvOptions = new OptionsPickerView.Builder(this, new OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
//返回的分别是三个级别的选中位置
String tx = options1Items.get(options1).getPickerViewText()
+ options2Items.get(options1).get(options2)
/* + options3Items.get(options1).get(options2).get(options3).getPickerViewText()*/;
btn_Options.setText(tx);
}
})
.setTitleText("城市选择")
.setContentTextSize(20)//设置滚轮文字大小
.setDividerColor(Color.LTGRAY)//设置分割线的颜色
.setSelectOptions(0, 1)//默认选中项
.setBgColor(Color.BLACK)
.setTitleBgColor(Color.DKGRAY)
.setTitleColor(Color.LTGRAY)
.setCancelColor(Color.YELLOW)
.setSubmitColor(Color.YELLOW)
.setTextColorCenter(Color.LTGRAY)
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
.setLabels("省", "市", "区")
.setBackgroundId(0x66000000) //设置外部遮罩颜色
.build();
//pvOptions.setSelectOptions(1,1);
/*pvOptions.setPicker(options1Items);//一级选择器*/
pvOptions.setPicker(options1Items, options2Items);//二级选择器
/*pvOptions.setPicker(options1Items, options2Items,options3Items);//三级选择器*/
}
示例7: initNoLinkOptionsPicker
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
private void initNoLinkOptionsPicker() {// 不联动的多级选项
pvNoLinkOptions = new OptionsPickerView.Builder(this, new OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
String str = "food:" + food.get(options1)
+ "\nclothes:" + clothes.get(options2)
+ "\ncomputer:" + computer.get(options3);
Toast.makeText(MainActivity.this, str, Toast.LENGTH_SHORT).show();
}
}).build();
pvNoLinkOptions.setNPicker(food, clothes, computer);
}
示例8: init
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
private void init() {
initProvinceDatas();
mCityPikerView = new OptionsPickerView(this);
mCityPikerView.setPicker((ArrayList) mProvinces,mCities,mDistricts,true);
mCityPikerView.setTitle("选择城市");
mCityPikerView.setCyclic(false,false,false);
mCityPikerView.setOnoptionsSelectListener(new OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int option2, int options3) {
String addresss = mProvinces.get(options1).getName() +" "
+ mCities.get(options1).get(option2)+" "
+ mDistricts.get(options1).get(option2).get(options3);
mTxtAddress.setText(addresss);
}
});
}
示例9: VideoQualityPicker
import com.bigkoo.pickerview.OptionsPickerView; //导入依赖的package包/类
public VideoQualityPicker(Context context, VideoQualitySelectCallback callback) {
mContext = context;
mPickerView = new OptionsPickerView(context);
mCallback = callback;
}