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

[TIMOB-16080] Removes (Annoying) touch sound that are on EVERY view. #5373

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,10 @@ protected void registerForTouch(final View touchable)
boolean clickable = true;
if (proxy.hasProperty(TiC.PROPERTY_TOUCH_ENABLED)) {
clickable = TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_TOUCH_ENABLED), true);
//If touchEnabled is specifically set, enable or disable touch sound
touchable.setSoundEffectsEnabled(clickable);
} else {
touchable.setSoundEffectsEnabled(false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By making this change, it would change the default (native) behavior. I'm good with deactivating the sound when touches are not enabled, but it shouldn't change the default behavior. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. The default behavior of TI is that touch sounds are enabled on every kind of view, no matter whether or not that view has any kind of touch / click event applied to it. This not the default behavior in native-built applications. If you don't do this is some kind of global fashion, then you would have to apply this setting to every nested element of a view. Say a view in comprised of three additional views, all without interactivity, then you would specifically have to apply touchEnabled = false to each and every view. To make matters worse, on iOS setting touchEnabled = false on a parent view, would disable interactive events on all child views (not true in Android). As such, this was the only feasible place I could think / find to implement this logic.

The only way a developer has to make this choice currently is styles.xml, which is an all or nothing proposition.

<style name="AppTheme" parent="AppBaseTheme"> false </style>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashcoding, your thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @ashcoding

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd be fine to disable it for 6.0 (accept the suggested PR) and just make a ti flag in tiapp.xml which allows you to revert to previous behavior.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. So let's introduce the property <property name="ti.android.soundEffectsEnabled" type="bool" /> in the naming convention like ti.android.bug2373.finishfalseroot and merge this PR. @gstreetmedia can you apply this late change? If not, we would get an Android engineer of our team on it and merge this before. Thanks in advance!

}

if (clickable) {
Expand Down