<?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="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".MainActivity">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="147dp"
        android:layout_height="92dp"
        android:layout_marginTop="16dp"
        android:contentDescription="@string/img_http_sms_logo"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/logo_cropped"
        tools:ignore="ImageContrastCheck" />

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/mainPhoneCard"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:elevation="16dp"
        android:layout_marginTop="24dp"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageView">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/cardPhoneNumber"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:text="@string/phone_number"
                    android:drawablePadding="5dp"
                    android:textAppearance="?attr/textAppearanceTitleMedium"
                    android:textColor="?android:attr/textColorPrimary"
                    app:drawableTint="#70ab5c"
                    app:drawableEndCompat="@drawable/baseline_check_circle_24"
                    android:textSize="28sp" />
            </LinearLayout>

            <TextView
                android:id="@+id/cardRefreshTime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="@string/nextRefreshTime"
                android:textAppearance="?attr/textAppearanceBodyMedium"
                android:textColor="?android:attr/textColorSecondary"
                android:textSize="16sp" />

        </LinearLayout>
    </com.google.android.material.card.MaterialCardView>

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/mainPhoneCardSIM2"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:elevation="16dp"
        android:layout_marginTop="24dp"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/mainPhoneCard">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/cardPhoneNumberSIM2"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:drawablePadding="5dp"
                    android:text="@string/phone_number"
                    android:textAppearance="?attr/textAppearanceTitleMedium"
                    android:textColor="?android:attr/textColorPrimary"
                    app:drawableTint="#70ab5c"
                    app:drawableEndCompat="@drawable/baseline_check_circle_24"
                    android:textSize="28sp" />

            </LinearLayout>

            <TextView
                android:id="@+id/cardRefreshTimeSIM2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="@string/nextRefreshTime"
                android:textAppearance="?attr/textAppearanceBodyMedium"
                android:textColor="?android:attr/textColorSecondary"
                android:textSize="16sp" />

        </LinearLayout>
    </com.google.android.material.card.MaterialCardView>

    <LinearLayout
        android:id="@+id/batteryOptimizationLinearLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:orientation="vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/mainPhoneCardSIM2">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/smsPermissionButton"
            style="@style/Widget.MaterialComponents.Button.Icon"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:backgroundTint="#4CAF50"
            android:padding="10dp"
            android:text="@string/enable_sms_permission"
            android:textColor="@color/white"
            android:textSize="16sp"
            android:visibility="gone"
            app:icon="@drawable/open_in_new_24"
            app:iconGravity="textEnd"
            app:iconPadding="8dp"
            app:iconTint="@color/white"
            tools:ignore="TextContrastCheck" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/batteryOptimizationButtonButton"
            style="@style/Widget.MaterialComponents.Button.Icon"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:backgroundTint="@color/pink_500"
            android:drawableTint="@color/white"
            android:padding="10dp"
            app:icon="@android:drawable/ic_lock_idle_low_battery"
            android:text="@string/disable_battery_optimization"
            android:textColor="@color/white"
            android:textSize="16sp"
            app:iconTint="@color/white"
            tools:ignore="TextContrastCheck" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:orientation="vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/batteryOptimizationLinearLayout">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/mainHeartbeatButton"
            style="@style/Widget.MaterialComponents.Button.Icon"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:backgroundTint="#2196f3"
            android:drawableTint="@color/white"
            android:padding="10dp"
            android:text="@string/send_heartbeat"
            android:textColor="@color/white"
            android:textSize="16sp"
            app:iconTint="@color/white"
            tools:ignore="TextContrastCheck" />

        <com.google.android.material.progressindicator.LinearProgressIndicator
            android:id="@+id/mainProgressIndicator"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:indeterminate="true"
            android:visibility="invisible"
            app:indicatorColor="@color/pink_500" />
    </LinearLayout>

    <TextView
        android:id="@+id/mainAppVersion"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:text="@string/app_version"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/linearLayout" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/mainSettingsButton"
        style="@style/Widget.MaterialComponents.Button.Icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:backgroundTint="@color/black"
        android:drawableTint="@color/white"
        android:padding="10dp"
        android:text="@string/main_app_settings"
        android:textColor="@color/white"
        android:textSize="16sp"
        app:icon="@drawable/baseline_settings_24"
        app:iconTint="@color/white"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        tools:ignore="TextContrastCheck" />

</androidx.constraintlayout.widget.ConstraintLayout>
