Advertisement
androidgeek18

activity_second.xml

Nov 30th, 2024
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.47 KB | Source Code | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.    xmlns:app="http://schemas.android.com/apk/res-auto"
  4.    xmlns:tools="http://schemas.android.com/tools"
  5.    android:id="@+id/main"
  6.    android:layout_width="match_parent"
  7.    android:layout_height="match_parent"
  8.    android:background="@color/grey_background"
  9.    tools:context=".SecondActivity">
  10.  
  11.     <!-- Title TextView -->
  12.     <TextView
  13.        android:id="@+id/tvTitle"
  14.        android:layout_width="0dp"
  15.        android:layout_height="wrap_content"
  16.        android:background="@color/grey_background"
  17.        android:gravity="center"
  18.        android:padding="16dp"
  19.        android:text="@string/list_title"
  20.        android:textColor="@android:color/white"
  21.        android:textSize="24sp"
  22.        app:layout_constraintEnd_toEndOf="parent"
  23.        app:layout_constraintStart_toStartOf="parent"
  24.        app:layout_constraintTop_toTopOf="parent" />
  25.  
  26.     <!-- SwipeRefreshLayout -->
  27.     <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
  28.        android:id="@+id/swipeRefreshLayout"
  29.        android:layout_width="match_parent"
  30.        android:layout_height="0dp"
  31.        app:layout_constraintBottom_toBottomOf="parent"
  32.        app:layout_constraintEnd_toEndOf="parent"
  33.        app:layout_constraintStart_toStartOf="parent"
  34.        app:layout_constraintTop_toBottomOf="@id/tvTitle">
  35.  
  36.         <!-- RecyclerView for device list -->
  37.         <androidx.recyclerview.widget.RecyclerView
  38.            android:id="@+id/recyclerViewDevices"
  39.            android:layout_width="match_parent"
  40.            android:layout_height="0dp"
  41.            android:clipToPadding="false"
  42.            android:paddingStart="8dp"
  43.            android:paddingTop="16dp"
  44.            android:paddingEnd="8dp"
  45.            app:layout_constraintBottom_toBottomOf="parent"
  46.            app:layout_constraintEnd_toEndOf="parent"
  47.            app:layout_constraintStart_toStartOf="parent"
  48.            app:layout_constraintTop_toTopOf="parent" />
  49.     </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
  50.  
  51.     <!-- Loading overlay (initially hidden) -->
  52.     <LinearLayout
  53.        android:id="@+id/loadingLayout"
  54.        android:layout_width="match_parent"
  55.        android:layout_height="match_parent"
  56.        android:background="#80000000"
  57.        android:gravity="center"
  58.        android:orientation="vertical"
  59.        android:visibility="gone"
  60.        app:layout_constraintBottom_toBottomOf="parent"
  61.        app:layout_constraintEnd_toEndOf="parent"
  62.        app:layout_constraintStart_toStartOf="parent"
  63.        app:layout_constraintTop_toTopOf="parent">
  64.  
  65.         <!-- ProgressBar for loading -->
  66.         <ProgressBar
  67.            android:id="@+id/progressBar"
  68.            android:layout_width="wrap_content"
  69.            android:layout_height="wrap_content"
  70.            android:indeterminate="true" />
  71.  
  72.         <!-- TextView to show "Searching Device" message -->
  73.         <TextView
  74.            android:id="@+id/loaderText"
  75.            android:layout_width="wrap_content"
  76.            android:layout_height="wrap_content"
  77.            android:layout_marginTop="16dp"
  78.            android:text="@string/searching_devices"
  79.            android:textColor="@android:color/white"
  80.            android:textSize="18sp"
  81.            android:padding="12dp"
  82.            android:gravity="center"/>
  83.     </LinearLayout>
  84.  
  85. </androidx.constraintlayout.widget.ConstraintLayout>
  86.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement