Android Wear CircledImageView (and DelayedConfirmationView) Always Square

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

+3
source share
1 answer

Causes a problem with rounding, which is that I was layout_width and layout_height in dp instead of using wrap_content .

The problem with the countdown animation is that you need to specify the width and color of the border.

EDIT: Here is an example of what I used (the app is defined under 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 attributes, I use Intellij / AS, which automatically terminates them. If you are not using any of these IDEs, the attributes pretty much match the method names, so you can map them there.

+4
source

Source: https://habr.com/ru/post/1207554/


All Articles