Secondly the dependency of this library currently used:
implementation 'io.github.controlwear:virtualjoystick:1.10.1'
The problem
It appears that when calling .resetButtonPosition on a JoystickView as such:
joystickView.resetButtonPosition();
It does not in fact reset the position.
How it is being used
Right now I am calling the reset button position method through an onClick of a different onscreen button. Essentially what it aims to do is that when one joystick has the auto recenter button set to false the button exists to be able to basically "reset it" back to center. But this does not work.
I am using this method to set autoReCenter to false:
joystickView.setAutoReCenterButton(isSticky);
Where "isSticky" is just a boolean that is confirmed to be toggling correctly from true/false as it does in fact change the joystick behaviour accordingly.
I have noticed that the behaviour of the joystick does not change onClick unless the setOnMoveListener is re-instantiated and perhaps that can be cause of the issues.
Full code example
JoystickView rightJoystick = findViewById(R.id.rightJoystick);
Button autoRecenterButton = findViewById(R.id.joystick_sticky);
autoRecenterButton.setOnClickListener(new View.OnClickListener() {
boolean isSticky = false;
@Override
public void onClick(View v) {
isSticky = !isSticky;
// This works correctly
rightJoystick.setAutoReCenterButton(isSticky);
// This does not appear to work correctly
rightJoystick.resetButtonPosition();
// A new listener needs to be set when button was toggled
// in order to change the auto recenter behaviour
rightJoystick.setOnMoveListener((angle, strength) -> {
// do joystick things
}, 25);
}
});
Desired outcome
For the other on screen button to toggle whether or not the joystick is sticky but then if doing from "non-sticky" to "sticky" it needs to also reset the position of the joystick back to center.
Firstly some basic information about the App Gradle setup:
Secondly the dependency of this library currently used:
implementation 'io.github.controlwear:virtualjoystick:1.10.1'
The problem
It appears that when calling .resetButtonPosition on a JoystickView as such:
joystickView.resetButtonPosition();
It does not in fact reset the position.
How it is being used
Right now I am calling the reset button position method through an onClick of a different onscreen button. Essentially what it aims to do is that when one joystick has the auto recenter button set to false the button exists to be able to basically "reset it" back to center. But this does not work.
I am using this method to set autoReCenter to false:
joystickView.setAutoReCenterButton(isSticky);
Where "isSticky" is just a boolean that is confirmed to be toggling correctly from true/false as it does in fact change the joystick behaviour accordingly.I have noticed that the behaviour of the joystick does not change onClick unless the setOnMoveListener is re-instantiated and perhaps that can be cause of the issues.
Full code example
Desired outcome
For the other on screen button to toggle whether or not the joystick is sticky but then if doing from "non-sticky" to "sticky" it needs to also reset the position of the joystick back to center.