Top Related Projects
:slot_machine: The android library that provides a simple and customizable NumberPicker.
A custom SeekBar on Android, which can be changed the size ,color , thumb drawable , tick drawable , tick text and indicator , also , will show an indicator view with progress above SeekBar when seeking. https://github.com/warkiz/IndicatorSeekBar
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments
Quick Overview
AigeStudio/WheelPicker is an Android library that provides a customizable wheel picker widget. It allows users to create scrollable, circular-style pickers for selecting items from a list, similar to those found in iOS date pickers or time selectors.
Pros
- Highly customizable appearance and behavior
- Smooth scrolling and animation
- Supports both vertical and horizontal orientations
- Compatible with RecyclerView for efficient item rendering
Cons
- Limited documentation and examples
- Not actively maintained (last update was in 2018)
- May require additional effort to integrate with modern Android development practices
- Some reported issues with item selection accuracy
Code Examples
- Basic WheelPicker setup:
val wheelPicker = findViewById<WheelPicker>(R.id.wheel_picker)
wheelPicker.data = listOf("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")
wheelPicker.setOnItemSelectedListener { picker, data, position ->
Toast.makeText(this, "Selected: $data", Toast.LENGTH_SHORT).show()
}
- Customizing WheelPicker appearance:
wheelPicker.apply {
visibleItemCount = 5
isCyclic = true
selectedItemTextColor = Color.BLUE
itemTextColor = Color.BLACK
itemTextSize = 20f
curtainColor = Color.LTGRAY
curtainAlpha = 0.8f
}
- Using WheelPicker with custom item layout:
wheelPicker.apply {
itemResourceId = R.layout.custom_wheel_item
itemBindListener = { itemView, item ->
itemView.findViewById<TextView>(R.id.item_text).text = item.toString()
}
}
Getting Started
To use WheelPicker in your Android project:
- Add the JitPack repository to your project's
build.gradle
:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency to your app's
build.gradle
:
dependencies {
implementation 'com.github.AigeStudio:WheelPicker:1.1.2'
}
- Add the WheelPicker to your layout XML:
<com.aigestudio.wheelpicker.WheelPicker
android:id="@+id/wheel_picker"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
- Initialize and use the WheelPicker in your Activity or Fragment as shown in the code examples above.
Competitor Comparisons
:slot_machine: The android library that provides a simple and customizable NumberPicker.
Pros of NumberPicker
- Simpler implementation with fewer dependencies
- More customizable appearance options (e.g., text color, divider color)
- Better support for different input types (e.g., integers, floats)
Cons of NumberPicker
- Less visually appealing default design compared to WheelPicker
- Limited to vertical scrolling only, while WheelPicker supports both vertical and horizontal
Code Comparison
NumberPicker:
<com.shawnlin.numberpicker.NumberPicker
android:id="@+id/number_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:np_width="64dp"
app:np_height="180dp"
app:np_dividerColor="@color/colorPrimary"
app:np_max="59"
app:np_min="0"
app:np_textColor="@color/colorPrimary"
app:np_textSize="18sp"
app:np_value="3" />
WheelPicker:
<com.aigestudio.wheelpicker.WheelPicker
android:id="@+id/wheel_picker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:wheel_atmospheric="true"
app:wheel_curved="true"
app:wheel_item_text_size="20sp"
app:wheel_selected_item_text_color="@color/colorAccent" />
Both libraries offer easy-to-use number picker components for Android applications. NumberPicker provides more customization options and simpler implementation, while WheelPicker offers a more visually appealing default design with support for both vertical and horizontal scrolling.
A custom SeekBar on Android, which can be changed the size ,color , thumb drawable , tick drawable , tick text and indicator , also , will show an indicator view with progress above SeekBar when seeking. https://github.com/warkiz/IndicatorSeekBar
Pros of IndicatorSeekBar
- More customizable appearance with various styles and indicators
- Supports both continuous and discrete progress
- Offers bidirectional seek functionality
Cons of IndicatorSeekBar
- Limited to linear seek bar functionality
- May have a steeper learning curve due to more configuration options
- Less suitable for scenarios requiring circular or wheel-like selection
Code Comparison
WheelPicker:
WheelPicker wheelPicker = findViewById(R.id.wheel_picker);
wheelPicker.setData(Arrays.asList("Item 1", "Item 2", "Item 3"));
wheelPicker.setOnItemSelectedListener(new WheelPicker.OnItemSelectedListener() {
@Override
public void onItemSelected(WheelPicker picker, Object data, int position) {
// Handle selection
}
});
IndicatorSeekBar:
IndicatorSeekBar seekBar = findViewById(R.id.indicator_seek_bar);
seekBar.setProgress(50);
seekBar.setOnSeekChangeListener(new OnSeekChangeListener() {
@Override
public void onSeeking(SeekParams seekParams) {
// Handle seeking
}
// Other methods...
});
Both libraries offer easy-to-use APIs for their respective functionalities. WheelPicker focuses on circular selection, while IndicatorSeekBar provides a highly customizable linear seek bar with additional features like indicators and tick marks.
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html
Pros of Material-BottomNavigation
- Implements Material Design bottom navigation component
- Supports badges and custom views
- Offers smooth animations and transitions
Cons of Material-BottomNavigation
- Limited to bottom navigation functionality
- May require additional setup for complex customizations
- Less flexible for non-navigation use cases
Code Comparison
WheelPicker:
WheelPicker wheelPicker = findViewById(R.id.wheel_picker);
wheelPicker.setData(Arrays.asList("Item 1", "Item 2", "Item 3"));
wheelPicker.setOnItemSelectedListener(new WheelPicker.OnItemSelectedListener() {
@Override
public void onItemSelected(WheelPicker picker, Object data, int position) {
// Handle item selection
}
});
Material-BottomNavigation:
BottomNavigation bottomNavigation = findViewById(R.id.bottom_navigation);
bottomNavigation.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(@NonNull MenuItem item) {
// Handle menu item click
return true;
}
});
While WheelPicker focuses on providing a customizable wheel-style picker for various data types, Material-BottomNavigation specializes in implementing a Material Design bottom navigation bar. WheelPicker offers more flexibility for different selection scenarios, whereas Material-BottomNavigation is tailored specifically for navigation purposes in Android applications.
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)
Pros of Android-PickerView
- More comprehensive and feature-rich, offering a wider range of picker types
- Better documentation and examples, making it easier for developers to implement
- Larger community and more frequent updates, ensuring better support and maintenance
Cons of Android-PickerView
- Heavier library with more dependencies, potentially increasing app size
- Steeper learning curve due to more complex API and configuration options
- Less customizable in terms of visual appearance compared to WheelPicker
Code Comparison
WheelPicker:
WheelPicker wheelPicker = findViewById(R.id.wheel_picker);
wheelPicker.setData(Arrays.asList("Item 1", "Item 2", "Item 3"));
wheelPicker.setOnItemSelectedListener(new WheelPicker.OnItemSelectedListener() {
@Override
public void onItemSelected(WheelPicker picker, Object data, int position) {
// Handle selection
}
});
Android-PickerView:
OptionsPickerView<String> pvOptions = new OptionsPickerBuilder(this, new OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
// Handle selection
}
}).build();
pvOptions.setPicker(Arrays.asList("Item 1", "Item 2", "Item 3"));
pvOptions.show();
Both libraries offer similar functionality, but Android-PickerView provides more options and a more structured approach to building and displaying pickers. WheelPicker, on the other hand, offers a simpler API for basic picker functionality.
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments
Pros of android-betterpickers
- Offers a wider variety of picker types (date, time, number, recurrence, etc.)
- More customizable appearance with built-in themes and styles
- Better integration with Android's Material Design guidelines
Cons of android-betterpickers
- Larger library size due to more features, potentially increasing app size
- Steeper learning curve for developers due to more complex API
- Less frequent updates and maintenance compared to WheelPicker
Code Comparison
WheelPicker:
WheelPicker wheelPicker = findViewById(R.id.wheel_picker);
wheelPicker.setData(Arrays.asList("Item 1", "Item 2", "Item 3"));
wheelPicker.setOnItemSelectedListener(new WheelPicker.OnItemSelectedListener() {
@Override
public void onItemSelected(WheelPicker picker, Object data, int position) {
// Handle selection
}
});
android-betterpickers:
NumberPickerBuilder npb = new NumberPickerBuilder()
.setFragmentManager(getSupportFragmentManager())
.setStyleResId(R.style.BetterPickersDialogFragment)
.setTargetFragment(MyFragment.this, 0)
.setReference(REFERENCE_NUMBER_PICKER)
.setOnDismissListener(this);
npb.show();
The code comparison shows that WheelPicker has a simpler API for basic usage, while android-betterpickers requires more setup but offers more customization options.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Overview
![Size](https://img.shields.io/badge/Size-17 KB-e91e63.svg)
Contact
Preview
Demo
Include
Compile
compile 'cn.aigestudio.wheelpicker:WheelPicker:1.1.3'
or
<dependency>
<groupId>cn.aigestudio.wheelpicker</groupId>
<artifactId>WheelPicker</artifactId>
<version>1.1.3</version>
<type>pom</type>
</dependency>
or
<dependency org='cn.aigestudio.wheelpicker' name='WheelPicker' rev='1.1.3'>
<artifact name='$AID' ext='pom'></artifact>
</dependency>
Import aar
Import Module
1.Import moudle WheelPicker in your project.
2.Add module like below in your settings.gradle file of project:
include ':YourMoudle',':WheelPicker'
Notably, in some version of gradle you need to add module single line:
include ':WheelPicker'
click the "sycn now" when it appear on the top-right of IDE window.
3.Compile project like below in the dependencies in your build.gradle file of application module:
compile project(':WheelPicker')
Usage
Versions
1.0.0 beta
- Preview for WheelPicker and support few function.
1.0.1 beta
- BugFix:Cache in WheelCuredPicker can not clean...a stupid mistake.
1.0.2 beta
- BugFix:MotionEvent lost when point outside of view in WheelCurvedPicker
1.0.3 beta
- BugFix:Error parameter after scroll using setXXX method
1.1.0 Stable
- Refactor project fix all known bug and some function additions
- I will create a tag for old beta version but not be updated anymore
- éæ项ç®åå¸ç¨³å®çä¿®å¤æµè¯çææBUG以åæ°å¢åè½
- Betaçæ¬ä¼æä¸TAGæ¹ä¾¿èçæ¬è¿æ¸¡ä½ä¸åæ´æ°
1.1.1
- BugFix:Scroll automatically when touch but not move on WheelPicker in some low resolution phone
- BugFix:Scroll range incorrect when invoke setData twice and set data source's length less than last
- BugFix:Wheel state do not refresh when invoke setData twice and set data source's length-1 less than last selected position
- BugFix:Switch between click and scroll event
- BugFix:Call OnItemSelectedListener more time when user want to scroll continuously
- BugFix:Scroll range incorrect when set current selected item again
- BugFix:Scroll will be triggered when click WheelPicker
- Function:All the parameters of WheelPicker will be reset when you setData
- ADD WheelYearPicker, WheelMonthPicker, WheelDayPicker
- ADD WheelDatePicker
- ä¿®å¤æäºä½å辨çææºè§¦æ¸ä¸å¨æ¶èªæ»å¨é®é¢
- ä¿®å¤ç¬¬äºæ¬¡è°ç¨setData设置é¿åº¦æ¯ä¸æ¬¡å°çæ°æ®æ¶æ»å¨èå´ä¸æ¹åçé®é¢
- ä¿®å¤ç¬¬äºæ¬¡è°ç¨setData设置é¿åº¦ä½ç½®å°äºä¸æ¬¡éä¸ä½ç½®æ¶æ»è½®ç¶æä¸å·æ°é®é¢
- ä¿®å¤ç¹å»ä¸æ»å¨äºä»¶åæ¢çé®é¢
- ä¿®å¤å½ç¨æ·æ³è¿ç»æ»å¨æ¶åºç°å¤æ¬¡åè°çé®é¢
- ä¿®å¤éæ°è®¾ç½®éæ©çæ°æ®é¡¹ä½ç½®åæ»å¨èå´éä½é®é¢
- ä¿®å¤ç¹å»å触åæ»å¨çé®é¢
- éæ°è®¾ç½®æ°æ®æºåä¼éç½®æ»è½®éæ©å¨ç¸å ³åæ°
- æ°å¢å¹´ä»½ãæ份ãæ¥æéæ©å¨
- æ°å¢ä¸çº§èå¨çæ¥æéæ©å¨
1.1.2
- BugFix:WheelPicker can not get the height in some layout
- Support Android Nougat
1.1.3
- BugFix:Divide by zero
Function
- Data display circulation
- Set visible item count
- Get the current item data straight in stationary
- Monitor status of scroll get selected item data and other parameter when wheel stop
- Dynamic update data
- Set text color of selected or non-selected item
- Set item space
- Support display indicator and set the indicator's size and color
- Support display curtain and set the curtain's color
- Enable atmospheric effect
- Enable perspective effect
- Curl the items base on mathematic models
- Support item align when perspective or atmospheric enable
- 循ç¯æ¾ç¤ºæ°æ®é¡¹
- 设置å¯è§æ°æ®é¡¹æ¡æ°
- å¨æ»è½®éæ¢ç¶æç´æ¥è·åéä¸æ°æ®é¡¹
- æ»å¨çå¬è·åæ»è½®åæ¢åéä¸é¡¹ä»¥åæ»å¨å项åæ°
- å¨ææ´æ°æ°æ®æº
- 设置å½åéä¸é¡¹ææ¬é¢è²åééä¸é¡¹ææ¬é¢è²
- 设置æ°æ®é¡¹ä¹é´é´é
- æ¯æç»å¶æ示å¨ä»¥åæå®æ示å¨é¢è²ã尺寸
- æ¯æç»å¶å¹å¸ä»¥åæå®å¹å¸é¢è²
- å¯å¼å¯æ°æ®é¡¹ç©ºæ°æ模æ
- å¯å¼å¯æ°æ®é¡¹æ¨¡æçå®éè§ææ
- æ ¹æ®ä¸¥æ ¼æ°å¦å»ºæ¨¡æ¨¡ææ»è½®å¼¯æ²ææ
- å¨å¼å¯éè§æ弯æ²ææåæ¯æ让æ°æ®é¡¹å·¦å³å¯¹é½
Widgets
WheelDatePicker
Method
- setVisibleItemCount
- setCyclic
- setSelectedItemTextColor
- setItemTextColor
- setItemTextSize
- setItemSpace
- setIndicator
- setIndicatorColor
- setIndicatorSize
- setCurtain
- setCurtainColor
- setAtmospheric
- setCurved
- setItemAlignYear
- setItemAlignDay
- setYearFrame
- setSelectedYear
- setSelectedMonth
- setSelectedDay
- etc...
WheelYearPicker
Method
- All method of WheelPicker
- setYearFrame
- set/getYearStart
- set/getYearEnd
- set/getSelectedYear
- getCurrentYear
WheelMonthPicker
Method
- All method of WheelPicker
- set/getSelectedMonth
- getCurrentMonth
WheelDayPicker
Method
- All method of WheelPicker
- set/getSelectedDay
- getCurrentDay
- setYearAndMonth
- set/getYear
- set/getMonth
WheelAreaPicker
ä¸å½è¡æ¿åºåååæ ¹æ®å½å®¶ç»è®¡å±ææ°æ°æ®å½å®¶ç»è®¡å±è¡æ¿åºååå
Donation
å¦ææ¨è§å¾è¯¥é¡¹ç®å¸®å©äºæ¨é£ä¸å¦¨èµå°å¼ä¸æ¯åå¡é± :)
You can support the project and thank the author for his hard work :)
- PayPal:xiaoaibaby@vip.qq.com
LICENSE
Copyright 2015-2017 AigeStudio
Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Top Related Projects
:slot_machine: The android library that provides a simple and customizable NumberPicker.
A custom SeekBar on Android, which can be changed the size ,color , thumb drawable , tick drawable , tick text and indicator , also , will show an indicator view with progress above SeekBar when seeking. https://github.com/warkiz/IndicatorSeekBar
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot