1

i am referrring this link , but it dosent help

Expected resultOutput result

Source code

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/tools"
    xmlns:card_view="http://schemas.android.com/apk/res-auto">

    <data>

        <variable
            name="collection"
            type="com.techryde.bajafresh.data.model.local.CollectionDb" />
    </data>

    <RelativeLayout
        android:id="@+id/circle_layout"
        android:layout_width="160dp"
        android:layout_height="160dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:background="@drawable/whitecircle">

        <RelativeLayout
            android:id="@+id/circle_layoutinner"
            android:layout_width="match_parent"
            android:layout_height="120dp"
            android:layout_above="@+id/rating_viewtv"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:background="@drawable/circle_inset_drawable">

            <ImageView
                android:id="@+id/country_photo"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                app:url="@{collection.imageUrl}" />


        </RelativeLayout>

        <TextView
            android:id="@+id/rating_viewtv"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="3dp"
            android:text="@{collection.collectionName}"
            android:textColor="@android:color/white" />
    </RelativeLayout>
</layout>

whitecircle.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:innerRadius="0dp"
    android:shape="ring"
    android:thicknessRatio="2"
    android:useLevel="false">

    <solid android:color="@android:color/holo_red_dark" />

</shape>

circletwo.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:innerRadius="0dp"
    android:shape="ring"
    android:thicknessRatio="2"
    android:useLevel="false">

    <!--<solid android:color="#ff9546" />-->
    <solid android:color="#ffffff" />

</shape>

circle_insert_drawable.xml

<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/circletwo"
    android:insetTop="40dp"
    android:visible="true" />

Cant figure out whats the issue is? If anyone has face this issue before it would be great of ur help .Thanks

Community
  • 1
  • 1
Ankit Ostwal
  • 1,033
  • 3
  • 14
  • 32

1 Answers1

0

you can easily create button with drawable top...

<Button android:layout_weight="wrap_content"
    android:layout_height="wrap_Content"
    android:drawableTop="@drawable/yourimage"
    android:background="your circle shap drawble"/>
Abhishek Singh
  • 9,008
  • 5
  • 28
  • 53