<?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"
  tools:context=".CommandActivity">


  <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:layout_editor_absoluteX="0dp"
    tools:layout_editor_absoluteY="0dp">

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

      <TextView
        android:id="@+id/labelLock"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/lock" />

      <ImageButton
        android:id="@+id/btnLock"
        android:layout_width="110dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="0dp"
        android:backgroundTint="#246FA8"
        android:contentDescription="@string/send_lock_command"
        android:onClick="sendLockCmd"
        app:srcCompat="@android:drawable/ic_lock_idle_lock" />

      <View
        android:id="@+id/divider"
        android:layout_width="match_parent"
        android:layout_height="10dp"
        android:background="?android:attr/listDivider" />

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

        <LinearLayout
          android:layout_width="140dp"
          android:layout_height="72dp"
          android:gravity="top"
          android:orientation="vertical">

          <TextView
            android:id="@+id/labelShutdown"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="0dp"
            android:text="@string/shutdown" />

          <ImageButton
            android:id="@+id/btnShutdown"
            android:layout_width="110dp"
            android:layout_height="45dp"
            android:layout_marginTop="0dp"
            android:backgroundTint="#734B1A"
            android:contentDescription="@string/send_shutdown_command"
            android:onClick="sendShutdownCmd"
            app:srcCompat="@android:drawable/ic_lock_power_off" />

        </LinearLayout>

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

          <Switch
            android:id="@+id/swSecShutdown1"
            android:layout_width="113dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:onClick="switchShutdown"
            android:text="@string/shutdown" />

          <Switch
            android:id="@+id/swSecShutdown2"
            android:layout_width="160dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="0dp"
            android:layout_marginTop="0dp"
            android:onClick="switchShutdown"
            android:text="@string/shutdown" />
        </LinearLayout>
      </LinearLayout>

      <View
        android:id="@+id/divider2"
        android:layout_width="match_parent"
        android:layout_height="10dp"
        android:background="?android:attr/listDivider" />

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

        <LinearLayout
          android:layout_width="140dp"
          android:layout_height="match_parent"
          android:orientation="vertical">

          <TextView
            android:id="@+id/labelPanic"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/panic" />

          <ImageButton
            android:id="@+id/btnPanic"
            android:layout_width="110dp"
            android:layout_height="45dp"
            android:backgroundTint="#880000"
            android:contentDescription="@string/panic"
            android:onClick="sendPanicCmd"
            app:srcCompat="@android:drawable/ic_menu_delete" />

        </LinearLayout>

        <LinearLayout
          android:layout_width="232dp"
          android:layout_height="match_parent"
          android:orientation="vertical">

          <Switch
            android:id="@+id/swSecPanic1"
            android:layout_width="113dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:onClick="switchPanic"
            android:text="@string/panic" />

          <Switch
            android:id="@+id/swSecPanic2"
            android:layout_width="160dp"
            android:layout_height="wrap_content"
            android:onClick="switchPanic"
            android:text="@string/panic" />

          <Switch
            android:id="@+id/swSecPanic3"
            android:layout_width="205dp"
            android:layout_height="wrap_content"
            android:onClick="switchPanic"
            android:text="@string/panic" />
        </LinearLayout>

      </LinearLayout>

      <View
        android:id="@+id/divider3"
        android:layout_width="match_parent"
        android:layout_height="10dp"
        android:background="?android:attr/listDivider" />

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

        <LinearLayout
          android:layout_width="140dp"
          android:layout_height="match_parent"
          android:gravity="top"
          android:orientation="vertical">

          <TextView
            android:id="@+id/labelInfraShutdown"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/infra_shutdown" />

          <ImageButton
            android:id="@+id/btnInfraShutdown"
            android:layout_width="110dp"
            android:layout_height="45dp"
            android:backgroundTint="#B36200"
            android:contentDescription="@string/infra_shutdown"
            android:onClick="sendInfraShutdownCmd"
            app:srcCompat="?android:attr/alertDialogIcon" />

        </LinearLayout>

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

          <Switch
            android:id="@+id/swSecInfraShutdown1"
            android:layout_width="160dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:onClick="switchInfraShutdown"
            android:text="@string/infra_shutdown" />

          <Switch
            android:id="@+id/swSecInfraShutdown2"
            android:layout_width="205dp"
            android:layout_height="wrap_content"
            android:onClick="switchInfraShutdown"
            android:text="@string/infra_shutdown" />
        </LinearLayout>
      </LinearLayout>

      <View
        android:id="@+id/divider4"
        android:layout_width="match_parent"
        android:layout_height="10dp"
        android:background="?android:attr/listDivider" />

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

        <LinearLayout
          android:layout_width="140dp"
          android:layout_height="match_parent"
          android:orientation="vertical">

          <TextView
            android:id="@+id/labelInfraPanic"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/infra_panic" />

          <ImageButton
            android:id="@+id/btnInfraPanic"
            android:layout_width="110dp"
            android:layout_height="45dp"
            android:backgroundTint="#9C0000"
            android:contentDescription="@string/infra_panic"
            android:onClick="sendInfraPanicCmd"
            app:srcCompat="@android:drawable/ic_menu_close_clear_cancel" />

        </LinearLayout>

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

          <Switch
            android:id="@+id/swSecInfraPanic1"
            android:layout_width="117dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:onClick="switchInfraPanic"
            android:text="@string/infra_panic" />

          <Switch
            android:id="@+id/swSecInfraPanic2"
            android:layout_width="159dp"
            android:layout_height="wrap_content"
            android:onClick="switchInfraPanic"
            android:text="@string/infra_panic" />

          <Switch
            android:id="@+id/swSecInfraPanic3"
            android:layout_width="206dp"
            android:layout_height="wrap_content"
            android:onClick="switchInfraPanic"
            android:text="@string/infra_panic" />
        </LinearLayout>
      </LinearLayout>


    </LinearLayout>
  </ScrollView>

  <com.google.android.material.floatingactionbutton.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="24dp"
    android:layout_marginBottom="24dp"
    android:clickable="true"
    android:focusable="true"
    android:onClick="startSettingsActivity"
    app:backgroundTint="@color/colorPrimaryDark"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:srcCompat="@android:drawable/ic_menu_manage" />

</androidx.constraintlayout.widget.ConstraintLayout>