Я использую AndroidX
зависимости для моего проекта Android.
У меня есть Toolbar
в моей деятельности (это действие для поддержки разработчика, заплатив ему немного денег), обернутой в линейный макет, какэто:
<LinearLayout
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="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/gradient"
tools:context=".Support">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_support"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@null"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</LinearLayout>
Другие используемые коды XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/gradient"
tools:context=".Support">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_support"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@null"
app:popupTheme="@style/AppTheme.PopupOverlay" />
<TextView
android:layout_marginTop="150dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/google_sans"
android:textSize="17dp"
android:textColor="#ffffff"
android:text="@string/support_para"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#ffffff"
android:textSize="20dp"
android:text="$"/>
<EditText
android:id="@+id/amount"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/pay_amount"
android:textColorHint="#ffffff"
android:textSize="20dp"
android:layout_marginStart="10dp"
android:layout_gravity="end"
android:maxLines="1" />
</LinearLayout>
<Button
android:id="@+id/googlepay"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:background="@drawable/round_button"
android:textColor="#ffffff"
android:fontFamily="@font/google_sans"
android:text="@string/pay"/>
</LinearLayout>
Теперь я получаю следующее: