question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Positive button / Today button

See original GitHub issue

Am I missing something? Setting the current date as the selected one in code, the date picker opens with the OK button disabled. So the user has to select another date and return to the current one, in order to accept it.

Here is my (Kotlin) code:

            val builder = DatePickerBuilder(this, listener)
                    .maximumDate(Calendar.getInstance())
                    .date(Calendar.getInstance())
                    .pickerType(CalendarView.ONE_DAY_PICKER)
                    .headerColor(R.color.colorPrimary)
                    .selectionColor(R.color.colorPrimary)

            val datePicker = builder.build()
            datePicker.show()

Also, the today button seems to be broken. It does not move the selection to the current date. Shouldn’t it?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
nkanellopouloscommented, May 3, 2019

@kormateusz Well, I tried that and it did not work. And by looking at the code, I don’t think it should make a difference. This seems weird.

DatePicker.java:49

setOkButtonState(mCalendarProperties.getCalendarType() == CalendarView.ONE_DAY_PICKER);

So, if the Calendar is ONE_DAY_PICKER (as in my case), OK should be enabled. But it is not…

0reactions
Afurcommented, Nov 5, 2020

@shuklaalok7 Please checkout ONE DAY PICKER (DIALOG) in our sample project the “ok” button seems working fine with latest version of library

Read more comments on GitHub >

github_iconTop Results From Across the Web

Positive Buttons - Etsy
Check out our positive buttons selection for the very best in unique or custom, handmade pieces from our pins & pinback buttons ......
Read more >
Daily Positivity Talking Button - Says 50 Positive Quotes ...
Be proud of everything you have achieved today; Embrace the positivity in life and fill your thoughts with joy and happiness; Believe in...
Read more >
Think Positive Button – Press Here For Motivational Sounds!
BUY HERE: https://www.dealgenius.com/think- positive - button -press-here-for-motivational-soundsEver wish there was a ... Today is your day!;
Read more >
Positive Thinking Buttons & Pins - No Minimum Quantity - Zazzle
Put a pin in it with a Positive Thinking button at Zazzle! Button pins that really stand out with thousands of ... Create...
Read more >
Positive and Negative Button position on a DialogFragment
Try like this: builder.setMessage(R.string.dialog_fire_missiles) .setPositiveButton() .setNeutralButton() .setNegativeButton().
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found