Skip to content
🎑 WheelView like IOS, and other built in WheelView UIs.
Branch: master
Clone or download
#2 Compare This branch is 33 commits ahead, 8 commits behind brucetoo:master.
Latest commit c8a9c74 Mar 23, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app General Changes Feb 4, 2017
gradle/wrapper General project update Jan 25, 2017
materialwheelview General Changes Feb 4, 2017
.gitignore Remove .iml files Jan 26, 2017
README.md Update README.md Mar 23, 2017
build.gradle Added retrolambda Jan 26, 2017
gradle.properties Modify gradle.properties file to enable gradle daemon Jan 26, 2017
gradlew Initial commit Oct 15, 2015
gradlew.bat Initial commit Oct 15, 2015
settings.gradle Major change Jan 26, 2017

README.md

Material Wheel View

🎑 Prettier and simpler IOS like WheelView and other built-in WheelView UIs

License Android Arsenal

Installation

Gradle

  • Add it in your root build.gradle at the end of repositories:
repositories {
	maven { 
	    url "https://jitpack.io"
	}
}
  • Add the dependency:
dependencies {
    compile 'com.github.BlackBoxVision:material-wheel-view:v0.0.1'
}

Maven

  • Add the JitPack repository to your maven file.
<repository>
     <id>jitpack.io</id>
     <url>https://jitpack.io</url>
</repository>
  • Add the dependency in the form
<dependency>
    <groupId>com.github.BlackBoxVision</groupId>
    <artifactId>>material-wheel-view</artifactId>
    <version>v0.0.1</version>
</dependency>

SBT

  • Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
  • Add the dependency in the form:
libraryDependencies += "com.github.BlackBoxVision" % "material-wheel-view" % "v0.0.1"	

Usage example

In your layout.xml:

<io.blackbox_vision.wheelview.view.WheelView
	android:id="@+id/loop_view"
	android:layout_width="200dp"
	android:layout_height="180dp"
	app:canLoop="true"
	app:centerTextColor="#ff000000"
	app:drawItemCount="7"
	app:initPosition="3"
	app:lineColor="@color/colorPrimary"
	app:textSize="25sp"
	app:topBottomTextColor="#ffafafaf"/>

In your activity class:

@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
	setSupportActionBar(toolbar);

	final WheelView wheelView = (WheelView) findViewById(R.id.loop_view);

	wheelView.setInitPosition(2);
	wheelView.setCanLoop(false);
	wheelView.setLoopListener(item -> {});
	wheelView.setTextSize(12);
	wheelView.setItems(getList());
 }

Also, there is a built-in UI called DatePickerPopUpWindow, you can use it like these:

	findViewById(R.id.date).setOnClickListener(v -> {
   	final DatePickerPopUpWindow datePicker = new DatePickerPopUpWindow.Builder(getApplicationContext())
   		.setMinYear(1990)
   		.setMaxYear(2550)
   		.setSelectedDate("2013-11-11")
   		.setOnDateSelectedListener(this::onDateSelected)
   		.setConfirmButtonText("CONFIRM")
   		.setCancelButtonText("CANCEL")
   		.setConfirmButtonTextColor(Color.parseColor("#999999"))
   		.setCancelButtonTextColor(Color.parseColor("#009900"))
   		.setButtonTextSize(16)
   		.setViewTextSize(15)
   		.setShowDayMonthYear(true)
   		.build();

   	datePicker.show(this);
   });			

Issues

If you found a bug, or you have an answer, or whatever. Please, open an issue. I will do the best to fix it, or help you.

Contributing

Of course, if you see something that you want to upgrade from this library, or a bug that needs to be solved, PRs are welcome!

TODO

  • Custom DatePicker component based on WheelView
  • Custom TimePicker component based on WheelView
  • Custom DatePickerDialog based on DatePicker WheelView
  • Custom TimePickerDialog based on DatePicker WheelView
You can’t perform that action at this time.