Giter Site home page Giter Site logo

blazsolar / horizontalpicker Goto Github PK

View Code? Open in Web Editor NEW
228.0 228.0 81.0 576 KB

Android widget allowing user to select one item from set of them by swiping left and right.

Home Page: http://blaz.solar/HorizontalPicker

License: Apache License 2.0

Java 100.00%

horizontalpicker's People

Contributors

blazsolar avatar naweinberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

horizontalpicker's Issues

Support multi line text

Hi thanks for the awesome library. I just had a small requirement where I needed to have a single textView but in 2 lines. For eg:
17/8 18/8
45 23

Something like the above. But at the moment, I don't think the library supports this feature. Can you please let me know how to enable this?

java.lang.RuntimeException

In case of low memory there is a RuntimeException because of the incomplete parcelable SavedState

exception java.lang.RuntimeException
message Parcel android.os.Parcel@42c741b0: Unmarshalling unknown type code 3014765 at offset 240

the solution is to simply add these lines to the SavedState Class

public static class SavedState extends BaseSavedState {

        .....

        @SuppressWarnings("hiding")
        public static final Parcelable.Creator<SavedState> CREATOR
                = new Parcelable.Creator<SavedState>() {
            public SavedState createFromParcel(Parcel in) {
                return new SavedState(in);
            }

            public SavedState[] newArray(int size) {
                return new SavedState[size];
            }
        };

        private SavedState(Parcel in) {
            super(in);
            mSelItem = in.readInt();
        }
}

Errore java.lang.NullPointerException: Attempt to read from null array & Rendering Problems

Hi, i have this problem with your library

first problem with layout :

Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style 'horizontalPickerStyle' in current theme (2 similar errors not shown) onLayout error java.lang.NullPointerException   at com.wefika.horizontalpicker.HorizontalPicker.startMarqueeIfNeeded(HorizontalPicker.java:886)   at com.wefika.horizontalpicker.HorizontalPicker.calculateItemSize(HorizontalPicker.java:859)   at com.wefika.horizontalpicker.HorizontalPicker.onSizeChanged(HorizontalPicker.java:442)

and next problem

     java.lang.NullPointerException: Attempt to read from null array

but in my activity

    HorizontalPicker test = (HorizontalPicker) findViewById(R.id.testPicker);

    List<String> listItems = new ArrayList<String>();

    listItems.add("Item1");
    listItems.add("Item2");
    listItems.add("Item3");

    final CharSequence[] charSequenceItems = listItems.toArray(new CharSequence[listItems.size()]);

    test.setSideItems(charSequenceItems.length);
    test.setValues(charSequenceItems);

in the logcat :: Caused by: java.lang.NullPointerException: Attempt to read from null array

thanks

NullPointerException when "Over Scroll Never" Used

Setting "Over Scroll Never" means that mLeftEdgeEffect and mRightEdgeEffect are null.

In this condition, if you touch the scroller, you encounter a NPE at line 482/487. Just needs a null check added.

No divider shows up

No matter what values I put for picker:dividerSize or android:divder, no divider shows up. Is there something else I need to do?

Swipe directly leads on next or previous item

It'll be nice to have a mode for the HorizontalPicker where if the velocity of the swipe is huge, you don't scroll over 3,4,X items before stopping on an item far away but you only go to the next or the previous (swipe from left to right) item.

Change item background color depending on position

I have a picker with numbers, I need to segment the background in different colors depending on its value, for example: 1-5 red, 6-10 orange, 10-15 yellow.
How can I achieve this?

Thanks in advance

NullPointerException when adding values programmatically by setValues()

In your example I added a button which sets values to HorizontalPicker by setValues() method.
When it is clicked, app crashes with NullPointerException

java.lang.NullPointerException at android.text.BoringLayout.getLineStart(BoringLayout.java:345) at android.text.Layout.getLineEnd(Layout.java:1130) at android.text.Layout.getLineExtent(Layout.java:955) at android.text.Layout.getLineWidth(Layout.java:942) at com.wefika.horizontalpicker.HorizontalPicker.onDraw(HorizontalPicker.java:281) at android.view.View.draw(View.java:14486) at android.view.View.getDisplayList(View.java:13383) at android.view.View.getDisplayList(View.java:13425) at android.view.View.draw(View.java:14203) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.getDisplayList(View.java:13378) at android.view.View.getDisplayList(View.java:13425) at android.view.View.draw(View.java:14203) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.getDisplayList(View.java:13378) at android.view.View.getDisplayList(View.java:13425) at android.view.View.draw(View.java:14203) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.getDisplayList(View.java:13378) at android.view.View.getDisplayList(View.java:13425) at android.view.View.draw(View.java:14203) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.draw(View.java:14489) at android.widget.FrameLayout.draw(FrameLayout.java:472) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2327) at android.view.View.getDisplayList(View.java:13383) at android.view.View.getDisplayList(View.java:13425) at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1571) at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1450) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2281) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1892) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1005) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5750) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:544) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)

