Is it possible to use a TouchDelegate with an App Widget, i.e. with RemoteViews? The purpose is to make it easier to tap some buttons on the widget by making the tap area larger, but without making the image take up more space since that will affect the layout.
The TouchDelegate examples I’ve found requires you to find and use the view IDs in question using Activity.findViewById() which I don’t think will work through an AppWidgetProvider. If it’s not possible, is there any alternative that can achieve the same thing? I have also tried putting the image in a framelayout with padding, but since the padding takes up space this doesn’t help. Thanks.
No, sorry.
Get rid of the padding and assign a
PendingIntentfor the click event of theFrameLayout. All subclasses ofViewhave click events, even though we tend to focus mostly onButtonandImageButton. By putting your image inside a container that is sized and positioned where you want touch events to register, and using the samePendingIntentfor both the image and that container, you can create a larger touch target.