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

any view from inc/dec button #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

akaGelo
Copy link

@akaGelo akaGelo commented Jun 19, 2019

I wanted to use the AppCompatImageButton for inc/dec buttons. This caused the

java.lang.ClassCastException: android.support.v7.widget.AppCompatImageButton cannot be cast to android.widget.Button

@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can rename this file as ic_subtract instead? Because the button's purpose is to subtracting, not removing the number.

Or maybe it's better if the name follows the views ids as below:

  • ic_add.xml -> ic_increment.xml
  • ic_remove.xml -> ic_decrement.xml

numberpicker:min="0"
numberpicker:unit="1"
numberpicker:value="-5" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it create an error? Because the min value is 0 but you set a negative number (below 0) as the value.

numberpicker:unit="1"
numberpicker:custom_layout="@layout/number_picker_custom_layout" />
numberpicker:value="-5" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@hendrawd
Copy link

@travijuu IMHO this is a good improvement since it will increase the flexibility of the library.

@hendrawd
Copy link

This PR will solve #4

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

Successfully merging this pull request may close these issues.

2 participants