Git Product home page Git Product logo

android-spinnerwheel's People

Contributors

ai212983 avatar gabrieleceranto avatar harrio avatar jiechic avatar jitpack-io avatar marsoft avatar nallwhy avatar pmarnik avatar xavler-s 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  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

android-spinnerwheel's Issues

Library adds unwanted permission READ_PHONE_STATE

Due to the lack of min and targetSdkVersion definition in AndroindManifest.xml the library adds the unwanted permission to apps during the build process.

Here is the debug output of merging Manifests:

android:uses-permission#android.permission.READ_PHONE_STATE
IMPLIED from AndroidManifest.xml:2:1 reason: antistatic.spinnerwheel has a targetSdkVersion < 4

Manual change of current number

Hi,

this library is really good job! Looks and feels very nice.

I was thinking that would be nice to provide possibility for user to enter the value in the wheel manually using keyboard. NumberPicker in Android SDK allows to double click on it and shows keyboard for user to provide a number.

That would be a great feature.

Kind regards, Konrad

Allow different sizes for items

The project description specifies this:

Please watch out when specifying layout for items - they should have fixed size.

If you try to do this the produced vies do not align properly.

Is there a deeper underlying reason for this or is it just convenience?
If there is no reason I would love if the library gets improved for different item sizes.

Define increments

Hi, is it possible to increment the wheel on a predefined amount?

For example, instead of 1,2,3... if I define increments: 5, it should show 5, 10, 15..

This is a really useful component, hopefully development keeps on

Implement spinnerwheel styling

Implement styling following features:

  • Number of visible elements and item offset (ITEM_OFFSET_PERCENT)
  • Separator drawables
  • Separator alpha for dimming and bright states
  • Item padding
  • Inactive wheel dimming alpha
  • Widget background drawable

I am not able to get selected date in horizontalView ?

AbstractWheel wheelHorizontalView1 = (AbstractWheel) findViewById(R.id.wheelHorizontalView1);
NumericWheelAdapter minAdapter = new NumericWheelAdapter(this, 1, 15,
"%01d");
minAdapter.setItemResource(R.layout.wheel_text_centered_dark_back);
minAdapter.setItemTextResource(R.id.text);
wheelHorizontalView1.setViewAdapter(minAdapter);

I added this, Now how to get selected text.

Please, refer to this question,
http://stackoverflow.com/questions/29886579/how-to-get-selected-text-using-android-spinner-wheel

WheelHorizontalView - Individual tab drawable

I would to like to set the individual tab width and height in WheelHorizontalView. And set that tab to a drawable that support selected/pressed states.

I've this done in ViewPagerIndicator (with vpiTabPageIndicatorStyle) but I can't do it here. (This is how I've done it with vpiTabPageIndicatorStyle: http://pastebin.com/wB4vGMyJ)

What I've tried is to change the selectionDivider to this drawable:

<?xml version="1.0" encoding="utf-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:drawable="@drawable/drawable_daychooser_item_pressed" />
    <item android:state_selected="true" android:drawable="@drawable/drawable_daychooser_item_selected" />
    <item android:drawable="@drawable/drawable_daychooser_item_default" />
</selector>

But that's not working. I've look into wheel__attrs.xml but I could not find an other attribute that has as format an drawable (reference).

This is how it's now:
before

And this is how I want it:
after

If you're wondering why I've switch from ViewPagerIndicator to android-spinnerwheel see here: http://stackoverflow.com/questions/19764866/viewpagerindicator-set-the-tabpageindicator-to-the-center

I really appreciate any help you can provide. ๐Ÿ‘

How to change selected item??

Hi!
Thanks for a great wheelwidget! Looking forward to see the new version coming up!

I have a wheel constructed in onCreate like this:

final AbstractWheel BpmWheel = (AbstractWheel) findViewById(R.id.bpmWheel);
final NumericWheelAdapter bpmAdapter = new NumericWheelAdapter(this, 10, 300, "%02d");
bpmAdapter.setItemResource(R.layout.wheel_text_centered2);
bpmAdapter.setItemTextResource(R.id.text);
BpmWheel.setViewAdapter(bpmAdapter);
BpmWheel.setCurrentItem(pos);

How can I change the pos outside the onCreate??
I am trying to call BpmWheel.setCurrentItem(pos) in another method but AndroidStudio mark it like error...

Sorry if this is a dumb question....I am rather new at programming.

Bug when changing adapter data

I created an WheelAdapter with 5 item array 'x', after i set array 'y' with 3 items , the view is showing 4 items, the last item is from array 'x'.

x => ["a", "b", "c", "d", "e"]
y => ["1", "2", "3"]

final result in view ["1", "2", "3", "d"], and "d" is not selectable

How to add "<" ... ">" after scrolling (like in Android 4)

Hello

I'd like to ask, if its easy to modify the wheel that it looks like in Android 4 before/after scrolling?
e.g.
no scrolling: < 6 |7| 8 >
while scrolling: 4 5 |6| 7 8

I would thank you for a small hint, what to modify where. I look in the AbstractWheel and AbstractWheelView but I couldn't solve it on my own.

But anyway. A great lib!

Cheers
FelixGroup

Compiling the demo?

Hello!

I tried to compile the demo and get several errors.
What I have done:

  1. check out the git in Eclipse.
  2. Used "new android project from source" to setup the two different projects ("library" and "antistatic.spinnerwheel.demo.WheelDemo")
  3. The library itself compiles without any problem.
  4. The demo gives me some problems: Using 1.6 as target I have and error with "res\values-v11\styles.xml".
    4.1 After setting the target to 3.0 I got other failures:
    4.1.1 all settings regarding spinnerwheel (for example app:visibleItems app:selectionDivider and app:selectionDividerWidth)
    in the layout files are unknown. After deleting them from the layout files I could compile, but at runtime I got errors.

So. What do I have to do? My guess is xmlns:app="http://schemas.android.com/apk/res/antistatic.spinnerwheel.demo" in the layout files. But change them to what?

edit:
After copying "wheel__attrs.xml" from library project into demo project most problems turn to green.

Wrong behaviour of WheelHorizontalView filled with long length strings

Hello :)

