0

I would like to make a floating action button that has an outer ring and inner ring. I need those both to be clickable. Right now I have an ImageView with the src set to a drawable I created. The layout looks simple and I want to give it a better look and feel.

<androidx.appcompat.widget.AppCompatImageView
    android:id="@+id/target_1"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:scaleType="centerCrop"
    android:src="@drawable/target_zone"
    app:layout_constraintCircle="@+id/blue_target"
    app:layout_constraintCircleAngle="210"
    app:layout_constraintCircleRadius="275dp" />
//target_zone.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="oval">
            <padding
                android:bottom="50dp"
                android:left="50dp"
                android:right="50dp"
                android:top="50dp" />
            <size
                android:width="100dp"
                android:height="100dp" />
            <stroke
                android:width="70dp"
                android:color="#000000" />
            <solid android:color="#000000" />
        </shape>
    </item>
    <item>
        <shape android:shape="oval">
            <size
                android:width="40dp"
                android:height="40dp" />
            <solid android:color="#ffffff" />
        </shape>
    </item>
</layer-list>

enter image description here

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
QThompson
  • 1,599
  • 3
  • 16
  • 40

0 Answers0