mirror of
https://github.com/shaulascr/ecommerce_serang.git
synced 2025-08-10 17:32:22 +00:00
@ -4,10 +4,14 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.PopupMenu
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.data.api.dto.Product
|
||||
import com.alya.ecommerce_serang.data.api.dto.ProductsItem
|
||||
import com.bumptech.glide.Glide
|
||||
|
||||
@ -22,27 +26,37 @@ class ProductAdapter(
|
||||
private val tvProductPrice: TextView = itemView.findViewById(R.id.tv_product_price)
|
||||
private val tvProductStock: TextView = itemView.findViewById(R.id.tv_product_stock)
|
||||
private val tvProductStatus: TextView = itemView.findViewById(R.id.tv_product_status)
|
||||
private val ivMenu: ImageView = itemView.findViewById(R.id.iv_menu)
|
||||
|
||||
fun bind(product: ProductsItem) {
|
||||
tvProductName.text = product.name
|
||||
tvProductPrice.text = "Rp${product.price}"
|
||||
tvProductStock.text = "Stok: ${product.stock}"
|
||||
tvProductStatus.text = product.status
|
||||
|
||||
// Change color depending on status
|
||||
tvProductStatus.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
itemView.context,
|
||||
if (product.status.equals("active", true))
|
||||
R.color.darkblue_500 else R.color.black_500
|
||||
)
|
||||
)
|
||||
if (product.status.equals("active",true)) {
|
||||
tvProductStatus.text = "Aktif"
|
||||
tvProductStatus.setTextColor(ContextCompat.getColor(itemView.context, R.color.darkblue_500))
|
||||
tvProductStatus.background = ContextCompat.getDrawable(itemView.context, R.drawable.bg_product_active)
|
||||
} else {
|
||||
tvProductStatus.text = "Nonaktif"
|
||||
tvProductStatus.setTextColor(ContextCompat.getColor(itemView.context, R.color.black_500))
|
||||
tvProductStatus.background = ContextCompat.getDrawable(itemView.context, R.drawable.bg_product_inactive)
|
||||
}
|
||||
|
||||
Glide.with(itemView.context)
|
||||
.load(product.image)
|
||||
.placeholder(R.drawable.placeholder_image)
|
||||
.into(ivProduct)
|
||||
|
||||
ivMenu.setOnClickListener {
|
||||
// Show Bottom Sheet when menu is clicked
|
||||
val bottomSheetFragment = ProductOptionsBottomSheetFragment(product)
|
||||
bottomSheetFragment.show(
|
||||
(itemView.context as FragmentActivity).supportFragmentManager,
|
||||
bottomSheetFragment.tag
|
||||
)
|
||||
}
|
||||
|
||||
itemView.setOnClickListener {
|
||||
onItemClick(product)
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.alya.ecommerce_serang.ui.profile.mystore.product
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.data.api.dto.ProductsItem
|
||||
import com.alya.ecommerce_serang.databinding.FragmentProductOptionsBottomSheetBinding
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
|
||||
class ProductOptionsBottomSheetFragment(private val product: ProductsItem) : BottomSheetDialogFragment() {
|
||||
|
||||
private var _binding: FragmentProductOptionsBottomSheetBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
_binding = FragmentProductOptionsBottomSheetBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
binding.btnEditProduct.setOnClickListener {
|
||||
// Handle editing product
|
||||
// Example: Open the edit activity or fragment
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.btnDeleteProduct.setOnClickListener {
|
||||
// Handle deleting product
|
||||
// Example: Show confirmation dialog
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
@ -188,14 +188,14 @@ class StoreProductDetailActivity : AppCompatActivity() {
|
||||
val status = if (binding.switchIsActive.isChecked) "active" else "inactive"
|
||||
val categoryId = categoryList.getOrNull(binding.spinnerKategoriProduk.selectedItemPosition)?.id ?: 0
|
||||
|
||||
val imageFile = imageUri?.let { File(it.path) }
|
||||
val imageFile = imageUri?.let { uriToNamedFile(it, this, "productimg") }
|
||||
val sppirtFile = sppirtUri?.let { uriToNamedFile(it, this, "sppirt") }
|
||||
val halalFile = halalUri?.let { uriToNamedFile(it, this, "halal") }
|
||||
|
||||
Log.d("File URI", "SPPIRT URI: ${sppirtUri.toString()}")
|
||||
Log.d("File URI", "Halal URI: ${halalUri.toString()}")
|
||||
|
||||
val imagePart = imageFile?.let { createPartFromFile("image", it) }
|
||||
val imagePart = imageFile?.let { createPartFromFile("productimg", it) }
|
||||
val sppirtPart = sppirtFile?.let { createPartFromFile("sppirt", it) }
|
||||
val halalPart = halalFile?.let { createPartFromFile("halal", it) }
|
||||
|
||||
@ -219,9 +219,20 @@ class StoreProductDetailActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
fun getMimeType(file: File): String {
|
||||
val extension = file.extension
|
||||
return when (extension.lowercase()) {
|
||||
"jpg", "jpeg" -> "image/jpeg"
|
||||
"png" -> "image/png"
|
||||
"pdf" -> "application/pdf"
|
||||
else -> "application/octet-stream"
|
||||
}
|
||||
}
|
||||
|
||||
fun createPartFromFile(field: String, file: File?): MultipartBody.Part? {
|
||||
return file?.let {
|
||||
val requestBody = RequestBody.create("application/octet-stream".toMediaTypeOrNull(), it)
|
||||
val mimeType = getMimeType(it).toMediaTypeOrNull()
|
||||
val requestBody = RequestBody.create(mimeType, it)
|
||||
MultipartBody.Part.createFormData(field, it.name, requestBody)
|
||||
}
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable/ic_delete.png
Normal file
BIN
app/src/main/res/drawable/ic_delete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 425 B |
BIN
app/src/main/res/drawable/ic_location.png
Normal file
BIN
app/src/main/res/drawable/ic_location.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@ -75,7 +75,6 @@
|
||||
<Button
|
||||
android:id="@+id/btn_edit_profile"
|
||||
android:text="Ubah Profil Toko"
|
||||
android:textColor="@color/blue_500"
|
||||
style="@style/button.small.secondary.short"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
android:background="?android:attr/windowBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_edit_product"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_edit"
|
||||
android:contentDescription="Edit Icon" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ubah Produk"
|
||||
style="@style/label_large"
|
||||
android:layout_marginStart="16dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_delete_product"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_delete"
|
||||
android:contentDescription="Delete Icon" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hapus Produk"
|
||||
style="@style/label_large"
|
||||
android:layout_marginStart="16dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
318
app/src/main/res/layout/item_sells_payment.xml
Normal file
318
app/src/main/res/layout/item_sells_payment.xml
Normal file
@ -0,0 +1,318 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<!-- Payment Header -->
|
||||
<View
|
||||
android:id="@+id/shape_sells_title"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/shape_sells_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_payment_header"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
app:layout_constraintStart_toStartOf="@id/shape_sells_title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_title"
|
||||
style="@style/label_medium_prominent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="Pesanan Telah Dibayar"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_number"
|
||||
style="@style/label_small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black_300"
|
||||
android:text="No. Pesanan: 123456789"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:gravity="end">
|
||||
|
||||
<TextView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
style="@style/label_small"
|
||||
android:textAlignment="textEnd"
|
||||
android:text="Konfirmasi pembayaran sebelum:"
|
||||
android:textColor="@color/black_300" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_due"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="25 Okt; 23.59"
|
||||
style="@style/label_small"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:textColor="@color/darkblue_500"
|
||||
android:background="@drawable/bg_product_active" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Order Detail -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_payment_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_payment_header"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black_50"/>
|
||||
|
||||
<!-- Product Detail -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_payment_product_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="12dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/iv_payment_product"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="64dp"
|
||||
android:src="@drawable/placeholder_image"
|
||||
android:scaleType="centerCrop"
|
||||
android:contentDescription="Payment Product Image"
|
||||
app:shapeAppearanceOverlay="@style/store_product_image"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="13dp"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_payment_product"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_product_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="Jaket Pink Fuschia"
|
||||
style="@style/label_medium_prominent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_product_variant"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="S"
|
||||
style="@style/label_medium"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="13dp"
|
||||
android:gravity="end"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_payment_product"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_payment_product">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_product_qty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="x2"
|
||||
style="@style/label_medium"
|
||||
android:textColor="@color/black_300"
|
||||
android:textAlignment="textEnd"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_product_price"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="Rp150.000"
|
||||
style="@style/label_medium"
|
||||
android:textAlignment="textEnd"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_see_more"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true"
|
||||
android:text="Lihat 3 produk lainnya"
|
||||
android:gravity="center"
|
||||
style="@style/label_small"
|
||||
android:fontFamily="@font/dmsans_italic"
|
||||
android:textColor="@color/black_300"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_payment_product"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:clickable="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black_50"/>
|
||||
|
||||
<!-- Total Price -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_qty"
|
||||
style="@style/label_large"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="2 produk" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_alignParentEnd="true">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Total:"
|
||||
style="@style/label_large_prominent"
|
||||
android:textAlignment="textEnd"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Rp300.000"
|
||||
style="@style/label_large_prominent"
|
||||
android:textColor="@color/blue_500"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textAlignment="textEnd"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black_50"/>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="13dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="158dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_alignParentStart="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_person"
|
||||
app:tint="@color/black_500" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_customer"
|
||||
style="@style/label_small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textColor="@color/black_500"
|
||||
android:text="Gracia Hotmauli"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_location" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_payment_location"
|
||||
style="@style/label_small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textColor="@color/black_500"
|
||||
android:text="Serang"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm_payment"
|
||||
style="@style/button.small.active.medium"
|
||||
android:text="Konfirmasi Pembayaran"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="8dp"
|
||||
android:background="@color/black_50"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_payment_detail"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
255
app/src/main/res/layout/item_sells_shipment.xml
Normal file
255
app/src/main/res/layout/item_sells_shipment.xml
Normal file
@ -0,0 +1,255 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<!-- Shipment Header -->
|
||||
<View
|
||||
android:id="@+id/shape_sells_title"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/shape_sells_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_shipment_header"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
app:layout_constraintStart_toStartOf="@id/shape_sells_title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shipment_title"
|
||||
style="@style/label_medium_prominent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="Pesanan Perlu Dikirim"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shipment_number"
|
||||
style="@style/label_small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black_300"
|
||||
android:text="No. Pesanan: 123456789"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:gravity="end">
|
||||
|
||||
<TextView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
style="@style/label_small"
|
||||
android:textAlignment="textEnd"
|
||||
android:text="Kirim sebelum:"
|
||||
android:textColor="@color/black_300" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shipment_due"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="25 Okt; 23.59"
|
||||
style="@style/label_small"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:textColor="@color/darkblue_500"
|
||||
android:background="@drawable/bg_product_active" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Order Detail -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_shipment_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_shipment_header"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black_50"/>
|
||||
|
||||
<!-- Product Detail -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_shipment_product_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="12dp">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/iv_shipment_product"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/placeholder_image"
|
||||
android:scaleType="centerCrop"
|
||||
android:contentDescription="Shipment Product Image"
|
||||
app:shapeAppearanceOverlay="@style/store_product_image"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="13dp"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_shipment_product"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shipment_product_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="Jaket Pink Fuschia"
|
||||
style="@style/label_medium_prominent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shipment_product_variant"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="S"
|
||||
style="@style/label_medium"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shipment_product_qty"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="x2"
|
||||
style="@style/label_medium"
|
||||
android:layout_marginStart="13dp"
|
||||
android:gravity="end"
|
||||
android:textAlignment="textEnd"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_shipment_product"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_shipment_product"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_see_more"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true"
|
||||
android:text="Lihat 3 produk lainnya"
|
||||
android:gravity="center"
|
||||
style="@style/label_small"
|
||||
android:fontFamily="@font/dmsans_italic"
|
||||
android:textColor="@color/black_300"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_shipment_product"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:clickable="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black_50"/>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="13dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="158dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_alignParentStart="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_person"
|
||||
app:tint="@color/black_500" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shipment_customer"
|
||||
style="@style/label_small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textColor="@color/black_500"
|
||||
android:text="Gracia Hotmauli"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_location" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_shipment_location"
|
||||
style="@style/label_small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textColor="@color/black_500"
|
||||
android:text="Serang"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm_shipment"
|
||||
style="@style/button.small.active.medium"
|
||||
android:text="Kirim Pesanan"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="8dp"
|
||||
android:background="@color/black_50"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_shipment_detail"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
14
app/src/main/res/menu/product_options_menu.xml
Normal file
14
app/src/main/res/menu/product_options_menu.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/menu_edit_product"
|
||||
android:title="Ubah Produk"
|
||||
android:icon="@drawable/ic_edit"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/menu_delete_product"
|
||||
android:title="Hapus Produk"
|
||||
android:icon="@drawable/ic_delete"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
@ -147,7 +147,7 @@
|
||||
<!-- Buttons -->
|
||||
|
||||
<style name="button.large" parent="label_large_prominent">
|
||||
<item name="android:padding">10.91dp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:layout_height">40dp</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="backgroundTint">@null</item>
|
||||
@ -217,7 +217,7 @@
|
||||
</style>
|
||||
|
||||
<style name="button.small" parent="label_medium_prominent">
|
||||
<item name="android:padding">7dp</item>
|
||||
<item name="android:padding">2dp</item>
|
||||
<item name="android:layout_height">30dp</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="backgroundTint">@null</item>
|
||||
|
Reference in New Issue
Block a user