//activity_main
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="330dp"
android:layout_height="53dp"
android:background="@drawable/ui"
tools:context=".MainActivity">
<ImageView
android:id="@+id/small"
android:layout_width="43dp"
android:layout_height="43dp"
android:src="@drawable/small"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:paddingTop="13dp"
android:paddingLeft="19dp"
/>
<ImageView
android:id="@+id/text"
android:layout_width="42dp"
android:layout_height="42dp"
android:src="@drawable/text_fields"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/small"
android:paddingTop="13dp"
android:paddingLeft="10dp"
/>
<TextView
android:id="@+id/EN"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="English"
android:textSize="16dp"
android:textColor="@color/white"
android:paddingTop="16dp"
android:paddingLeft="12dp"
app:layout_constraintLeft_toRightOf="@id/text"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/swap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/sync_alt"
android:paddingTop="15dp"
android:paddingLeft="15dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/EN"
/>
<TextView
android:id="@+id/VN"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tiếng Việt"
android:textSize="16dp"
android:paddingTop="16dp"
android:paddingLeft="14dp"
android:textColor="@color/white"
app:layout_constraintLeft_toRightOf="@id/swap"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/X"
android:src="@drawable/close"
android:layout_width="44dp"
android:layout_height="44dp"
android:paddingTop="12dp"
android:paddingLeft="19dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/VN"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
//Activity
package com.example.spen;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
//close.xml
<vector android:height="24dp" android:tint="#F6F6F6"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
//small.xml
<vector android:height="24dp" android:tint="#F6F6F6"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M5.88,4.12L13.76,12l-7.88,7.88L8,22l10,-10L8,2z"/>
</vector>
//sync_alt.xml
<vector android:height="24dp" android:tint="#818181"
android:viewportHeight="24" android:viewportWidth="24"
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M22,8l-4,-4v3H3v2h15v3L22,8z"/>
<path android:fillColor="#FFFFFF" android:pathData="M2,16l4,4v-3h15v-2H6v-3L2,16z"/>
</vector>
//text_fields.xml
<vector android:height="24dp" android:tint="#F6F6F6"
android:viewportHeight="22" android:viewportWidth="22"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M2.5,4v3h5v12h3V7h5V4H2.5zM21.5,9h-9v3h3v7h3v-7h3V9z"/>
</vector>
//ui.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding="10dp">
<stroke
android:width="0.7dp"
android:color="#656565" />
<solid android:color="#272727" />
<corners
android:bottomRightRadius="60dp"
android:bottomLeftRadius="60dp"
android:topLeftRadius="60dp"
android:topRightRadius="60dp" />
</shape>