gallery-android/app/src/main/res/layout/activity_new_post.xml
2026-01-09 21:23:55 +01:00

212 lines
9.0 KiB
XML

<?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:background="@color/bgColor"
tools:context=".NewPostActivity">
<ScrollView
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="wrap_content">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="32dp"
android:background="@drawable/card_background"
android:elevation="8dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_percent="0.85"
app:layout_constraintVertical_bias="0.5">
<!-- Header -->
<TextView
android:id="@+id/headerTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Create New Post"
android:textSize="32sp"
android:textStyle="bold"
android:textColor="#011f4b"
android:gravity="center"
android:layout_marginBottom="40dp"/>
<!-- Description Label -->
<TextView
android:id="@+id/descriptionLabelTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Description"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#03396c"
android:layout_marginBottom="8dp"/>
<!-- Description Input -->
<EditText
android:id="@+id/descriptionET"
android:layout_width="match_parent"
android:layout_height="120dp"
android:hint="Enter post description"
android:textColorHint="#6497b1"
android:textColor="#011f4b"
android:background="@drawable/edit_text_background"
android:padding="16dp"
android:inputType="textMultiLine"
android:gravity="top|start"
android:layout_marginBottom="24dp"/>
<!-- Media Type Label -->
<TextView
android:id="@+id/mediaTypeLabelTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Media Type"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#03396c"
android:layout_marginBottom="8dp"/>
<!-- Media Type Radio Group -->
<RadioGroup
android:id="@+id/mediaTypeRG"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="24dp">
<RadioButton
android:id="@+id/photoRB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Photo"
android:textColor="#03396c"
android:buttonTint="#005b96"
android:checked="true"/>
<RadioButton
android:id="@+id/videoRB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Video"
android:textColor="#03396c"
android:buttonTint="#005b96"
android:layout_marginStart="24dp"/>
</RadioGroup>
<!-- Category Label -->
<TextView
android:id="@+id/categoryLabelTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Category"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#03396c"
android:layout_marginBottom="8dp"/>
<!-- Category Spinner -->
<Spinner
android:id="@+id/categorySpinner"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@drawable/edit_text_background"
android:padding="16dp"
android:layout_marginBottom="24dp"
android:spinnerMode="dropdown"
android:popupBackground="#FFFFFF"/>
<!-- Select Media Label -->
<TextView
android:id="@+id/selectMediaLabelTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select Media"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#03396c"
android:layout_marginBottom="8dp"/>
<!-- Choose File Button -->
<Button
android:id="@+id/selectMediaBtn"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="Choose File"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@drawable/button_background"
android:elevation="4dp"
android:stateListAnimator="@null"
android:layout_marginBottom="12dp"/>
<!-- Selected File Text -->
<TextView
android:id="@+id/selectedFileTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="No file selected"
android:textSize="14sp"
android:textColor="#6497b1"
android:gravity="center"
android:layout_marginBottom="16dp"/>
<!-- Preview Image -->
<ImageView
android:id="@+id/previewIV"
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_gravity="center"
android:visibility="gone"
android:scaleType="centerCrop"
android:background="@drawable/edit_text_background"
android:layout_marginBottom="24dp"
android:contentDescription="Preview"/>
<!-- Submit Button -->
<Button
android:id="@+id/submitBtn"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="Post"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@drawable/button_background"
android:elevation="4dp"
android:stateListAnimator="@null"
android:layout_marginBottom="12dp"/>
<!-- Cancel Button -->
<Button
android:id="@+id/cancelBtn"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="Cancel"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@drawable/button_background"
android:stateListAnimator="@null"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>