Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Wear CircledImageView (and DelayedConfirmationView) Always Square

Anytime I try to use a CircledImageView (I'm developing on an LG G Watch) my image has a squared background. I get the same result with a DelayedConfirmationView, plus there is no "countdown animation."

like image 996
Eliezer Avatar asked Dec 06 '25 03:12

Eliezer


1 Answers

Turns out the issue with the rounding was that I was specifying the layout_width and layout_height in dp instead of using wrap_content.

The issue with the "countdown" animation is that there needs to be a border width and color specified.

EDIT: Here's a sample of what I was using (app is defined under the xmlns:android as xmlns:app="http://schemas.android.com/apk/res-auto") :

<android.support.wearable.view.CircledImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_action_call"
    app:circle_color="@color/green"
    app:circle_radius="30dp"
    app:circle_radius_pressed="40dp"/>

In terms of the attributes, I use Intellij/AS which auto-completes them. If you're not using either of those IDEs, the attributes pretty much correspond to the method names, so you can match them from there.

like image 140
Eliezer Avatar answered Dec 08 '25 02:12

Eliezer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!