Skip to content

any view from inc/dec button#17

Open
akaGelo wants to merge 1 commit intotravijuu:masterfrom
akaGelo:master
Open

any view from inc/dec button#17
akaGelo wants to merge 1 commit intotravijuu:masterfrom
akaGelo:master

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:max="10"
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:min="0"
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