travijuu / numberpicker Goto Github PK
View Code? Open in Web Editor NEWA simple customizable NumberPicker plugin for Android
License: MIT License
A simple customizable NumberPicker plugin for Android
License: MIT License
i have used this library for number selection from one range to another range.I want to listen to value changed listener in my fragment,so that i can enable and disable proceed button.
Hi ,
I'm trying to create the numberpicker programmatically and append it to a Relativeview but that's not working it's just adding a red linearlayout (background red) but no edittext or button.
It is not possible to write one ValueChangedListener class that handles multiple NumberPickers because the valueChanged method does not contain the event origin as property.
code:
NumberPicker numberPicker = new NumberPicker(opcionais.getContext());
numberPicker.setValue(itens.get(i).quantidade);
Error:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setText(java.lang.CharSequence)' on a null object reference
at com.travijuu.numberpicker.library.NumberPicker.refresh(NumberPicker.java:113)
at com.travijuu.numberpicker.library.NumberPicker.setValue(NumberPicker.java:155)
can i do long press the + and speed increase the value?
Hello Sir,
How to get click event of - button and +button. Unable to get clickListener of that button.
Thanks in advance.
Thanks & Regards,
Santosh Pardeshi
on a few devices, if we add number picker to a layout. the whole screen background becomes black. even if I used android:background to the main layout still, it's not working. you can check this on nexus4 device
I have used this library but If I edit the field manually I cant able to get the data from it
Right now the library only supports Button
elements for increment and decrement.
disable click for some time after click on-increment or decrement
Hours I'm searching for solutions.. please where is the problem ?
android.view.InflateException: Binary XML file line #93: Binary XML file line #93: Error inflating class com.travijuu.numberpicker.library.NumberPicker Caused by: android.view.InflateException: Binary XML file line #93: Error inflating class com.travijuu.numberpicker.library.NumberPicker Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:647) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.rInflate(LayoutInflater.java:863) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
Hi travijuu, thanks for this plugin!
Is possible to set more than one picker in the same layout? In my test I encountered that the ids of number_picker_custom_layout.xml (decrement, display and increment) overlap when I do setValue programatically, so the last setValue apply to all of the pickers. Exist any way to do that?
Hello, when i used custom layout it only works with double click in increment or decrement, any help please?
HI travijuu sir, thanks for such custom NumberPicker.
I have query regarding valueChanged method. I want to change remaining values on NumberPicker value changed but not changes dynamically instead it logs correctly. what I already tried posted below but this not working also with limitExceeded method. Plz! give some guidance... Thanks in Advance!
@Override public void valueChanged(int value, ActionEnum action) {
String actionText = action == ActionEnum.MANUAL ? "manually set" : (action == ActionEnum.INCREMENT ? "incremented" : "decremented");
String message = String.format("NumberPicker is %s to %d", actionText, value);
Log.v(this.getClass().getSimpleName(), message);
if (Objects.equals(actionText, "incremented")) {
int s = numberPicker.getValue();
int x = max - s;
textViewPending.setText(String.valueOf(x));
}
}
i got error message like this when try your lib, how to fix it? thanks
java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to android.widget.EditText
at com.travijuu.numberpicker.library.NumberPicker.initialize(NumberPicker.java:90)
at com.travijuu.numberpicker.library.NumberPicker.(NumberPicker.java:59)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:475)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:262)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:220)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:334)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:345)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:245)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Hi
I'm maintaining an app that supports back to Android SDK 9 (we actually just dropped 8 for our current release a couple of months back). I was looking for a compact non-fancy number picker that we could use. However you've got minSdkVersion set to 16 even though it doesn't seem necessary from a short glance at the code (I actually recompiled with minSdkVersion 9 and tested on a real 2.3 device without problems).
Any chance you would consider lowering minSdkVersion ? I'm trying to avoid forking/rolling my own.
Thanks
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.