If HorizontalPicker had GONE visibility, and by button click I add values and then make it visible, it crashes with another exception.

java.lang.IllegalArgumentException: Layout: -8 < 0 at android.text.Layout.<init>(Layout.java:138) at android.text.Layout.<init>(Layout.java:114) at android.text.BoringLayout.<init>(BoringLayout.java:145) at com.wefika.horizontalpicker.HorizontalPicker.setValues(HorizontalPicker.java:698) at com.wefika.horizontalpicker.example.MainActivity$1.onClick(MainActivity.java:53) at android.view.View.performClick(View.java:4443) at android.view.View$PerformClick.run(View.java:18443) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)

Conflicts with scrollview

Hi, First off, I love this library, and it works really fantastic.
One thing I seem to notice is that it conflicts with androids scrollview.
The slider would not show up if it is wrapped inside a scrollview.
Is there a possible work around for this?

Thank you

endless scroll

Can i implement endless scroll for using this picker ?

Example -- > If i have three item in array, after selecting last one i should be able to see the first item after the 3rd one.

how show two lines value

i want to show two line for values. for example in first line i want to put a string and below it i want to put an integer. how can i do that?? tnx

Error:(167) Attribute "values" has already been defined

The library has a conflict with MultiStateToggleButton library and most probably any library which contains attribute with the name values

Error:(167) Attribute "values" has already been defined

<declare-styleable name="MultiStateToggleButton">
<attr format="reference" name="values"/>
</declare-styleable>

This can be easily solved by adding a library prefix (hp_) for all the attributes that might cause such issues.

FATAL EXCEPTION while setting overScrollMode=never

Hi,
I am using this library, and I don't want to show edges.
So I am setting "overScrollMode = never".
But app getting crashed. Please refer following logs.

Thanks.

E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EdgeEffect.onPull(float)' on a null object reference
at com.wefika.horizontalpicker.HorizontalPicker.onTouchEvent(HorizontalPicker.java:495)
at android.view.View.dispatchTouchEvent(View.java:9994)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.widget.ScrollView.dispatchTouchEvent(ScrollView.java:645)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2841)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2516)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2823)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1848)
at android.app.Activity.dispatchTouchEvent(Activity.java:3047)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:71)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2784)
at android.view.View.dispatchPointerEvent(View.java:10229)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5357)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5193)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4686)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4652)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4794)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4660)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4851)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4686)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4652)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4660)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4633)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7330)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7208)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7169)
at android.view

ArrayIndexOutOfBoundsException when setting sideItem

Hello,

I have some issues with the picker. My app is crashing everytime I set the side item and when I start to scroll or if the array has only one element. It's happening only in my phone, that's quite weird.
Furthermore, is it possible to change the text color of the middle item and not for all the elements?

Thanks!

capture d ecran 2016-05-09 a 12 16 33

No resource identifier found for attribute

Hi blazsolar,
I have a problem to use your nice library. I really need it.
I'm using android studio 1.3.
After import your library through gradle, I added your example code at xml.
When build my project, that error occurs.

Error:(43) No resource identifier found for attribute 'values' in package 'com.wefika.horizontalpicker'
Error:(43) No resource identifier found for attribute 'dividerSize' in package 'com.wefika.horizontalpicker'
Error:(43) No resource identifier found for attribute 'sideItems' in package 'com.wefika.horizontalpicker'

Is it still working xmlns:picker="http://schemas.android.com/apk/res/com.wefika.horizontalpicker"?
Please let me know how to solve this problem.

Thank you!

Error during project build

* Where:
Build file '/Users/vbauer/Documents/workspace/java/apkmaster/test/src/HorizontalPicker-master/HorizontalPicker/build.gradle' line: 7

* What went wrong:
A problem occurred evaluating project ':HorizontalPicker'.
> Failed to apply plugin [id 'com.android.library']
   > Could not create plugin of type 'LibraryPlugin'.

* Try:
Run with --debug option to get more log output.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating project ':HorizontalPicker'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$1.run(DefaultScriptPluginFactory.java:144)
    at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:72)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:149)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:510)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
    at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
    at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
    at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'com.android.library']
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:160)
    at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:112)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(DefaultObjectConfigurationAction.java:112)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:35)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:79)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:135)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:46)
    at org.gradle.api.plugins.PluginAware$apply.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:35)
    at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
    at build_azei5ywpm66ijzczw1m3q7gk6.run(/Users/vbauer/Documents/workspace/java/apkmaster/test/src/HorizontalPicker-master/HorizontalPicker/build.gradle:7)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
    ... 50 more
Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'LibraryPlugin'.
    at org.gradle.api.internal.plugins.DefaultPluginManager.instantiatePlugin(DefaultPluginManager.java:61)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:135)
    ... 61 more
