render subscriptions
This commit is contained in:
9
app/src/main/res/drawable/card_background.xml
Normal file
9
app/src/main/res/drawable/card_background.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/card_background_color" />
|
||||
<corners android:radius="12dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/card_stroke_color" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/category_tag_background.xml
Normal file
6
app/src/main/res/drawable/category_tag_background.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/category_tag_background" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
@@ -1,37 +1,86 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
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="?android:attr/colorBackground"
|
||||
tools:context=".ui.subscriptions.SubscriptionsFragment">
|
||||
|
||||
<ScrollView
|
||||
<!-- Loading indicator -->
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- Error message -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_error"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true">
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="32dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/text_error"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp"
|
||||
android:gravity="center">
|
||||
android:textSize="16sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="16dp"
|
||||
tools:text="Failed to load subscriptions" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_subscriptions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="100dp"
|
||||
tools:text="Subscriptions\n\nComing soon..." />
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_retry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Retry" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
<!-- Empty state -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="32dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="No subscriptions found"
|
||||
android:textSize="18sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Add a new subscription to get started"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Subscriptions list -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_subscriptions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="80dp"
|
||||
tools:listitem="@layout/item_subscription_detailed" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_add_subscription"
|
||||
@@ -42,6 +91,6 @@
|
||||
android:layout_marginBottom="16dp"
|
||||
android:src="@drawable/ic_add_24"
|
||||
android:contentDescription="Add subscription"
|
||||
app:tint="?android:attr/colorBackground" />
|
||||
android:tint="?android:attr/colorBackground" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
182
app/src/main/res/layout/item_subscription_detailed.xml
Normal file
182
app/src/main/res/layout/item_subscription_detailed.xml
Normal file
@@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
android:background="@drawable/card_background"
|
||||
android:elevation="2dp">
|
||||
|
||||
<!-- Header with service icon and name -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_service_icon"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:gravity="center"
|
||||
android:textSize="16sp"
|
||||
android:background="@drawable/circle_background"
|
||||
android:layout_marginEnd="12dp"
|
||||
tools:text="⚡" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_subscription_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
tools:text="Nalahiya" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_subscription_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="12sp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="Sub #98738" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_service_category"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:background="@drawable/category_tag_background"
|
||||
android:textAllCaps="true"
|
||||
tools:text="DOMESTIC" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Property and Customer Information Side by Side -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="12dp">
|
||||
|
||||
<!-- Property Information -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginEnd="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Property"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textAllCaps="true"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_property_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="13sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:layout_marginBottom="2dp"
|
||||
tools:text="NALAHIYA" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_property_street"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="11sp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="EDHURU ALIBE HIN'GUN" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Customer Information -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Customer"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textAllCaps="true"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_customer_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="13sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:layout_marginBottom="2dp"
|
||||
tools:text="Muaaviyath Mohamed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_customer_phone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="11sp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="9873221" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="end">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_edit"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Edit"
|
||||
android:textSize="11sp"
|
||||
android:minHeight="36dp"
|
||||
android:layout_marginEnd="8dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_delete"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Delete"
|
||||
android:textSize="11sp"
|
||||
android:minHeight="36dp"
|
||||
android:textColor="?android:attr/colorError" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -14,4 +14,7 @@
|
||||
<color name="icon_circle_border">#555555</color>
|
||||
<color name="selected_subscription_background">#1E3A8A</color>
|
||||
<color name="selected_subscription_border">#3B82F6</color>
|
||||
<color name="category_tag_background">#424242</color>
|
||||
<color name="card_stroke_color">#222222</color>
|
||||
<color name="card_background_color">#121212</color>
|
||||
</resources>
|
||||
|
||||
@@ -14,4 +14,7 @@
|
||||
<color name="icon_circle_border">#BBDEFB</color>
|
||||
<color name="selected_subscription_background">#E3F2FD</color>
|
||||
<color name="selected_subscription_border">#90CAF9</color>
|
||||
<color name="category_tag_background">#E0E0E0</color>
|
||||
<color name="card_stroke_color">#E0E0E0</color>
|
||||
<color name="card_background_color">#FFFFFF</color>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user