Range-Time-Picker-Dialog
Simple Android Library that provide you a custom dialog that allow you to set a start time and end time.
Screenshot
:-------------------------
Install
Add this to your project build.gradle
Add this to your module build.gradle
Usage
In your activity (Default method "newInstance()"):
You can instantiate the dialog with more parameters:
To read parameter from Dialog your activity have to implements the interface ISelectedTime:
Then you have to override the method "onSelectedTime":
In your fragment:
When you have to read parameter provided by Dialog you have to override onResultActivity in your fragment:
Methods
setColorTabUnselected(int colorTabUnselected)
: Set color of tab item when it is unselectedsetColorTabSelected(int colorTabSelected)
: Set color of tab item when it is selectedsetColorTextButton(int colorTextButton)
: Set button text colorsetColorBackgroundHeader(int colorBackgroundHeader)
: Set background color of header dialogsetIs24HourView(boolean is24HourView)
: Set true if you want see time into 24 hour formatsetMessageErrorRangeTime(String messageErrorRangeTime)
: Set message error that appears when you select a end time greater than start time (only if "validateRange" is true)setTextBtnPositive(String textBtnPositive)
: Set positive button textsetTextBtnNegative(String textBtnNegative)
: Set negative button textsetRadiusDialog(int radiusDialog)
: Set dialog radius (default is 50)setTextTabStart(String textTabStart)
: Set tab start textsetTextTabEnd(String textTabEnd)
: Set tab end textsetValidateRange(boolean validateRange)
:Set true if you want validate the range time (start time < end time). Set false if you want select any timesetColorBackgroundTimePickerHeader(int colorBackgroundTimePickerHeader)
: Set background color of header timePicker