Caused by: java.lang.RuntimeException: Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "e0509214c7872a9b0b902ecceaf8cc25bfd6ab0f"
    at com.android.build.gradle.BasePlugin.verifyRetirementAge(BasePlugin.java:226)
    at com.android.build.gradle.BasePlugin.<init>(BasePlugin.java:161)
    at com.android.build.gradle.LibraryPlugin.<init>(LibraryPlugin.groovy:47)
    at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:48)

Not working if put up in a Scroll View.

I am making a form where Horizontal Picker will be basic form of input. There are multiple entries in the form and therefore I need to put them in a ScrollView. But as soon I put it in ScrollView, none of the element show up. I tried doing nestedScrolling enabled, but no luck. Please help urgently.

Crashes on overscroll

My app is crashing when scrolling to the limits (end or to the start). Version 1.1.1.

Logcat is showing this Exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EdgeEffect.onAbsorb(int)' on a null object reference
                                                                                at com.wefika.horizontalpicker.HorizontalPicker.computeScrollX(HorizontalPicker.java:806)
                                                                                at com.wefika.horizontalpicker.HorizontalPicker.computeScroll(HorizontalPicker.java:629)

This is how I put HorizontalPicker in the layout:

<com.wefika.horizontalpicker.HorizontalPicker
                android:id="@+id/picker"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center_vertical"
                android:marqueeRepeatLimit="-1"
                android:overScrollMode="never"
                android:ellipsize="marquee"
                android:layout_marginLeft="1dp"
                android:layout_marginRight="1dp"
                android:textColor="@android:color/black"
                android:textSize="18dp"
                />

And this is how I initialize it in my Activity:

String[] values = new String[160+1];
        for (int i = 0; i <= 160; i++) {
            values[i] = String.valueOf(i);
        }

        picker = (HorizontalPicker) findViewById(R.id.picker);
        picker.setOnItemClickedListener(this);
        picker.setOnItemSelectedListener(this);
        picker.setValues(values);
        picker.setSideItems(3);

What am I doing wrong?
Thanks in advance

Callbacks must add text or a content description in populateNodeForVirtualViewId()

Hi, may I know is this project no longer maintained?
Currently I found that it crashes in lots of Android 7.0/ 7.1.1 and some of Android 6.0 / 5.0 devices.
This may be a core library bugs in Android system which you have used.

The crash message is hard to read and untraceable.
Callbacks must add text or a content description in populateNodeForVirtualViewId()

I have googled, datePicker is a known bug in ALL Samsung Android 5.0 devices, but now it happens in Android 7.0 or above.

Null pointer on mTextColor

When I try to open an activity that has the HorizontalPicker included I get the following error:

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.res.ColorStateList.getDefaultColor()' on a null object reference
            at com.wefika.horizontalpicker.HorizontalPicker.getTextColor(HorizontalPicker.java:424)
            at com.wefika.horizontalpicker.HorizontalPicker.onDraw(HorizontalPicker.java:262)

I think it has something to do with using a custom style, but I don't know why exactly. It seems mTextColor is never set.

Null Pointer Exception

I've got one picker on the activity that when selected, populates another picker with values that depend on the selected item from the first picker.

second picker is defined as follows:

<com.wefika.horizontalpicker.HorizontalPicker
    xmlns:picker="http://schemas.android.com/apk/res/com.wefika.horizontalpicker"
    android:id="@+id/prod_category_picker"
    android:textColor="@color/light_gray"
    android:layout_below="@+id/prod_type_picker"
    android:layout_height="40dp"
    android:layout_width="match_parent"
    android:background="@color/slider_background"
    android:textSize="14sp"
    android:ellipsize="none"
    android:marqueeRepeatLimit="-1"
    android:visibility="gone"
    />

When I select an item in the first picker, intermittantly, I get this:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.RectF.set(android.graphics.RectF)' on a null object reference
        at com.wefika.horizontalpicker.HorizontalPicker.onDraw(HorizontalPicker.java:293)

I have not been able to figure out what sequence of events triggers this crash. Any thoughts?

Dynamically sized elements.

screenshot 2015-03-13 13 21 37

Is there a way to have the picker dynamically size the view that each option is in, instead of needing the ellipse?

Yeah, I know this would be an enhancement... thoughts?

Continue scroll/slide even with finger exits view bounds

