Date Spinner Picker Dialog
- Show date picker with spinner style
- Fully Customizable style
You can do :
- a pull request, or
- raise a an issue ticket, or
- request additional feature by raise a ticket.
Minimum Android SDK Version 16
Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.anggastudio:SpinnerPickerDialog:2.0.0'
}
Step 1.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Step 2. Add the dependency
<dependency>
<groupId>com.github.anggastudio</groupId>
<artifactId>SpinnerPickerDialog</artifactId>
<version>2.0.0</version>
</dependency>
- Show default date picker dialog like this:
final SpinnerPickerDialog spinnerPickerDialog = new SpinnerPickerDialog();
spinnerPickerDialog.setContext(this);
spinnerPickerDialog.setOnDialogListener(new SpinnerPickerDialog.OnDialogListener() {
@Override
public void onSetDate(int month, int day, int year) {
// " (Month selected is 0 indexed {0 == January})"
}
@Override
public void onCancel() {
}
@Override
public void onDismiss() {
}
});
spinnerPickerDialog.show(this.getSupportFragmentManager(), "");
- Show fully customizable date picker dialog like this (green color):
Calendar maxCalendar = Calendar.getInstance();
maxCalendar.add(Calendar.YEAR, -MAX_YEAR);
final SpinnerPickerDialog spinnerPickerDialog = new SpinnerPickerDialog();
spinnerPickerDialog.setContext(this);
spinnerPickerDialog.setMaxCalendar(maxCalendar);
spinnerPickerDialog.setAllColor(ContextCompat.getColor(this, android.R.color.holo_green_dark));
spinnerPickerDialog.setmTextColor(Color.BLACK);
spinnerPickerDialog.setArrowButton(true);
spinnerPickerDialog.setOnDialogListener(new SpinnerPickerDialog.OnDialogListener() {
@Override
public void onSetDate(int month, int day, int year) {
// " (Month selected is 0 indexed {0 == January})"
}
@Override
public void onCancel() {
}
@Override
public void onDismiss() {
}
});
spinnerPickerDialog.show(this.getSupportFragmentManager(), "");