I'm trying to setup a "sliding button", I want my button(button1), to slide left on click on it, but Android Studio shows me the message:
mButtonTranslator = 'this' is not available
The inherent code is this below:
mButtonTranslator = ValueAnimator.ofInt(0,90);
mButtonTranslator.addUpdateListener((animatedValue)->{
float distanceTraveled = (float)animatedValue.getAnimatedValue();
button1.setTranslationX(distanceTraveled);
});
Can someone help me?