Skip to content

Methods and parameters

xiaosongzeem edited this page Oct 20, 2019 · 10 revisions
Method Usage scenarios Describe Minimum version limit
Builder(Context context, OnTimeSelectListener listener) TimePicker&OptionsPicker Construction method of builder V3.0.1
build() TimePicker&OptionsPicker return object V3.0.1
setTextXOffset() TimePicker&OptionsPicker setting item contentText XOffset V3.2.7
setOutSideCancelable(boolean cancelable) TimePicker&OptionsPicker Click the outside to dismiss V3.0.1
setDividerType(WheelView.DividerType dividerType) TimePicker&OptionsPicker Support FILL and WRAP V3.0.6
isDialog(boolean isDialog) TimePicker&OptionsPicker Dialog mode, default is false V3.0.6
setLayoutRes(int res, CustomListener customListener) TimePicker&OptionsPicker CustomLayoutRes,need add WheelView to the custom layout, otherwise will report null pointer exception, please refer to the demo V3.0.7
show() TimePicker&OptionsPicker It is used to show Picker V3.0.1
show(View v) TimePicker&OptionsPicker Need add view parameters,The view parameter will passed to the callback method V3.2.1
WheelView.DividerType.CIRCLE TimePicker&OptionsPicker New style for selected item V4.1.9
isAlphaGradient(boolean isAlphaGradient) TimePicker&OptionsPicker Provide method to control whether the items is gradient alpha V4.1.9
setItemVisibleCount(int count) TimePicker&OptionsPicker Provide method to set the max visible item V4.1.9
--- --- --- ---
TimePicker
setType(TimePickerView.Type type) TimePicker Support six modes V3.0.1
gravity(int gravity) TimePicker default is center V3.0.1
setDate(Date date) TimePicker default is system date V3.0.1
setRange(int startYear,int endYear) TimePicker startYears and endYears V3.0.1
setLabel(String label_year, String label_month, String label_day, String label_hours, String label_mins, String label_seconds) TimePicker Label content ,you can set null or "" to hide it V3.0.2
isCyclic(boolean cyclic) TimePicker default is true V3.0.1
--- --- --- ---
OptionsPicker
setCyclic(boolean cyclic1,boolean cyclic2,boolean cyclic3) OptionsPicker linkage V3.0.1
setSelectOptions(int option1, int option2, int option3) OptionsPicker default option V3.0.1
setLinkage(boolean linkage) OptionsPicker default is true V3.0.1
setTypeface(Typeface font) OptionsPicker Several system font styles V3.1.2
setNPicker(List Items1, List Items2, List Items3) OptionsPicker Calls this method to add Non linkage data source V3.2.1
--- --- --- ---
Text
setSubmitText(String Str_Submit) TimePicker&OptionsPicker Submit button text V3.0.1
setCancelText(String Str_Cancel) TimePicker&OptionsPicker Cancel button text V3.0.1
setTitleText(String Str_Title) TimePicker&OptionsPicker Title Text V3.0.1
--- --- --- ---
Color
setSubmitColor(int Color_Submit) TimePicker&OptionsPicker Submit button text color V3.0.1
setCancelColor(int Color_Cancel) TimePicker&OptionsPicker Cancel button text color V3.0.1
setTitleColor(int Color_Title) TimePicker&OptionsPicker Title text color V3.0.1
setBgColor(int Color_Background_Wheel) TimePicker&OptionsPicker WheelView background color V3.0.3
setTitleBgColor(int Color_Background_Title) TimePicker&OptionsPicker Title background color V3.0.3
setDividerColor(int dividerColor) TimePicker&OptionsPicker divider color V3.0.4
setTextColorCenter(int textColorCenter) TimePicker&OptionsPicker the selected item text color V3.0.4
setTextColorOut(int textColorOut) TimePicker&OptionsPicker unselected item text color V3.0.4
--- --- --- ---
Size
setSubCalSize(int Size_Submit_Cancel) TimePicker&OptionsPicker Submit and cancel button textSize V3.0.1
setTitleSize(int Size_Title) TimePicker&OptionsPicker the titleSize V3.0.1
setContentSize(int Size_Content) TimePicker&OptionsPicker Content textSize V3.0.3
setLineSpacingMultiplier(float lineSpacingMultiplier) TimePicker&OptionsPicker Limited to 1.2-2.0 multiple of maxTextHeight V3.0.4