Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customisable bottom-left button? #26

Open
jackunderwood93 opened this issue Jun 27, 2017 · 3 comments
Open

Customisable bottom-left button? #26

jackunderwood93 opened this issue Jun 27, 2017 · 3 comments

Comments

@jackunderwood93
Copy link

Hi Phillip,

Any chance if you implementing a customisable button for the bottom-left of the Number Pad? I'd love to use it as a All-Day button in the calendar app I'm building, so ideally I'd prefer it if text or a icon can be placed there.

Would submit a pull request for it but am unsure of if/how you'd want it implemented.

@philliphsu
Copy link
Owner

I think the need for such a button is application specific, and not general enough to be offered in the library. i.e. is an extra button in the time picker a convenience that solves a common enough problem for developers?

You're welcome to make a fork and implement this however you wish. Or you can take the relevant source code and modify it as needed for your app. Let me know if you have any questions.

@Lx
Copy link

Lx commented Nov 17, 2017

@jackunderwood93, this particular button is known as the “neutral button” in the Android framework.

@philliphsu, a third button has existed on AlertDialogs (and therefore Android date and time picker dialogs) since the very first version of Android. Please consider changing your position on this issue.

@philliphsu
Copy link
Owner

philliphsu commented Dec 13, 2017

@Lx Late response, but I thought I'd try addressing this anyway. Unfortunately, I'm hesitant to add new features in this library. I made some novice design decisions on top of legacy AOSP code in the making of this library. In hindsight, the design of the existing AOSP code was not SOLID. As such, I feel the current state of the codebase cannot facilitate the addition of new features such as neutral buttons and the client APIs required for them.

However, I released a new library called NumberPadTimePicker about six months ago which offers the same number pad time picker as in this library, but it was completely rewritten to be much more SOLID. As such, I consider this library's implementation of the number pad time picker to be deprecated. The widget is provided as a standalone View instead of coupled to a DialogFragment as in this library. This gives you more flexibility in use cases, because now you can add the widget to your own layouts and customize it as you wish. So if you would like to add a neutral button to the number pad, perhaps you can inflate an instance of NumberPadTimePicker inside of a standard Android AlertDialog and set the neutral button there.

@jackunderwood93 You may have implemented your own solution already, but take a look at this library in the future.

https://github.com/philliphsu/NumberPadTimePicker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants