Taming Android UIs with Eric Burke of Square
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about custom Android views, such as rounded-corner image views and enlarging touch areas, because it shows working code from a production app.
Recommended by 3 people across 3 different months, 2012 to 2021.
What it is
A conference talk by Eric Burke of Square, recorded by InfoQ, on building polished custom Android UIs. He walks through real Square code for custom views, including techniques that avoid common framework limitations.
What people said
Recommends Brendan Weinstein · 2012-02 · Stack Overflow · on “How To Use Multiple TouchDelegate”
There is only supposed to be one touch delegate for each view. The documentation for getTouchDelegate() in the View class reads: "Gets the TouchDelegate for this View." There is only to be one TouchDelegate. To use only one TouchDelegate per view, you can wrap each touchable view within a view with dimensions reflecting what you would like to be touchable. An android developer at square gives an example of how you can do this for multiple Views using just one static method ( [this video] ): public static void expandTouchArea(final View bigView, final View smallView, final int extraPadding) { bigView.post(new Runnable() { @Override public void run() { Rect rect = new Rect(); smallView.getHitRect(r
Recommends petey · 2012-03 · Stack Overflow · on “ImageView with rounded corners and inner shadow”
Take a look at Eric's (from squareup) presentation material from Oreilly's AndoridOpen Conference last year in his lecture titled Beautiful Android [LINK] It has a ton of info that should help you out. I wish they had the video of his presentation somewhere. I could not find it. So sorry. EDIT : Thanks to @mykola for the yt link [this video]
Recommends Daniel L. · 2013-02 · Stack Overflow · on “Android - How to create a view with rounded corners and a tiled image background?”
You can check video [this video] which contains a way to do it without using clipPath which is not supported with hardware acceleration.
Cites Donn Felker · 2012-04 · Stack Overflow · on “Custom Image View”
This is basically what I ended up doing. But I took some queues from Eric Burke (Square) from his SF Android talk here: [this video]
Cites tommytucker7182 · 2021-06 · Stack Overflow · on “How To Use Multiple TouchDelegate”
I implemented a simple solution from the link that Brendan Weinstein listed above - the static method was incredibly clean and tidy compared to all other solutions. Padding for me simply doesnt work. My use case was increasing the touch area of 2 small buttons to improve UX. I have a MyUserInterfaceManager class, where i insert the static function from the [this video] ; public static void changeViewsTouchArea(final View newTouchArea, final View viewToChange) { newTouchArea.post(new Runnable() { @Override public void run() { Rect rect = new Rect(0,0, newTouchArea.getWidth(), newTouchArea.getHeight()); newTouchArea.setTouchDelegate(new TouchDelegate(rect, viewToChange)); } }); } Then in XML i have