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

How to use Tap in Android? #546

Closed
gibo77 opened this issue Oct 20, 2023 · 2 comments
Closed

How to use Tap in Android? #546

gibo77 opened this issue Oct 20, 2023 · 2 comments
Labels
platform: Android Issue related to Android platform question Further information is requested requires: author feedback Item requires some author's action

Comments

@gibo77
Copy link

gibo77 commented Oct 20, 2023

Ask your Question

Tapping the slider to change the value works with iOS, but not in Android.
This is in the documentation called tapToSeek.
How can I make that work in Android by tapping?

''
' '
Brightness: {SliderBrightness} %



{'\n'}OFF


<Slider
style={styles.SliderMargin}
step={1}
disabled={!isEnabled} //If Glowing is activated, the Slider could not be changed.
// tapToSeek={true}
minimumTrackTintColor="#307ecc"
maximumTrackTintColor="#000000"
maximumValue={100}
minimumValue={0}
value={SliderBrightness} //Updates on real time. Excellent.
onSlidingComplete={val => {
// console.log('OnSlidingComplete: ',SliderBrightness);
ChangeBrightnessHappened = true;
//setSliderBrightness(val);
Gibo_Fetch('IGBT=' + val + '&Angga=' + ESPSerialNum);
}}
onValueChange={val => setSliderBrightness(val)}
/>


{'\n'}ON




Slider at 0 value will turn OFF the light. 100 will turn ON. Tap the
track to move the slider. If Dimming is active, Brightness can't be
moved.


@gibo77 gibo77 added the question Further information is requested label Oct 20, 2023
@BartoszKlonowski
Copy link
Member

Hello @gibo77, thanks for reaching out!
The tapToSeek prop is only for iOS, because for Android, Windows and Web the tapping works out-of-the-box, by default, without any extra props or configuration.
Can you post any GIF of video presenting the issue with tapping on Android that you observe?

@BartoszKlonowski BartoszKlonowski added platform: Android Issue related to Android platform requires: author feedback Item requires some author's action labels Oct 20, 2023
@BartoszKlonowski BartoszKlonowski added this to To be analyzed in Slider-Board via automation Oct 20, 2023
@BartoszKlonowski BartoszKlonowski moved this from To be analyzed to Backlog in Slider-Board Oct 20, 2023
@gibo77
Copy link
Author

gibo77 commented Oct 20, 2023

Hi Team,
I was able to get a solution on my issue. Since I couldn't make the useState work inside the "OnFinishSliding", I just created my own function or callback and pass the val, as such FuncSlider(val).
In the callback function I was able to update my variable SliderBrightness by equaling it to val, so that when I return back to home page I have the correct val data.

This val parameter is not in the documentation. I just found out about it somewhere in an example by chance. It would be nice to have it in documentation.

@gibo77 gibo77 closed this as completed Oct 20, 2023
Slider-Board automation moved this from Backlog to Done Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Android Issue related to Android platform question Further information is requested requires: author feedback Item requires some author's action
Projects
Slider-Board
  
Done
Development

No branches or pull requests

2 participants