This commit is contained in:
shaulascr
2025-06-17 00:18:15 +07:00
committed by Gracia Hotmauli
parent e4fb409097
commit 6659ba4288
25 changed files with 816 additions and 188 deletions

View File

@ -487,7 +487,7 @@
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="3"
tools:listitem="@layout/item_related_product" />
tools:listitem="@layout/item_product_horizontal" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -0,0 +1,39 @@
<?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="wrap_content"
style="@style/Theme.Ecommerce_serang"
tools:context=".ui.product.listproduct.ListProductActivity">
<include
android:id="@+id/searchContainer"
layout="@layout/view_search_back"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent" />
<!-- <com.google.android.material.divider.MaterialDivider-->
<!-- android:id="@+id/divider_product"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="2dp"-->
<!-- app:layout_constraintTop_toBottomOf="@id/searchContainer"/>-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvProducts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="23dp"
app:layout_constraintTop_toBottomOf="@id/searchContainer"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="4dp"
app:spanCount="2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:listitem="@layout/item_product_grid"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -28,15 +28,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/banners"
android:layout_width="match_parent"
android:layout_height="132dp"
android:layout_marginTop="4dp"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/banner_default"
tools:layout_editor_absoluteX="16dp" />
<!-- <androidx.viewpager2.widget.ViewPager2-->
<!-- android:id="@+id/banners"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="132dp"-->
<!-- android:layout_marginTop="8dp"-->
<!-- android:background="@drawable/banner_default"-->
<!-- android:orientation="vertical"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- tools:layout_editor_absoluteX="0dp" />-->
<TextView
android:id="@+id/categoriesText"
@ -49,7 +49,7 @@
android:fontFamily="@font/dmsans_bold"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/banners" />
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/showAll"
@ -72,9 +72,12 @@
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingHorizontal="24dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_marginHorizontal="16dp"
app:spanCount="2"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintTop_toBottomOf="@id/categoriesText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:layout_editor_absoluteX="0dp"
tools:listitem="@layout/item_category_home" />
@ -110,7 +113,7 @@
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintTop_toBottomOf="@id/new_products_text"
tools:itemCount="5"
tools:listitem="@layout/item_section_horizontal" />

View File

@ -4,6 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/Theme.Ecommerce_serang"
tools:context=".ui.home.SearchHomeFragment">
<LinearLayout

View File

@ -1,36 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="88dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_width="110dp"
android:layout_height="115dp"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.card.MaterialCardView
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/imageLayout"
app:layout_constraintDimensionRatio="1:1"
app:cardCornerRadius="14dp"
app:layout_constraintDimensionRatio="1:1.15"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginEnd="8dp"
app:strokeWidth="1dp"
app:cardCornerRadius="4dp"
app:strokeColor="@color/gray_1">
<ImageView
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/image_category"
android:src="@drawable/makanan_ringan"
android:scaleType="centerCrop" />
</com.google.android.material.card.MaterialCardView>
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/image_category"
android:src="@drawable/makanan_ringan"
android:scaleType="centerCrop" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/tv_category"
android:backgroundTint="@color/blue_500"
android:layout_width="match_parent"
android:layout_height="0dp"
style="@style/MyCardView"
android:padding="2dp"
app:strokeWidth="1dp"
app:strokeColor="@color/blue_500"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="8dp"
android:textColor="@color/white"
android:lineSpacingExtra="0dp"
android:fontFamily="@font/dmsans_semibold"
android:textAlignment="center"
android:textSize="10sp"
android:text="@string/fragment_home_item_categories"/>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/name"
android:textAlignment="center"
android:text="@string/fragment_home_item_categories"
app:layout_constraintTop_toBottomOf="@id/imageLayout"
android:textSize="16sp"
android:textColor="@color/black"
android:layout_marginTop="12dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -57,14 +57,24 @@
<!-- Stock Status -->
<TextView
android:id="@+id/tv_stock_status"
android:layout_width="match_parent"
android:id="@+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Stock: 0"
android:background="@drawable/rating_background"
android:drawablePadding="4dp"
android:paddingStart="7dp"
android:paddingTop="5dp"
android:paddingEnd="11dp"
android:paddingBottom="3dp"
android:text="@string/rating"
android:textColor="@color/black"
android:fontFamily="@font/dmsans_regular"
android:textSize="12sp"
android:textColor="@color/black_200"
tools:text="Stock: 15" />
android:textAlignment="center"
android:gravity="center"
app:drawableStartCompat="@drawable/baseline_star_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_product_price" />
<TextView
android:id="@+id/tv_store_name"
@ -75,7 +85,7 @@
android:fontFamily="@font/dmsans_semibold"
android:textSize="14sp"
android:textColor="@color/black_200"
tools:text="Stock: 15" />
tools:text="Toko Jaya" />
</LinearLayout>

