I made reference to the open source library AndroidPicker.
The AndroidPicker function is very complete, but many places do not meet my daily development requirements, so I made significant modifications based on the code of AndroidPicker. Thank you for the open source.
use
allprojects {
repositories {
...
maven {
url 'https://jitpack.io' }
}
}
implementation 'com.github.JFShare:JFPicker:2.0'
1. Replacement of the core scroll wheel control
Use RecyclerView + RecyclerView.ItemDecoration to replace the core wheel control of AndroidPicker, providing a better wheel 3D effect and scrolling experience.
The core WheelView wheel control, the style is drawn by WheelDecoration, the data is controlled by WheelViewAdapter , the code is shared by colleagues, it should be shared by online experts, if you know the source, please leave a message.
After refactoring, more settings are supported.
Properties can be set dynamically and take effect immediately:
1. Scroll wheel effect settings: wheel style or RecyclerView tile style, whether to use canvas offset to achieve a more three-dimensional 3D effect, the curvature of the wheel, several items above and below the selected item, and each item Height
2. Font settings: font color, selected font color, font size, selected font size, whether to bold, selected whether to bold 3.
Interval settings: interval style, interval between cut lines, cut background color, interval line Color, spacer line width, spacer rounded corner
4. Custom formatting style: use custom transparency gradient, use custom text size gradient, use custom text formatting
2. Some scroll wheel pop-ups were redone based on AndroidPicker.
- Select YearMonthDayPicker for the year, month and day, select HourMinuteSecondPicker for the hour, minute and second, and select DateTimePicker for the year, month, day, hour, minute and second.
- Select BirthdayPicker for year, month, day with text, select BirthdayWithTimePicker for year, month, day, hour, minute and second with text.
- Calendar selection made using CalendarView calendar component, beautiful style. CalendarPicker provides single selection, multiple selection, and range selection.
4. Single-item wheel selection OptionPicker, three-level linkage selection LinkagePicker, and list-style single-item selection OptionRecyclerViewPicker
- Single-select RadioPicker, multi-select CheckBoxPicker, prompt pop-up window TipsPicker, input pop-up window InputPicker
6. Address selection AddressPicker, ViewPager style address selection AddressViewPagerPicker, ViewPager style five-level selection
NetRequestPicker