-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat(android): enable to hide specific controls #4183
feat(android): enable to hide specific controls #4183
Conversation
43c0240
to
2c05358
Compare
if (controlsConfig.getHidePlayPause()) { | ||
playPauseControlContainer.setAlpha(0); | ||
|
||
playButton.setClickable(false); | ||
pauseButton.setClickable(false); | ||
} else { | ||
playPauseControlContainer.setAlpha(1.0f); | ||
|
||
playButton.setClickable(true); | ||
pauseButton.setClickable(true); | ||
} | ||
|
||
final ImageButton forwardButton = playerControlView.findViewById(R.id.exo_ffwd); | ||
if (controlsConfig.getHideForward()) { | ||
forwardButton.setImageAlpha(0); | ||
forwardButton.setClickable(false); | ||
} else { | ||
forwardButton.setImageAlpha(255); | ||
forwardButton.setClickable(true); | ||
} | ||
|
||
final ImageButton rewindButton = playerControlView.findViewById(R.id.exo_rew); | ||
if (controlsConfig.getHideRewind()) { | ||
rewindButton.setImageAlpha(0); | ||
rewindButton.setClickable(false); | ||
} else { | ||
rewindButton.setImageAlpha(255); | ||
rewindButton.setClickable(true); | ||
} | ||
|
||
final ImageButton nextButton = playerControlView.findViewById(R.id.exo_next); | ||
if (controlsConfig.getHideNext()) { | ||
nextButton.setClickable(false); | ||
nextButton.setImageAlpha(0); | ||
} else { | ||
nextButton.setImageAlpha(255); | ||
nextButton.setClickable(true); | ||
} | ||
|
||
final ImageButton previousButton = playerControlView.findViewById(R.id.exo_prev); | ||
if (controlsConfig.getHidePrevious()) { | ||
previousButton.setImageAlpha(0); | ||
previousButton.setClickable(false); | ||
} else { | ||
previousButton.setImageAlpha(255); | ||
previousButton.setClickable(true); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setVisibility doesn't work correctly for these items
hidePlayPause?: WithDefault<boolean, false>; | ||
hideForward?: WithDefault<boolean, false>; | ||
hideRewind?: WithDefault<boolean, false>; | ||
hideNext?: WithDefault<boolean, false>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the next and previous buttons should be hidden by default, they are always displayed but never usable 🤔 @KrzysztofMoch @seyedmostafahasani what are your point of views ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with hiding the previous and next buttons by default. However, I don't understand why we would allow the user to hide the play and pause buttons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Background videos - it is just an option
I wonder if the next and previous buttons should be hidden by default
I agree we can hide them by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seyedmostafahasani depending of UI requierements, it make sense (live content, or not pausable video , why not :) )
@moskalakamil can you just change hideNext and hidePrevious to true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@freeboub
Thank you for the explanation.
@moskalakamil
Thank you for creating this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Job @moskalakamil!
Summary
Create new feature which allow user to hide specific controls on android devices
Closes #3193
Motivation
#3193
Changes
update function to allow hide more controls
Test plan