android-datepicker

datepicker value from edittext using Retrofit post request

烂漫一生 提交于 2020-07-31 04:16:10
问题 im using retrofit post request method to post date from edittext(date retrieved from datepicker)...when i select date from datepicker and select date on it..it is displaying right date on edittext...but when i submit and check on postman it is showing wrong date.. need help thanks following is my code: val myCalendar: Calendar = Calendar.getInstance() val edittext1 = findViewById(R.id.dob) as EditText val date = OnDateSetListener { view, year, monthOfYear, dayOfMonth -> // TODO Auto-generated

MaterialDatePicker shows current date instead of needed

匆匆过客 提交于 2020-07-14 09:46:30
问题 Using MaterialDatePicker I want to show required date and give an opportunity to select another. But when a DatePicker appears it shows current date instead of specified. I plug the library: implementation 'com.google.android.material:material:1.2.0-alpha06' (or 1.1.0). Then override AppTheme in styles.xml : <style name="AppTheme" parent="Theme.MaterialComponents.Light"> And now can show DatePicker. val now = Calendar.getInstance() now[Calendar.YEAR] = 2020 now[Calendar.MONTH] = 10 now

Material Date Picker Custom Styling

孤人 提交于 2020-07-06 16:08:32
问题 i have used range date picker from google material with this library implementation 'com.google.android.material:material:1.2.0-alpha02' this is my code MaterialDatePicker.Builder<Pair<Long, Long>> builder = MaterialDatePicker.Builder.dateRangePicker(); CalendarConstraints.Builder constraintsBuilder = new CalendarConstraints.Builder(); builder.setCalendarConstraints(constraintsBuilder.build()); MaterialDatePicker<Pair<Long,Long>> picker = builder.build(); assert getFragmentManager() != null;

How to disable past dates in MaterialDatePicker?

十年热恋 提交于 2020-07-03 10:20:55
问题 //Material Date Picker private val calendar = Calendar.getInstance() private val constraintsBuilder = CalendarConstraints.Builder().setStart(calendar.timeInMillis) private val builder = MaterialDatePicker.Builder.datePicker() private val picker = builder .setSelection(calendar.timeInMillis) .setInputMode(MaterialDatePicker.INPUT_MODE_CALENDAR) .setCalendarConstraints(constraintsBuilder.build()) .build() I am using above code to open calendar setSelection method select current date and

How to change Theme of “MaterialDatePicker” in Android?

北慕城南 提交于 2020-06-26 14:38:53
问题 I've used MaterialDatePicker for the purpose of selecting a single date & also I had achieved that task but I cannot change the theme of the header & button. MaterialDatePicker.Builder builder; MaterialDatePicker materialDatePicker; long today = MaterialDatePicker.todayInUtcMilliseconds(); CalendarConstraints.Builder con = new CalendarConstraints.Builder(); con.setValidator(DateValidatorPointForward.now()); builder.setSelection(today); builder.setCalendarConstraints(con.build());

onDateSet isn't getting called in android 5.1.1

无人久伴 提交于 2020-04-18 05:46:32
问题 I have a date picker dialog which works perfectly on android 9 and android 10, I decided to test on android 5.1.1, and after selecting a date, nothing happens, the onDateSet() doesn't fire up, I've read at least 10 articles on SO that refer to similar problems, but can't find a working solution Here's my code, maybe someone could point out what i'm doing wrong DateDialog.java public class DateDialog extends DialogFragment { DatePickerDialog.OnDateSetListener mOnDateSetListener; public static

Implementing New styled date&time-pickers from android

 ̄綄美尐妖づ 提交于 2020-02-25 13:55:55
问题 I was going through android official blog site here:: I found out new type of date and time pickers showcased in android Questions :: I am familiar with implementing old styled widgets, but how to implement this new widgets Any samplecode on how to implement this styled widgets Minimum level API required to implement these styles 回答1: Q1.Ans now its Library available see this thanks to @derekbrameyer https://github.com/derekbrameyer/android-betterpickers and live preview on play see https:/

Implementing New styled date&time-pickers from android

风流意气都作罢 提交于 2020-02-25 13:54:35
问题 I was going through android official blog site here:: I found out new type of date and time pickers showcased in android Questions :: I am familiar with implementing old styled widgets, but how to implement this new widgets Any samplecode on how to implement this styled widgets Minimum level API required to implement these styles 回答1: Q1.Ans now its Library available see this thanks to @derekbrameyer https://github.com/derekbrameyer/android-betterpickers and live preview on play see https:/