please can you fix behaviour of WheelHorizontalView when it is filled with strings that are long? (Like 10 - 30 chars).

It is just all wrong, spinning doesn't work correctly, highlighting of current item is wrong etc etc.

But otherwise awesome widget, thanks for it :)
Bye

About license of this project

It seems that there is no license specified in this project.
I would like to use this project for an android app but i can use it only when it have a license.
So would you add a license like Apache 2.0 / MIT

java.lang.IllegalArgumentException: width and height must be > 0 in AbstractWheelView.recreateAssets

If i set abstractWheel.setCurrentItem(0), I am getting the above error.

07-26 14:39:23.702: W/System.err(23974): java.lang.IllegalArgumentException: width and height must be > 0
07-26 14:39:23.702: W/System.err(23974): at android.graphics.Bitmap.createBitmap(Bitmap.java:638)
07-26 14:39:23.702: W/System.err(23974): at android.graphics.Bitmap.createBitmap(Bitmap.java:620)
07-26 14:39:23.702: W/System.err(23974): at antistatic.spinnerwheel.AbstractWheelView.recreateAssets(AbstractWheelView.java:185)
07-26 14:39:23.712: W/System.err(23974): at antistatic.spinnerwheel.AbstractWheel.onLayout(AbstractWheel.java:457)
07-26 14:39:23.712: W/System.err(23974): at android.view.View.layout(View.java:13856)
07-26 14:39:23.712: W/System.err(23974): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
07-26 14:39:23.712: W/System.err(23974): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1644)
07-26 14:39:23.712: W/System.err(23974): at android.widget.LinearLayout.onLayout(LinearLayout.java:1428)
07-26 14:39:23.712: W/System.err(23974): at android.view.View.layout(View.java:13856)
07-26 14:39:23.712: W/System.err(23974): at android.view.ViewGroup.layout(ViewGroup.java:4424)
07-26 14:39:23.712: W/System.err(23974): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
07-26 14:39:23.722: W/System.err(23974): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)
07-26 14:39:23.722: W/System.err(23974): at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)
07-26 14:39:23.722: W/System.err(23974): at android.view.View.layout(View.java:13856)
07-26 14:39:23.722: W/System.err(23974): at android.view.ViewGroup.layout(ViewGroup.java:4424)
07-26 14:39:23.722: W/System.err(23974): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
07-26 14:39:23.732: W/System.err(23974): at android.view.View.layout(View.java:13856)
07-26 14:39:23.732: W/System.err(23974): at android.view.ViewGroup.layout(ViewGroup.java:4424)
07-26 14:39:23.732: W/System.err(23974): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
07-26 14:39:23.732: W/System.err(23974): at android.view.View.layout(View.java:13856)
07-26 14:39:23.732: W/System.err(23974): at android.view.ViewGroup.layout(ViewGroup.java:4424)
07-26 14:39:23.732: W/System.err(23974): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
07-26 14:39:23.732: W/System.err(23974): at android.view.View.layout(View.java:13856)
07-26 14:39:23.742: W/System.err(23974): at android.view.ViewGroup.layout(ViewGroup.java:4424)
07-26 14:39:23.742: W/System.err(23974): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1992)
07-26 14:39:23.742: W/System.err(23974): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1813)
07-26 14:39:23.742: W/System.err(23974): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1113)
07-26 14:39:23.742: W/System.err(23974): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4481)
07-26 14:39:23.742: W/System.err(23974): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
07-26 14:39:23.742: W/System.err(23974): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
07-26 14:39:23.742: W/System.err(23974): at android.view.Choreographer.doFrame(Choreographer.java:525)
07-26 14:39:23.742: W/System.err(23974): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)

cannot resolve Gradle dependency

Hi!
I added the gradle dependency as - compile 'com.github.ai212983:android-spinnerwheel:bba368d940' but it doesn't seems to work, it gives a "Failed to resolve error"

Please do help with the issue, Thanks!

Click listener on current item

