Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26315] Android: Support touch feedback on backgroundImage, backgroundGradient, and transparent backgrounds

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2020-08-11T15:08:31.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.1.0
ComponentsAndroid
Labelsandrod, background, material-design, touch, view
ReporterHans Knöchel
AssigneeJoshua Quick
Created2018-08-18T08:28:14.000+0000
Updated2021-03-09T01:50:49.000+0000

Description

*Summary:* A Ti.UI.View object's touchFeedback and touchFeedbackColor properties will only show a touch/tap ripple animation if you set the view's backgroundColor property to a non-transparent color. This is a documented limitation. https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-touchFeedback https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-touchFeedbackColor We should add touch feedback to the following as well: * backgroundImage property (only apply ripple to non-transparent part) * backgroundGradient property (only apply ripple to non-transparent part) * No background (ripple applied to entire transparent background) *Use-Case:* This is needed for developers who want to show buttons with custom image backgrounds.
var window = Ti.UI.createWindow();
var button = Ti.UI.createButton({
	title: "Tap Me",
	backgroundImage: "android.resource://android/drawable/panel_picture_frame_bg_focus_blue",
	touchFeedbackColor: "yellow",
	touchFeedback: true,
});
button.addEventListener("click", function() {
	Ti.API.info("### Button was clicked on.");
});
window.add(button);
window.open();
*Note:* The touch feedback feature only works on Android 5.0 and newer OS versions.

Comments

  1. Yordan Banev 2019-06-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/10986
  2. Joshua Quick 2020-06-24

    Above PR was closed in favor of the below. PR (master): https://github.com/appcelerator/titanium_mobile/pull/11795
  3. Samir Mohammed 2020-07-09

    FR Passed, waiting on Jenkins build.
  4. Christopher Williams 2020-07-13

    merged to master manually (after fixing conflict) for 9.1.0 target
  5. Samir Mohammed 2020-08-11

    *Closing ticket*. Improvement verified in SDK version 9.1.0.v20200810120239. *Test and other information can be found at:* https://github.com/appcelerator/titanium_mobile/pull/11795

JSON Source