0

In my android app, I have a checkbox layout which will be slide up and down from the center of screen.Though I'm using Object Animator When I check true to Check box, the check box layout moves down and if I uncheck the layout should move up. My Issue is check box moves down when I select it. But I can't select the checkbox when it is down. Instead if I click on the center(i.e previous checkbox position) it slides up to center. So It moves only the View part, not listener part. I'm using following code to animate

Checkbox Layout view

mChkView = findViewById(R.id.chkbx_layout_id);

Animator code

ObjectAnimator.ofFloat(mChkView, "translationY", 0, 60).setDuration(0).start();

I have found several answers in stack over flow as listed :

Answer Link1

Answer Link2

Answer Link3

Answer Link4

But none of the answer helps me.

Community
  • 1
  • 1
RajeshVijayakumar
  • 10,281
  • 11
  • 57
  • 84

1 Answers1

0

Try this

ObjectAnimator mover = ObjectAnimator.ofFloat(aniView,
              "translationX", -500f, 0f);
          mover.setDuration(2000);

-500f and 0f are the float value of the position from and to . Set these two value according to your need.

Hope this helps.

Shubham
  • 1,442
  • 3
  • 16
  • 34