View File

@ -1,69 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="185dp"
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_margin="8dp"
app:cardCornerRadius="12dp"
app:cardElevation="4dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<com.google.android.material.card.MaterialCardView
android:id="@+id/imageLayout"
android:layout_width="150dp"
android:layout_height="0dp"
app:cardCornerRadius="14dp"
app:layout_constraintDimensionRatio="272:218"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:cardElevation="0dp"
app:strokeColor="@color/gray_1"
app:strokeWidth="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Product Image -->
<ImageView
android:id="@+id/image_product"
android:id="@+id/iv_product_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="160dp"
android:scaleType="centerCrop"
android:src="@color/blue1" />
</com.google.android.material.card.MaterialCardView>
android:background="@color/light_gray"
android:contentDescription="Product Image"
tools:src="@drawable/placeholder_image" />
<TextView
android:id="@+id/item_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:text="Banana"
android:textColor="@color/black"
android:fontFamily="@font/dmsans_medium"
android:textSize="16sp"
app:layout_constraintTop_toBottomOf="@id/imageLayout" />
<!-- Product Info -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dp">
<TextView
android:id="@+id/item_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/item_price_txt"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="16sp"
app:layout_constraintTop_toBottomOf="@id/item_name" />
<!-- Product Name -->
<TextView
android:id="@+id/tv_product_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Product Name"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/black_500"
android:maxLines="2"
android:ellipsize="end"
tools:text="Sample Product Name" />
<TextView
android:id="@+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rating_background"
android:drawablePadding="4dp"
android:paddingStart="7dp"
android:paddingTop="5dp"
android:paddingEnd="11dp"
android:paddingBottom="3dp"
android:text="@string/rating"
android:textColor="@color/black"
android:fontFamily="@font/dmsans_regular"
android:textSize="12sp"
android:textAlignment="center"
android:gravity="center"
app:drawableStartCompat="@drawable/baseline_star_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/item_price" />
<!-- Product Price -->
<TextView
android:id="@+id/tv_product_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Rp 0"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/blue_500"
tools:text="Rp 25,000" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Stock Status -->
<TextView
android:id="@+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rating_background"
android:drawablePadding="4dp"
android:paddingStart="7dp"
android:paddingTop="5dp"
android:paddingEnd="11dp"
android:paddingBottom="3dp"
android:text="@string/rating"
android:textColor="@color/black"
android:fontFamily="@font/dmsans_regular"
android:textSize="12sp"
android:textAlignment="center"
android:gravity="center"
app:drawableStartCompat="@drawable/baseline_star_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_product_price" />
<TextView
android:id="@+id/tv_store_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Toko Jaya"
android:fontFamily="@font/dmsans_semibold"
android:textSize="14sp"
android:textColor="@color/black_200"
tools:text="Toko Jaya" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -38,9 +38,10 @@
android:clipToPadding="false"
android:clipChildren="false"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="16dp"
android:orientation="horizontal"
tools:listitem="@layout/item_product_horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
tools:listitem="@layout/item_product_grid"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"/>
</androidx.constraintlayout.widget.ConstraintLayout>