Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Working When used without xml #47

Open
sandeep-singh-91 opened this issue Apr 25, 2017 · 3 comments
Open

Not Working When used without xml #47

sandeep-singh-91 opened this issue Apr 25, 2017 · 3 comments

Comments

@sandeep-singh-91
Copy link

sandeep-singh-91 commented Apr 25, 2017

I've used this code to implement this in my project.

     WheelView wheelView = new WheelView(this);
       wheelView.setWheelItemRadius(30);
       wheelView.setWheelItemCount(10);
       wheelView.setWheelRadius(120);
      wheelView.setRepeatableAdapter(true);
      wheelView.setWheelOffsetY(60);
      wheelView.setSelectionAngle(90);
      wheelView.setWheelColor(Color.parseColor("#ff0000"));
      wheelView.setWheelItemTransformer(new SimpleItemTransformer());
      wheelView.setWheelSelectionTransformer(new FadingSelectionTransformer());
      wheelView.setLayoutParams(new            RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    wheelView.setWheelDrawableRotatable(false);

    wheelView.setAdapter(new WheelAdapter() {
        @Override
        public Drawable getDrawable(int position) {
            //return drawable here - the position can be seen in the gifs above

            return new TextDrawable("A" + position);
        }

        @Override
        public int getCount() {
            //return the count
            return 10;
        }
    });

      rl.addView(wheelView);`

and this is the output I've got

device-2017-04-24-140527

@mostafa1368
Copy link

This is my problem too !

@mostafa1368
Copy link

mostafa1368 commented Sep 15, 2017

this error does not correctly execute the following code.
wheelview.class
if (mWheelToItemDistance == ViewGroup.LayoutParams.MATCH_PARENT) {
mWheelToItemDistance = (int) (mWheelBounds.mRadius - mItemRadius - mWheelPadding);
}

@LukeDeighton
Copy link
Owner

To be honest I never tried it without XML, I'd happily accept a PR if you figure this out. I can help with any questions.

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

No branches or pull requests

3 participants