szugyi / Android-CircleMenu

Menu with items on a rotating circle
Other
298 stars 112 forks source link

Getting Wrong id of items #56

Open adimobiletech opened 5 years ago

adimobiletech commented 5 years ago

I rotated the circle_layout with below code

RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(10000);
    rotate.setInterpolator(new LinearInterpolator());
    rotate.setRepeatCount(Animation.INFINITE);
    com.szugyi.circlemenu.view.CircleLayout  image= (com.szugyi.circlemenu.view.CircleLayout)findViewById(R.id.circle_layout);
    image.startAnimation(rotate);

Now when I click on items they show toasts of different items id ,click is getting wrong in this scenario .

szugyi commented 5 years ago

You should not rotate the CircleLayout that way. All you are doing is rotating the ViewGroup itself. To rotate the items you must animate the angle property of the view via the setAngle method.