michaelmuenzer / scrollablenumberpicker Goto Github PK
View Code? Open in Web Editor NEWEasy to use customizable number picker for Android mobile and tv
License: MIT License
Easy to use customizable number picker for Android mobile and tv
License: MIT License
I try to import ScrollableNumberPickerListener but get a 'is not public, Cannot be accessed outside package' message. I use version 0.2. I assume I need the listener to capture value changes
are you able to add functionality to use .setDisplayedValues
to set the values to a String[]
?
Is it possible to format the number? I want to use two pickers to change the value of a float. One for the part left of the point and one for the decimal part. And the decimal part should step from 00 to 95 with steps of 5.
I also would like to rotate, so when you plus on the max value you go to min value...
Aside from those "issues" I like the control!!!
Hi there!
Awesome idea this. I have a problem though. I am trying to set min, max and value through code but i keep getting Null Pointer Exception. When i set it in XML it works fine. This is what i try:
npYob.setValue(1971);
This is what i get:
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.michaelmuenzer.android.scrollablennumberpicker.ScrollableNumberPicker.setValue(int)' on a null object reference
How can I change the icons/arrow size (like android:background) via xml?
But jokes aside - it helps when name is not misleading.
Support to databinding will be great!
I had to create a DataAdapter to overcome this.
Publishing here if anyone needs
public class ScrollableNumberPickerBindingAdapters {
@BindingAdapter(value = "selectedValueAttrChanged")
public static void setListener(com.michaelmuenzer.android.scrollablennumberpicker.ScrollableNumberPicker picker, final InverseBindingListener listener) {
if (listener != null) {
picker.setListener(new ScrollableNumberPickerListener() {
@Override
public void onNumberPicked(int value) {
listener.onChange();
}
});
}
}
@BindingAdapter("selectedValue")
public static void setSelectedValue(com.michaelmuenzer.android.scrollablennumberpicker.ScrollableNumberPicker picker, int value) {
if (picker.getValue() != value) picker.setValue(value);
}
@InverseBindingAdapter(attribute = "selectedValue")
public static int getSelectedValue(com.michaelmuenzer.android.scrollablennumberpicker.ScrollableNumberPicker picker) {
return picker.getValue();
}
}
Usage:
<com.michaelmuenzer.android.scrollablennumberpicker.ScrollableNumberPicker
android:id="@+id/picker1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:selectedValue="@={item.Number}"
/>
Right now, the INVALID_RES
value is "-1" which means white cannot be used as a text color. It needs to be changed to something different to avoid the clash.
Is there any way to set fixed margin between the buttons and value? I don't like that the buttons move automatically when the number of digits is changed.
For example, if the current number is 9 and the user press on the increase icon, the buttons would move automatically because of the "valueMarginStart" "valueMarginEnd" values.
is it possible to change the icons size ? att
It would be nice if we can set a unit next to the number. Basically, i want to show multiple pickers that show different units for the same value.
<< 60 % >>
<< 50 px >>
Hi! I use create the component via Java and I need to change the color of the arrows and the text appearance (app:snp_value_text_appearance)
How can I do that ?
Thanks!
Hi,
can you please add a new feature like setTextSize for Text?
( ScrollableNumberPicker.java -> mValueTextView.setTextSize(30); )
Viele Grusse aus Dortmund
thanks
e. kaplaN
when long presss in button it will going counting up without stopping until the maximum value
Is it possible to attach a clicklistener to the view, and change de valeu on a dialog?
Text color is not getting changed
I have passed color in all possible different ways in xml :
numberpicker:snp_value_text_color="#fff"
numberpicker:snp_value_text_color="#ffffff"
numberpicker:snp_value_text_color="@android:color/white"
numberpicker:snp_value_text_color="@color/white"
could not set text color in java file
Salam.
How can we use this library to type number for large range?
For example for min:0 to max 2000, using buttons and scroll is difficult and we need to type number.
Hi! I placed in all drawable folder, two icons of 64 * 64 but in the app the size is the same whatever the icons files is placed
What I can I do if I want bigs icons on the selectors ?
Thanks a lot!
I just come up with this issue in the latest version,
single click doesn't work with this component, is there anyway, that where I can implement single click for my purpose?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.