I am look for the right way to create this kind of custom buttons in android (xml).
I know i can set this image as a background for a button, but i am look for a way to re-create it with xml to make it be responsive for various screen sizes.
I am look for the right way to create this kind of custom buttons in android (xml).
I know i can set this image as a background for a button, but i am look for a way to re-create it with xml to make it be responsive for various screen sizes.
You could use a layer-list to achieve that design using XML. Here's an example:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:left="60dp">
<shape>
<size
android:width="200dp"
android:height="120dp"/>
<gradient
android:startColor="#474946"
android:endColor="#181818"
android:angle="270"/>
<corners android:topLeftRadius="2dp" android:topRightRadius="2dp"
android:bottomLeftRadius="2dp" android:bottomRightRadius="2dp"/>
</shape>
</item>
<item android:right="140dp">
<shape android:shape="oval">
<size
android:width="120dp"
android:height="120dp"/>
<solid android:color="#000000"/>
</shape>
</item>
You can also use a 9-patch for that.