Files
simplefileupload-android/app/src/main/res/layout/activity_main.xml

201 lines
8.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="@+id/headerText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_header"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="16dp"/>
<!-- Main Upload Options Section -->
<androidx.cardview.widget.CardView
android:id="@+id/uploadOptionsCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:layout_constraintTop_toBottomOf="@id/headerText">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/upload_options_title"
android:textSize="18sp"
android:textStyle="bold"/>
<Button
android:id="@+id/selectFileButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/select_file_button"
android:drawableStart="@android:drawable/ic_menu_search"
android:paddingStart="16dp"
android:paddingEnd="16dp"/>
<Button
android:id="@+id/uploadDumpstateButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/upload_dumpstate_button"
android:drawableStart="@android:drawable/ic_menu_save"
android:paddingStart="16dp"
android:paddingEnd="16dp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- Dumpstate Section -->
<androidx.cardview.widget.CardView
android:id="@+id/dumpstateCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:layout_constraintTop_toBottomOf="@id/uploadOptionsCard">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dumpstate_section_title"
android:textSize="18sp"
android:textStyle="bold"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="4dp">
<TextView
android:id="@+id/dumpstateStatusText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/looking_for_dumpstate"
android:textSize="16sp"
android:maxLines="3"
android:ellipsize="start"/>
<Button
android:id="@+id/toggleDumpstateListButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/show_dumpstates"
android:textSize="12sp"
style="@style/Widget.AppCompat.Button.Small" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/dumpstateRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:visibility="gone"/>
<LinearLayout
android:id="@+id/multiSelectButtonsLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp"
android:visibility="gone">
<Button
android:id="@+id/selectAllButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/select_all"
android:textSize="12sp"
style="@style/Widget.AppCompat.Button.Borderless.Colored" />
<Button
android:id="@+id/clearSelectionsButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/clear_selections"
android:textSize="12sp"
style="@style/Widget.AppCompat.Button.Borderless.Colored" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- Selected File Section -->
<androidx.cardview.widget.CardView
android:id="@+id/selectedFileCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/dumpstateCard">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/selected_file_section_title"
android:textSize="18sp"
android:textStyle="bold"/>
<TextView
android:id="@+id/selectedFileText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/no_file_selected"
android:textSize="16sp"/>
<Button
android:id="@+id/uploadSelectedFileButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/upload_selected_file"
android:visibility="gone"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/selectedFileCard"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="16dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>