Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26315

Android: Support touch feedback on backgroundImage, backgroundGradient, and transparent backgrounds

    Details

    • Story Points:
      8
    • Sprint:
      2019 Sprint 11, 2019 Sprint 12, 2019 Sprint 13, 2019 Sprint 14, 2019 Sprint 15, 2019 Sprint 16, 2019 Sprint 17, 2019 Sprint 18, 2019 Sprint 19, 2019 Sprint 20, 2019 Sprint 21, 2019 Sprint 22, 2019 Sprint 23, 2019 Sprint 24, 2020 Sprint 8, 2020 Sprint 9, 2020 Sprint 10, 2020 Sprint 11, 2020 Sprint 12, 2020 Sprint 13

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                hknoechel Hans Knöchel
                Reviewer:
                Gary Mathews
                Tester:
                Samir Mohammed
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-6532
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration