本文整理汇总了Java中cn.addapp.pickers.picker.SinglePicker.setTitleText方法的典型用法代码示例。如果您正苦于以下问题:Java SinglePicker.setTitleText方法的具体用法?Java SinglePicker.setTitleText怎么用?Java SinglePicker.setTitleText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.addapp.pickers.picker.SinglePicker
的用法示例。
在下文中一共展示了SinglePicker.setTitleText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showConstellationPicker
import cn.addapp.pickers.picker.SinglePicker; //导入方法依赖的package包/类
/**
* 星座选择器
* @param activity
* @param current 当前星座
* @param listener
*/
public void showConstellationPicker(Activity activity,String current,final ItemListener listener){
SinglePicker<String> picker = new SinglePicker<>(activity,
new String[]{"水瓶座", "双鱼座", "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座",
"处女座", "天秤座", "天蝎座", "射手座", "摩羯座"});
picker.setCanLoop(false);//不禁用循环
picker.setWheelModeEnable(true);
picker.setWidth(picker.getScreenWidthPixels());
picker.setLineVisible(false);
picker.setTopBackgroundColor(0xFFFEE61B);
picker.setTitleText("星座");
picker.setTitleTextColor(0xFF000000);
picker.setTitleTextSize(14);
picker.setCancelTextColor(0xFF4D4D4D);
picker.setCancelTextSize(14);
picker.setSubmitTextColor(0xFF4D4D4D);
picker.setPressedTextColor(0xFF4D4D4D);
picker.setSubmitTextSize(14);
picker.setTopHeight(48);
picker.setSelectedTextColor(0xFFFEE61B);
picker.setSelectedItem(current);
picker.setOnItemPickListener(new OnItemPickListener<String>() {
@Override
public void onItemPicked(int index, String item) {
listener.onItemPicked(index,item);
}
});
picker.show();
}
示例2: showSexPicker
import cn.addapp.pickers.picker.SinglePicker; //导入方法依赖的package包/类
/**
* 显示性别选择器
* @param activity
* @param sex
* @param listener
*/
public void showSexPicker(Activity activity,String sex,final ItemListener listener){
SinglePicker<String> picker = new SinglePicker<>(activity,
new String[]{"男", "女"});
picker.setCanLoop(false);//不禁用循环
picker.setWheelModeEnable(true);
picker.setWidth(picker.getScreenWidthPixels());
picker.setLineVisible(false);
picker.setTopBackgroundColor(0xFFFEE61B);
picker.setTitleText("性别");
picker.setTitleTextColor(0xFF000000);
picker.setTitleTextSize(14);
picker.setCancelTextColor(0xFF4D4D4D);
picker.setCancelTextSize(14);
picker.setSubmitTextColor(0xFF4D4D4D);
picker.setPressedTextColor(0xFF4D4D4D);
picker.setSubmitTextSize(14);
picker.setTopHeight(48);
picker.setSelectedTextColor(0xFFFEE61B);
picker.setSelectedItem(sex);
picker.setOnItemPickListener(new OnItemPickListener<String>() {
@Override
public void onItemPicked(int index, String item) {
listener.onItemPicked(index,item);
}
});
picker.show();
}
示例3: showIndustryPicker
import cn.addapp.pickers.picker.SinglePicker; //导入方法依赖的package包/类
/**
* 显示所在行业选择器
* @param activity
* @param listener
*/
public void showIndustryPicker(Activity activity,final ItemListener listener){
SinglePicker<String> picker = new SinglePicker<>(activity,
new String[]{"学生","文化/艺术","影视/娱乐","金融",
"医药/健康","工业/制造业","IT/互联网/通信",
"媒体/公关","个体经营","教育/科研","其他"});
picker.setCanLoop(false);//不禁用循环
picker.setWheelModeEnable(true);
picker.setWidth(picker.getScreenWidthPixels());
picker.setLineVisible(false);
picker.setTopBackgroundColor(0xFFFEE61B);
picker.setTitleText("所在行业");
picker.setTitleTextColor(0xFF000000);
picker.setTitleTextSize(14);
picker.setCancelTextColor(0xFF4D4D4D);
picker.setCancelTextSize(14);
picker.setSubmitTextColor(0xFF4D4D4D);
picker.setPressedTextColor(0xFF4D4D4D);
picker.setSubmitTextSize(14);
picker.setTopHeight(48);
picker.setSelectedTextColor(0xFFFEE61B);
picker.setOnItemPickListener(new OnItemPickListener<String>() {
@Override
public void onItemPicked(int index, String item) {
listener.onItemPicked(index,item);
}
});
picker.show();
}
示例4: showEmotionalPicker
import cn.addapp.pickers.picker.SinglePicker; //导入方法依赖的package包/类
/**
* 显示情感状态选择器
* @param activity
* @param emotional
* @param listener
*/
public void showEmotionalPicker(Activity activity,String emotional,final ItemListener listener){
SinglePicker<String> picker = new SinglePicker<>(activity,
new String[]{"保密","单身","已婚","同性"});
picker.setCanLoop(false);//不禁用循环
picker.setWheelModeEnable(true);
picker.setWidth(picker.getScreenWidthPixels());
picker.setLineVisible(false);
picker.setTopBackgroundColor(0xFFFEE61B);
picker.setTitleText("情感状态");
picker.setTitleTextColor(0xFF000000);
picker.setTitleTextSize(14);
picker.setCancelTextColor(0xFF4D4D4D);
picker.setCancelTextSize(14);
picker.setSubmitTextColor(0xFF4D4D4D);
picker.setPressedTextColor(0xFF4D4D4D);
picker.setSubmitTextSize(14);
picker.setSelectedItem(emotional);
picker.setTopHeight(48);
picker.setSelectedTextColor(0xFFFEE61B);
picker.setOnItemPickListener(new OnItemPickListener<String>() {
@Override
public void onItemPicked(int index, String item) {
listener.onItemPicked(index,item);
}
});
picker.show();
}
示例5: onConstellationPicker
import cn.addapp.pickers.picker.SinglePicker; //导入方法依赖的package包/类
public void onConstellationPicker(View view) {
boolean isChinese = Locale.getDefault().getDisplayLanguage().contains("中文");
SinglePicker<String> picker = new SinglePicker<>(this,
isChinese ? new String[]{
"水瓶座", "双鱼座", "白羊座", "金牛座", "双子座", "巨蟹座",
"狮子座", "处女座", "天秤座", "天蝎座", "射手座", "摩羯座"
} : new String[]{
"Aquarius", "Pisces", "Aries", "Taurus", "Gemini", "Cancer",
"Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn"
});
picker.setCanLoop(false);//不禁用循环
picker.setTopBackgroundColor(0xFFEEEEEE);
picker.setTopHeight(50);
picker.setTopLineColor(0xFF33B5E5);
picker.setTopLineHeight(1);
picker.setTitleText(isChinese ? "请选择" : "Please pick");
picker.setTitleTextColor(0xFF999999);
picker.setTitleTextSize(12);
picker.setCancelTextColor(0xFF33B5E5);
picker.setCancelTextSize(13);
picker.setSubmitTextColor(0xFF33B5E5);
picker.setSubmitTextSize(13);
picker.setSelectedTextColor(0xFFEE0000);
picker.setUnSelectedTextColor(0xFF999999);
LineConfig config = new LineConfig();
config.setColor(0xFFEE0000);//线颜色
config.setAlpha(140);//线透明度
config.setRatio((float) (1.0 / 8.0));//线比率
picker.setLineConfig(config);
picker.setItemWidth(200);
picker.setBackgroundColor(0xFFE1E1E1);
//picker.setSelectedItem(isChinese ? "处女座" : "Virgo");
picker.setSelectedIndex(7);
picker.setOnItemPickListener(new OnItemPickListener<String>() {
@Override
public void onItemPicked(int index, String item) {
showToast("index=" + index + ", item=" + item);
}
});
picker.show();
}