This is something similar to how a browser's bottom / up scroll works while using a mouse. Hovering over the actual scrollbar to slide up & down is not required. The scroll bar can be caught and dragged up & down even with the mouse diagonally. The control stays with the mouse until the button is released. Similarly, while the MotionEvent.ACTION_MOVE event is fired, & the user leaves the bounds of the view, the view should keep scrolling until MotionEvent.ACTION_UP is registered.

I hope I was clear enough in the explanation. I'll post a small GIF if you want me to elucidate further.

Rendering Problems Missing styles. Is the correct theme chosen for this layout?

Failed to find style 'horizontalPickerStyle' in current theme (2 similar errors not shown) Couldn't resolve resource @dimen/textSize (2 similar errors not shown) java.lang.NumberFormatException: Color value '@color/textColor' must start with #   at com.android.layoutlib.bridge.impl.ResourceHelper.getColor(ResourceHelper.java:79)   at android.content.res.BridgeTypedArray.getColorStateList(BridgeTypedArray.java:372)   at com.wefika.horizontalpicker.HorizontalPicker.(HorizontalPicker.java:162)   at com.wefika.horizontalpicker.HorizontalPicker.(HorizontalPicker.java:140)

I traced the problem on textColor = a.getColorStateList(R.styleable.HorizontalPicker_android_textColor);

It says here that R.styleable was already removed: http://stackoverflow.com/questions/1717489/android-hello-gallery-tutorial-r-styleable-cannot-be-resolved

text is being cropped for numeric text

Hello @blazsolar ,
I am using your awesome library for one of my project . Its working just perfect for my need , but I cant handle the width of the item for numeric text for(10....17) but it works fine for text(0-9) . here is the screenshot of the problem . Please let me know which modification should be done to fix this
first
secoend

Boring Layouts do not show up when placed inside a ScrollView

The BoringLayout does not show up when the HorizontalPicker view is placed inside a ScrollView. It works flawlessly when the same is implemented elsewhere though. There's no exception thrown, and there are no call backs triggered when items are selected.

Null pointer exception when parent view became visible

My app has a RelativeLayout as a parent of HorizontalPicker. It has INVIZIBLE or GONE visibility value at application startup.
When I make RelativeLayout visible in my application, app crashes with Null Pointer exception .
Is it a bug or I am doing something wrong?

java.lang.NullPointerException at com.wefika.horizontalpicker.HorizontalPicker.remakeLayout(HorizontalPicker.java:382) at com.wefika.horizontalpicker.HorizontalPicker.calculateItemSize(HorizontalPicker.java:863) at com.wefika.horizontalpicker.HorizontalPicker.onSizeChanged(HorizontalPicker.java:452) at android.view.View.sizeChange(View.java:14953) at android.view.View.setFrame(View.java:14926) at android.view.View.layout(View.java:14834) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055) at android.view.View.layout(View.java:14838) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14838) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1043) at android.view.View.layout(View.java:14838) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14838) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14838) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14838) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14838) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14838) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1996) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1753) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1005) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5750) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:544) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)

BTW, I am adding values programmatically by setValues() method.

Change color of selected item

I don't know where to look since there is not much documentation, but how do I change the color of the item that is selected (or change the color of hte unset items)

Right now every item is the same color and the end user might not now which item is selected

Text Typeface

Nice library!

Any way to change the typeface of the picker?

Thanks.

Invisibility problem with android 4.0.4 Tablet

HorizontalPicker is not visible in the screen however when i touched the screen where HorizontalPicker suppose to be onItemClicked and onItemSelected methods are called. When i run it on Android L (Nexus 4) it is visible.

Round item

Hello!!

How could I give this style to the horizontal picker?
image

I want round items instead rectangle ones. I this posible? thank you so much!!

Null Pointer Exception

When trying to implement this, it throws the following null pointer during run time (omitting everything not within this package):
"java.lang.NullPointerException
at com.wefika.horizontalpicker.HorizontalPicker.startMarqueeIfNeeded(HorizontalPicker.java:876)
at com.wefika.horizontalpicker.HorizontalPicker.calculateItemSize(HorizontalPicker.java:853)
at com.wefika.horizontalpicker.HorizontalPicker.onSizeChanged(HorizontalPicker.java:441)"

My code is as follows:
togithub

where "WheelNums" is:

togithub2

Also, I'm using version 1.0.1

I'm not sure if this is my fault or not, but feel free to correct me if it is!

PS - I believe your front page should read "xmlns:picker="http://schemas.android.com/apk/lib/com.wefika.horizontalpicker" " rather than "xmlns:picker="http://schemas.android.com/apk/res/com.wefika.horizontalpicker" " (lib vs res).

Thanks!

  • Alex

how increase number of items

How to increase number of items from 3 to 4 at a time in scroller and how to implement this code under
scrollView

Bug

Unable to display on LG Nexus5 phone.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.