I am not able to add a click listener on item in a vertical wheel.. I mean: I want to implement a spinner wheel in which some items are clickable and others not. When the users scroll on the right item they also confirm their choice by clicking on the item. When they confirm, the view pager automatically swype on the Summary section.
Not all the items are clickable, this is clickable:
image
This is not clickable:
image

I tried to add a click listener on my custom item but it doesn't work. I tried also to use OnWheelClickedListener but it is not for the current item but for the others..

The library is well documented but I find nothing that can help me, how could I do?

setVisibleItems not working as expected

Hi, First I want to Thank you for such a nice library for Spinner wheel view.
The problem I am facing while implementing is, when I set VisibleItems to 5 on WheelVerticalView , I am able to see 5 items when the view is in scrolling mode. As soon as the scroll finishes, I again see 3 items , rest of the items are not visible.

Right now the wheel view is like this
what_iam_getting

and I want to be like this,i.e, 5 items should be visible
what_i_want

Can you please help me on this, where I am going wrong ?

Call Listeners

How to call Listeners for WheelHorizontalView like OnWheelChangedListener???
I m not able to do so..

Wrong behavior of horizontal wheel in list view

When I have list of WheelHorizontalView I'm expecting that when I touch it and move up, scroll view will return control to list view, because horizontal view can't scroll themself vertical

Rewrite demo app

Remove unused features, add missing. We need to demo the following functionality:

  • Programmatically spin wheel to certain value (and select without spinning animation)
  • Work with custom and regular views (date spinner with 'today' indication)
  • Horizontal spinner
  • Repopulating data

Set starting value

Hi Guys,

Just wondering is it possible to set a start value for the NumericWheelAdapter using a hour_horizontal layout?

I have a range of values from -100 to 100 and would like to set the starting position of the wheel at 0, would this be possible?

Eclipse

how to use this library in my project in eclipse. I tried by adding the jar files to the libs folder and then and then added to the build path but i could not access the classes in my main activity.

Using as Library in Eclipse

Hi, im having a issue with this project in eclipse.
I import the project via (android: import existing code into workplace) but when I try to add the project as a library to my dependent project it doesn't appear under ( properties -> android -> Libraries -> Add ).
How do I correctly use this as a library in my project?

Any help is appreciated.

Thanks

WheelHorizontalView onClick selected item

I'm using OnWheelClickedListener on WheelHorizontalView, the item before and after the current item is getting clicked but the current one isn't, below is what I mean, what should I do ?
The reason I'm looking for this is because I'm trying to open another activity when the wheel is clicked

before | current | after

When I click before or after I get the the index of each one, but when I click the "current" I only get the debuggin stuff you are doing on WheelHorizontalView on line 210

public class TimePickerCustomViewsActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.time_picker_custom);

    final AbstractWheel wheel = (AbstractWheel) findViewById(R.id.ampm);
    wheel.addClickingListener(click);
    ArrayWheelAdapter<String> ampmAdapter = new ArrayWheelAdapter<String>(
            this, new String[] { "01", "02", "03" });
    ampmAdapter.setItemResource(R.layout.wheel_text_centered);
    ampmAdapter.setItemTextResource(R.id.text);

    wheel.setViewAdapter(ampmAdapter);
    wheel.addClickingListener(click);
    wheel.addScrollingListener(scrolledListener);
    wheel.setCyclic(true);
    wheel.setInterpolator(new AnticipateOvershootInterpolator());
}

OnWheelScrollListener scrolledListener = new OnWheelScrollListener() {
    public void onScrollingStarted(AbstractWheel wheel) {
        Log.i("TAG", "onScrollingStarted");

    }

    public void onScrollingFinished(AbstractWheel wheel) {
        Log.i("TAG", "onScrollingFinished "
                + getWheel(R.id.ampm).getCurrentItem());

    }
};

OnWheelClickedListener click = new OnWheelClickedListener() {
    public void onItemClicked(AbstractWheel wheel, int itemIndex) {
        Log.i("TAG", "onItemClicked " + itemIndex);

    }
};

private AbstractWheel getWheel(int id) {
    return (AbstractWheel) findViewById(id);
}

}

Add library to Maven central

This library would be a great addition to mavencentral so Android studio (Gradle) users can just add something like
"compile 'antistatic:spinnerwheel:+' " to their gradle file. This will increases ease of use and popularity of this library.

I found a guide which shows you how to do that. Im not doing it myself because I don't own the library but I'd really appreciate it if you publish it to maven.

Url to the guide:
http://www.survivingwithandroid.com/2014/05/android-guide-to-publish-aar-to-maven-gradle.html

WheelHorizontalView select on click

Is there a click event for the WheelHorizontalView?

For example when I click on day 17 in "Time picker with custom views" nothing happens. I want if I click on day 17 that day 17 is selected.

(In "Time picker" is it working)

Nevermind, I found it:

        OnWheelClickedListener click = new OnWheelClickedListener() {
            public void onItemClicked(AbstractWheel wheel, int itemIndex) {
                hours.setCurrentItem(itemIndex, true);
            }
        };
        hours.addClickingListener(click);

Change name in .project file

When the project is checked out into Eclipse, it is named "library," which is not very helpful. The "name" attribute in the .project file could be changed to something like "android-spinnerwheel"

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.