<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:fillViewport="true">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context=".login.LoginActivity"
        tools:layout_editor_absoluteY="25dp">

        <Button
            android:id="@+id/open_logs"
            android:layout_width="70dp"
            android:layout_height="40dp"
            android:insetTop="0dp"
            style="@style/Widget.AppCompat.Button.Borderless.Colored"
            android:text="@string/logs"
            app:backgroundTint="#00FFFFFF"
            android:textColor="@color/colorNavPrimary"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <ProgressBar
            android:id="@+id/checkurl_progress"
            android:layout_width="49dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:layout_weight="1"
            android:minWidth="40dp"
            android:minHeight="40dp"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.501"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/checkurl" />

        <ProgressBar
            android:id="@+id/login_progress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:minWidth="40dp"
            android:minHeight="40dp"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintHorizontal_bias="0.501"
            app:layout_constraintTop_toTopOf="@+id/login" />

        <ImageView
            android:id="@+id/gotify_logo_image"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_alignParentTop="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginStart="8dp"
            android:layout_marginTop="16dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/gotify"
            android:contentDescription="@string/gotify_logo" />

        <EditText
            android:id="@+id/gotify_url"
            android:layout_width="0dp"
            android:layout_height="42dp"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="8dp"
            android:ems="10"
            android:hint="@string/gotify_url"
            android:inputType="textUri"
            android:singleLine="true"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/gotify_logo_image"
            app:layout_constraintWidth_max="280dp"
            tools:text="Gotify URL" />

        <EditText
            android:id="@+id/username"
            android:layout_width="0dp"
            android:layout_height="47dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="8dp"
            android:ems="10"
            android:hint="@string/username"
            android:inputType="textPersonName"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/checkurl"
            app:layout_constraintWidth_max="280dp"
            tools:text="Username"/>

        <EditText
            android:id="@+id/password"
            android:layout_width="0dp"
            android:layout_height="50dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="8dp"
            android:ems="10"
            android:hint="@string/password"
            android:inputType="textPassword"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/username"
            app:layout_constraintWidth_max="280dp"
            tools:text="Password" />

        <Button
            android:id="@+id/login"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="8dp"
            android:background="@color/colorPrimaryDark"
            android:textColor="@android:color/white"
            android:text="@string/login"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/password"
            app:layout_constraintWidth_max="280dp" />

        <Button
            android:id="@+id/checkurl"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="8dp"
            android:background="@color/colorPrimaryDark"
            android:text="@string/check_url"
            android:textColor="@android:color/white"
            android:visibility="visible"
            app:layout_constraintEnd_toStartOf="@+id/advanced_settings"
            app:layout_constraintStart_toStartOf="@+id/gotify_url"
            app:layout_constraintTop_toBottomOf="@+id/gotify_url"
            app:layout_constraintWidth_max="280dp" />

        <ImageButton
            android:id="@+id/advanced_settings"
            style="@style/Widget.AppCompat.Button.Borderless"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:text="@string/check_url"
            android:visibility="visible"
            app:layout_constraintEnd_toEndOf="@+id/gotify_url"
            app:layout_constraintTop_toTopOf="@+id/checkurl"
            app:srcCompat="@drawable/ic_settings" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
