Giter Site home page Giter Site logo

material-wheel-view's Introduction

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

material-wheel-view's People

Contributors

brucetoo avatar pedrofsn avatar

Watchers

James Cloos avatar Mohammed Rampurawala avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.