mirror of
https://github.com/shaulascr/ecommerce_serang.git
synced 2025-12-16 16:01:02 +00:00
Compare commits
8 Commits
86b5534cb3
...
7f4d04ac7a
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f4d04ac7a | |||
| 593231285a | |||
| d7ffd29032 | |||
| 7c7941d5b2 | |||
| 83c5f2acff | |||
| 971d489939 | |||
| 9b8c92605c | |||
| bc9b16b4af |
19
.idea/deploymentTargetSelector.xml
generated
19
.idea/deploymentTargetSelector.xml
generated
@ -4,14 +4,27 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2025-08-23T01:49:41.982701700Z">
|
||||
<DropdownSelection timestamp="2025-08-29T16:47:53.924316Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\Gracia Hotmauli\.android\avd\Pixel_9a.avd" />
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\Gracia Hotmauli\.android\avd\Pixel_9_3.avd" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
<DialogSelection>
|
||||
<targets>
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\Gracia Hotmauli\.android\avd\Pixel_9_3.avd" />
|
||||
</handle>
|
||||
</Target>
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\Gracia Hotmauli\.android\avd\Pixel_8.avd" />
|
||||
</handle>
|
||||
</Target>
|
||||
</targets>
|
||||
</DialogSelection>
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
package com.alya.ecommerce_serang.data.api.response.auth
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class DeleteFCMResponse(
|
||||
|
||||
@field:SerializedName("message")
|
||||
val message: String,
|
||||
|
||||
@field:SerializedName("user")
|
||||
val user: UserFCM
|
||||
)
|
||||
|
||||
data class UserFCM(
|
||||
|
||||
@field:SerializedName("name")
|
||||
val name: String,
|
||||
|
||||
@field:SerializedName("id")
|
||||
val id: Int,
|
||||
|
||||
@field:SerializedName("email")
|
||||
val email: String
|
||||
)
|
||||
@ -62,6 +62,9 @@ data class Product(
|
||||
@field:SerializedName("wholesale_min_item")
|
||||
val wholesaleMinItem: Int? = null,
|
||||
|
||||
@field:SerializedName("status")
|
||||
val status: String,
|
||||
|
||||
@field:SerializedName("min_order")
|
||||
val minOrder: Int,
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ import com.alya.ecommerce_serang.data.api.dto.UpdateCart
|
||||
import com.alya.ecommerce_serang.data.api.dto.UpdateChatRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.VerifRegisReq
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.ChangePassResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.DeleteFCMResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.FcmTokenResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.HasStoreResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.ListNotifResponse
|
||||
@ -106,6 +107,10 @@ interface ApiService {
|
||||
@Body verifRegisReq: VerifRegisReq
|
||||
):VerifRegisterResponse
|
||||
|
||||
@PUT("deletefcm")
|
||||
suspend fun deleteFCMToken (
|
||||
): DeleteFCMResponse
|
||||
|
||||
@Multipart
|
||||
@POST("registerstore")
|
||||
suspend fun registerStore(
|
||||
|
||||
@ -12,6 +12,7 @@ import com.alya.ecommerce_serang.data.api.dto.ResetPassReq
|
||||
import com.alya.ecommerce_serang.data.api.dto.UserProfile
|
||||
import com.alya.ecommerce_serang.data.api.dto.VerifRegisReq
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.ChangePassResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.DeleteFCMResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.FcmTokenResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.HasStoreResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.ListStoreTypeResponse
|
||||
@ -541,6 +542,10 @@ class UserRepository(private val apiService: ApiService) {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun deleteFCMToken(): DeleteFCMResponse{
|
||||
return apiService.deleteFCMToken()
|
||||
}
|
||||
|
||||
companion object{
|
||||
private const val TAG = "UserRepository"
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ import com.alya.ecommerce_serang.data.repository.UserRepository
|
||||
import com.alya.ecommerce_serang.databinding.ActivityAddAddressBinding
|
||||
import com.alya.ecommerce_serang.utils.SavedStateViewModelFactory
|
||||
import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.applyLiveCounter
|
||||
|
||||
class AddAddressActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityAddAddressBinding
|
||||
@ -65,6 +66,12 @@ class AddAddressActivity : AppCompatActivity() {
|
||||
binding = ActivityAddAddressBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.etDetailAlamat,
|
||||
binding.tvCountDetail,
|
||||
binding.tvCountDetailMax
|
||||
)
|
||||
|
||||
sessionManager = SessionManager(this)
|
||||
apiService = ApiConfig.getApiService(sessionManager)
|
||||
locationManager = getSystemService(LOCATION_SERVICE) as LocationManager
|
||||
|
||||
@ -222,8 +222,6 @@ class AddEvidencePaymentActivity : AppCompatActivity() {
|
||||
val adapter = object : ArrayAdapter<String>(this, R.layout.item_dialog_add_evidence, R.id.tvOption, options) {
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
val view = super.getView(position, convertView, parent)
|
||||
val divider = view.findViewById<View>(R.id.divider)
|
||||
divider.visibility = if (position == count - 1) View.GONE else View.VISIBLE
|
||||
return view
|
||||
}
|
||||
}
|
||||
@ -455,9 +453,6 @@ class AddEvidencePaymentActivity : AppCompatActivity() {
|
||||
).show()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
companion object {
|
||||
private const val PERMISSION_REQUEST_CODE = 100
|
||||
private const val TAG = "AddEvidenceActivity"
|
||||
|
||||
@ -742,7 +742,7 @@ class DetailOrderStatusActivity : AppCompatActivity() {
|
||||
inputFormat.timeZone = TimeZone.getTimeZone("UTC")
|
||||
|
||||
// Output format
|
||||
val outputFormat = SimpleDateFormat("dd MMMM yyyy", Locale("id", "ID"))
|
||||
val outputFormat = SimpleDateFormat("dd MMM yyyy", Locale("id", "ID"))
|
||||
|
||||
// Parse the input date
|
||||
val date = inputFormat.parse(dateString)
|
||||
|
||||
@ -224,6 +224,7 @@ class ProfileFragment : Fragment() {
|
||||
delay(500)
|
||||
loadingDialog.dismiss()
|
||||
sessionManager.clearAll()
|
||||
viewModel.deleteFCM()
|
||||
val intent = Intent(requireContext(), LoginActivity::class.java)
|
||||
startActivity(intent)
|
||||
requireActivity().finish()
|
||||
|
||||
@ -51,7 +51,6 @@ class MyStoreActivity : AppCompatActivity() {
|
||||
|
||||
enableEdgeToEdge()
|
||||
|
||||
|
||||
binding.headerMyStore.headerTitle.text = "Toko Saya"
|
||||
|
||||
binding.headerMyStore.headerLeftIcon.setOnClickListener {
|
||||
@ -107,22 +106,23 @@ class MyStoreActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
binding.tvHistory.setOnClickListener {
|
||||
startActivity(Intent(this, SellsActivity::class.java))
|
||||
//startActivity(Intent(this, SellsActivity::class.java))
|
||||
startSellsActivityWithStatus("all")
|
||||
}
|
||||
|
||||
binding.layoutPerluTagihan.setOnClickListener {
|
||||
startActivity(Intent(this, SellsActivity::class.java))
|
||||
//navigateToSellsFragment("pending")
|
||||
//startActivity(Intent(this, SellsActivity::class.java))
|
||||
startSellsActivityWithStatus("unpaid")
|
||||
}
|
||||
|
||||
binding.layoutPembayaran.setOnClickListener {
|
||||
startActivity(Intent(this, SellsActivity::class.java))
|
||||
//navigateToSellsFragment("paid")
|
||||
//startActivity(Intent(this, SellsActivity::class.java))
|
||||
startSellsActivityWithStatus("paid")
|
||||
}
|
||||
|
||||
binding.layoutPerluDikirim.setOnClickListener {
|
||||
startActivity(Intent(this, SellsActivity::class.java))
|
||||
//navigateToSellsFragment("processed")
|
||||
//startActivity(Intent(this, SellsActivity::class.java))
|
||||
startSellsActivityWithStatus("processed")
|
||||
}
|
||||
|
||||
binding.layoutProductMenu.setOnClickListener {
|
||||
@ -206,6 +206,12 @@ class MyStoreActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun startSellsActivityWithStatus(status: String?) {
|
||||
val intent = Intent(this, SellsActivity::class.java)
|
||||
intent.putExtra(SellsActivity.EXTRA_INITIAL_STATUS, status)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
lifecycleScope.launch {
|
||||
|
||||
@ -42,6 +42,7 @@ import com.alya.ecommerce_serang.utils.ImageUtils
|
||||
import com.alya.ecommerce_serang.utils.PopUpDialog
|
||||
import com.alya.ecommerce_serang.utils.RegisterStoreViewModelFactory
|
||||
import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.applyLiveCounter
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.MyStoreViewModel
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.RegisterStoreViewModel
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
@ -102,6 +103,30 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
binding = ActivityRegisterStoreBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.etStoreName,
|
||||
binding.tvCountName,
|
||||
binding.tvCountNameMax
|
||||
)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.etStoreDescription,
|
||||
binding.tvCountDesc,
|
||||
binding.tvCountDescMax
|
||||
)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.etStreet,
|
||||
binding.tvCountStreet,
|
||||
binding.tvCountStreetMax
|
||||
)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.etAddressDetail,
|
||||
binding.tvCountAddressDetail,
|
||||
binding.tvCountAddressDetailMax
|
||||
)
|
||||
|
||||
sessionManager = SessionManager(this)
|
||||
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
|
||||
@ -31,6 +31,7 @@ import com.alya.ecommerce_serang.utils.CompressionResult
|
||||
import com.alya.ecommerce_serang.utils.FileUtils.compressFileToMax1MB
|
||||
import com.alya.ecommerce_serang.utils.ImageUtils.compressImage
|
||||
import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.applyLiveCounter
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.ProductViewModel
|
||||
import com.bumptech.glide.Glide
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
@ -116,6 +117,18 @@ class DetailStoreProductActivity : AppCompatActivity() {
|
||||
binding = ActivityDetailStoreProductBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.edtNamaProduk,
|
||||
binding.tvCountName,
|
||||
binding.tvCountNameMax
|
||||
)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.edtDeskripsiProduk,
|
||||
binding.tvCountDesc,
|
||||
binding.tvCountDescMax
|
||||
)
|
||||
|
||||
isEditing = intent.getBooleanExtra("is_editing", false)
|
||||
productId = intent.getIntExtra("product_id", -1)
|
||||
|
||||
@ -271,6 +284,9 @@ class DetailStoreProductActivity : AppCompatActivity() {
|
||||
binding.switcherHalal.showNext()
|
||||
}
|
||||
|
||||
binding.switchIsActive.isChecked = product.status == "active"
|
||||
binding.switchIsActive.jumpDrawablesToCurrentState()
|
||||
|
||||
validateForm()
|
||||
}
|
||||
|
||||
@ -418,8 +434,8 @@ class DetailStoreProductActivity : AppCompatActivity() {
|
||||
|
||||
Log.d(TAG, "SPPIRT URI: ${sppirtUri.toString()}")
|
||||
Log.d(TAG, "Halal URI: ${halalUri.toString()}")
|
||||
logFileInfo("Sppirt Size", sppirtFile!!)
|
||||
logFileInfo("Halal Size", halalFile!!)
|
||||
sppirtFile?.let { logFileInfo("Sppirt Size", it) }
|
||||
halalFile?.let { logFileInfo("Halal Size", it) }
|
||||
|
||||
val imagePart = imageFile?.let { createPartFromFile("productimg", it) }
|
||||
val sppirtPart = sppirtFile?.let { createPartFromFile("sppirt", it) }
|
||||
|
||||
@ -22,6 +22,7 @@ import com.alya.ecommerce_serang.data.repository.Result
|
||||
import com.alya.ecommerce_serang.databinding.ActivityDetailStoreAddressBinding
|
||||
import com.alya.ecommerce_serang.utils.BaseViewModelFactory
|
||||
import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.applyLiveCounter
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.AddressViewModel
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
|
||||
@ -55,6 +56,18 @@ class DetailStoreAddressActivity : AppCompatActivity() {
|
||||
binding = ActivityDetailStoreAddressBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.edtStreet,
|
||||
binding.tvCountStreet,
|
||||
binding.tvCountStreetMax
|
||||
)
|
||||
|
||||
applyLiveCounter(
|
||||
binding.edtDetailAddress,
|
||||
binding.tvCountDetail,
|
||||
binding.tvCountDetailMax
|
||||
)
|
||||
|
||||
sessionManager = SessionManager(this)
|
||||
apiService = ApiConfig.getApiService(sessionManager)
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@ package com.alya.ecommerce_serang.ui.profile.mystore.sells
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@ -12,7 +11,6 @@ import com.alya.ecommerce_serang.data.api.retrofit.ApiConfig
|
||||
import com.alya.ecommerce_serang.data.repository.AddressRepository
|
||||
import com.alya.ecommerce_serang.data.repository.SellsRepository
|
||||
import com.alya.ecommerce_serang.databinding.ActivityDetailSellsBinding
|
||||
import com.alya.ecommerce_serang.ui.profile.mystore.sells.shipment.DetailShipmentActivity
|
||||
import com.alya.ecommerce_serang.utils.BaseViewModelFactory
|
||||
import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.AddressViewModel
|
||||
@ -22,7 +20,6 @@ import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.Locale
|
||||
import java.util.TimeZone
|
||||
import kotlin.getValue
|
||||
|
||||
class DetailSellsActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityDetailSellsBinding
|
||||
@ -100,8 +97,9 @@ class DetailSellsActivity : AppCompatActivity() {
|
||||
tvOrderCustomer.text = sell.username
|
||||
tvOrderDate.text = formatDate(sell.updatedAt.toString())
|
||||
tvOrderTotalProduct.text = "(${sell.orderItems?.size ?: 0} Barang)"
|
||||
tvOrderSubtotal.text = formatPrice(sell.totalAmount.toString())
|
||||
tvOrderShipPrice.text = formatPrice(sell.shipmentPrice.toString())
|
||||
val totalPrice = (sell.totalAmount?.toDouble()?.toInt() ?: 0) - (sell.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvOrderSubtotal.text = formatPrice(totalPrice.toString())
|
||||
tvOrderPrice.text = formatPrice(sell.totalAmount.toString())
|
||||
tvOrderRecipient.text = sell.recipient ?: "-"
|
||||
tvOrderRecipientNum.text = sell.receiptNum?.toString() ?: "-"
|
||||
|
||||
@ -8,6 +8,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.widget.doAfterTextChanged
|
||||
import androidx.fragment.app.commit
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiConfig
|
||||
@ -18,6 +19,9 @@ import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.SellsViewModel
|
||||
|
||||
class SellsActivity : AppCompatActivity() {
|
||||
companion object {
|
||||
const val EXTRA_INITIAL_STATUS = "extra_initial_status"
|
||||
}
|
||||
private lateinit var binding: ActivitySellsBinding
|
||||
private lateinit var sessionManager: SessionManager
|
||||
|
||||
@ -68,11 +72,18 @@ class SellsActivity : AppCompatActivity() {
|
||||
onBackPressed()
|
||||
finish()
|
||||
}
|
||||
|
||||
// binding.edtSearch.doAfterTextChanged {
|
||||
// val q = it?.toString()?.trim().orEmpty()
|
||||
// (supportFragmentManager.findFragmentById(R.id.fragment_container_sells) as? SellsFragment)
|
||||
// ?.onSearchQueryChanged(q)
|
||||
// }
|
||||
}
|
||||
|
||||
private fun showSellsFragment() {
|
||||
val initialStatus = intent.getStringExtra(EXTRA_INITIAL_STATUS)
|
||||
supportFragmentManager.commit {
|
||||
replace(R.id.fragment_container_sells, SellsFragment())
|
||||
replace(R.id.fragment_container_sells, SellsFragment.newInstance(initialStatus))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -186,7 +186,9 @@ class SellsAdapter(
|
||||
.into(ivSellsProduct)
|
||||
|
||||
tvSellsQty.text = "${order.orderItems?.size} produk"
|
||||
tvSellsPrice.text = order.totalAmount?.let { formatPrice(it.toDouble().toInt()) }
|
||||
val totalPrice = (order.totalAmount?.toDouble()?.toInt() ?: 0) - (order.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvSellsPrice.text =formatPrice(totalPrice).toString()
|
||||
Log.d("SellsAdapter", "Cek price:$totalPrice" )
|
||||
}
|
||||
"paid" -> {
|
||||
layoutOrders.visibility = View.GONE
|
||||
@ -206,7 +208,9 @@ class SellsAdapter(
|
||||
tvSellsTitle.text = "Pesanan Telah Dibayar"
|
||||
tvSellsDueDesc.text = "Konfirmasi pembayaran sebelum:"
|
||||
tvSellsDue.text = formatDueDate(order.updatedAt.toString(), 2)
|
||||
|
||||
val totalPrice = (order.totalAmount?.toDouble()?.toInt() ?: 0) - (order.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvSellsPrice.text =formatPrice(totalPrice).toString()
|
||||
tvSellsQty.text = "${order.orderItems?.size} produk"
|
||||
}
|
||||
"processed" -> {
|
||||
layoutOrders.visibility = View.GONE
|
||||
@ -235,6 +239,10 @@ class SellsAdapter(
|
||||
tvSellsLocation.text = order.subdistrict
|
||||
tvSellsCustomer.text = order.username
|
||||
tvSellsDue.text = formatDueDate(order.updatedAt.toString(), 2)
|
||||
tvSellsQty.text = "${order.orderItems?.size} produk"
|
||||
val totalPrice = (order.totalAmount?.toDouble()?.toInt() ?: 0) - (order.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvSellsPrice.text =formatPrice(totalPrice).toString()
|
||||
|
||||
}
|
||||
"shipped" -> {
|
||||
layoutOrders.visibility = View.GONE
|
||||
@ -246,7 +254,11 @@ class SellsAdapter(
|
||||
|
||||
tvSellsDue.text = formatDueDate(order.updatedAt.toString(), 0)
|
||||
tvSellsDue.background = itemView.context.getDrawable(R.drawable.bg_product_inactive)
|
||||
tvSellsQty.text = "${order.orderItems?.size} produk"
|
||||
btnConfirmPayment.visibility = View.GONE
|
||||
|
||||
val totalPrice = (order.totalAmount?.toDouble()?.toInt() ?: 0) - (order.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvSellsPrice.text =formatPrice(totalPrice).toString()
|
||||
}
|
||||
"delivered" -> {
|
||||
layoutOrders.visibility = View.GONE
|
||||
@ -257,8 +269,13 @@ class SellsAdapter(
|
||||
tvSellsDueDesc.text = "Dikirimkan pada"
|
||||
|
||||
tvSellsDue.text = formatDueDate(order.updatedAt.toString(), 0)
|
||||
tvSellsQty.text = "${order.orderItems?.size} produk"
|
||||
|
||||
tvSellsDue.background = itemView.context.getDrawable(R.drawable.bg_product_inactive)
|
||||
btnConfirmPayment.visibility = View.GONE
|
||||
|
||||
val totalPrice = (order.totalAmount?.toDouble()?.toInt() ?: 0) - (order.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvSellsPrice.text =formatPrice(totalPrice).toString()
|
||||
}
|
||||
"completed" -> {
|
||||
layoutOrders.visibility = View.GONE
|
||||
@ -269,8 +286,13 @@ class SellsAdapter(
|
||||
tvSellsDueDesc.text = "Selesai pada"
|
||||
|
||||
tvSellsDue.text = formatDueDate(order.updatedAt.toString(), 0)
|
||||
tvSellsQty.text = "${order.orderItems?.size} produk"
|
||||
|
||||
tvSellsDue.background = itemView.context.getDrawable(R.drawable.bg_product_inactive)
|
||||
btnConfirmPayment.visibility = View.GONE
|
||||
|
||||
val totalPrice = (order.totalAmount?.toDouble()?.toInt() ?: 0) - (order.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvSellsPrice.text =formatPrice(totalPrice).toString()
|
||||
}
|
||||
"canceled" -> {
|
||||
layoutOrders.visibility = View.GONE
|
||||
@ -281,6 +303,10 @@ class SellsAdapter(
|
||||
tvSellsDueDesc.text = "Dibatalkan pada"
|
||||
|
||||
tvSellsDue.text = formatDueDate(order.updatedAt.toString(), 0)
|
||||
tvSellsQty.text = "${order.orderItems?.size} produk"
|
||||
val totalPrice = (order.totalAmount?.toDouble()?.toInt() ?: 0) - (order.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvSellsPrice.text =formatPrice(totalPrice).toString()
|
||||
|
||||
tvSellsDue.background = itemView.context.getDrawable(R.drawable.bg_product_inactive)
|
||||
btnConfirmPayment.visibility = View.GONE
|
||||
}
|
||||
|
||||
@ -17,8 +17,19 @@ import com.alya.ecommerce_serang.utils.viewmodel.SellsViewModel
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
|
||||
class SellsFragment : Fragment() {
|
||||
companion object {
|
||||
private const val ARG_INITIAL_STATUS = "arg_initial_status"
|
||||
|
||||
fun newInstance(initialStatus: String?): SellsFragment =
|
||||
SellsFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString(ARG_INITIAL_STATUS, initialStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var _binding: FragmentSellsBinding? = null
|
||||
// private var currentSearchQuery = ""
|
||||
private val binding get() = _binding!!
|
||||
private lateinit var sessionManager: SessionManager
|
||||
|
||||
@ -45,6 +56,8 @@ class SellsFragment : Fragment() {
|
||||
sessionManager = SessionManager(requireContext())
|
||||
|
||||
setupViewPager()
|
||||
jumpToInitialStatusIfAny()
|
||||
// binding.viewPagerSells.post { currentPage()?.filter(currentSearchQuery) }
|
||||
}
|
||||
|
||||
private fun setupViewPager() {
|
||||
@ -70,12 +83,60 @@ class SellsFragment : Fragment() {
|
||||
statusPage()
|
||||
}
|
||||
|
||||
private fun statusPage(){
|
||||
private fun jumpToInitialStatusIfAny() {
|
||||
val initial = arguments?.getString(ARG_INITIAL_STATUS)?.trim().orEmpty()
|
||||
if (initial.isEmpty()) return
|
||||
|
||||
// Try adapter’s list first
|
||||
var index = viewPagerAdapter.sellsStatuses.indexOf(initial)
|
||||
|
||||
// Fallback mapping (keeps working if the adapter changes order names)
|
||||
if (index < 0) {
|
||||
index = when (initial) {
|
||||
"all" -> 0
|
||||
"unpaid" -> 1
|
||||
"paid" -> 2
|
||||
"processed" -> 3
|
||||
"shipped" -> 4
|
||||
"delivered" -> 5
|
||||
"completed" -> 6
|
||||
"canceled" -> 7
|
||||
else -> 0
|
||||
}
|
||||
}
|
||||
|
||||
if (index in 0 until (binding.viewPagerSells.adapter?.itemCount ?: 0)) {
|
||||
// Ensure pager is ready, then jump without animation
|
||||
binding.viewPagerSells.post {
|
||||
binding.viewPagerSells.setCurrentItem(index, false)
|
||||
// Make sure ViewModel filter matches the shown tab
|
||||
sellsVm.updateStatus(
|
||||
viewPagerAdapter.sellsStatuses.getOrNull(index) ?: initial,
|
||||
forceRefresh = true
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fun onSearchQueryChanged(q: String) {
|
||||
// currentSearchQuery = q
|
||||
// currentPage()?.filter(q)
|
||||
// }
|
||||
|
||||
// private fun currentPage(): SellsListFragment? {
|
||||
// val pos = binding.viewPagerSells.currentItem
|
||||
// val tag = "f${viewPagerAdapter.getItemId(pos)}" // requires stable ids in adapter (see step 4)
|
||||
// return childFragmentManager.findFragmentByTag(tag) as? SellsListFragment
|
||||
// }
|
||||
|
||||
private fun statusPage() {
|
||||
binding.viewPagerSells.registerOnPageChangeCallback(
|
||||
object : ViewPager2.OnPageChangeCallback() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
val status = viewPagerAdapter.sellsStatuses[position]
|
||||
sellsVm.updateStatus(status, forceRefresh = true)
|
||||
// re-apply query when user switches tab
|
||||
// currentPage()?.filter(currentSearchQuery)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@ -25,6 +25,7 @@ import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.SellsViewModel
|
||||
import com.google.gson.Gson
|
||||
import kotlinx.coroutines.launch
|
||||
import java.util.Locale
|
||||
|
||||
class SellsListFragment : Fragment() {
|
||||
|
||||
@ -41,6 +42,13 @@ class SellsListFragment : Fragment() {
|
||||
}
|
||||
private lateinit var sellsAdapter: SellsAdapter
|
||||
private var status: String = "all"
|
||||
// private var allOrders: List<OrdersItem> = emptyList()
|
||||
// private var currentQuery: String = ""
|
||||
//
|
||||
// fun filter(query: String) {
|
||||
// currentQuery = query
|
||||
// applyFilter()
|
||||
// }
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SellsListFragment"
|
||||
@ -89,6 +97,29 @@ class SellsListFragment : Fragment() {
|
||||
observePaymentConfirmation()
|
||||
}
|
||||
|
||||
// private fun applyFilter() {
|
||||
// val q = currentQuery.lowercase(Locale.getDefault())
|
||||
// val filtered = if (q.isBlank()) {
|
||||
// allOrders
|
||||
// } else {
|
||||
// allOrders.filter { it.matches(q) }
|
||||
// }
|
||||
//
|
||||
// sellsAdapter.submitList(filtered)
|
||||
// binding.tvEmptyState.visibility = if (filtered.isEmpty()) View.VISIBLE else View.GONE
|
||||
// binding.rvSells.visibility = if (filtered.isEmpty()) View.GONE else View.VISIBLE
|
||||
// }
|
||||
//
|
||||
// private fun OrdersItem.matches(q: String): Boolean {
|
||||
// val id = orderId?.toString()?.lowercase(Locale.getDefault()) ?: ""
|
||||
// val customer = username?.lowercase(Locale.getDefault()) ?: ""
|
||||
// val location = subdistrict?.lowercase(Locale.getDefault()) ?: ""
|
||||
// val productHit = orderItems?.any { it?.productName
|
||||
// ?.lowercase(Locale.getDefault())?.contains(q) == true } == true
|
||||
//
|
||||
// return id.contains(q) || customer.contains(q) || location.contains(q) || productHit
|
||||
// }
|
||||
|
||||
private fun setupRecyclerView() {
|
||||
Log.d(TAG, "Setting up RecyclerView")
|
||||
sellsAdapter = SellsAdapter(
|
||||
@ -118,6 +149,8 @@ class SellsListFragment : Fragment() {
|
||||
is ViewState.Success -> {
|
||||
binding.progressBar.visibility = View.GONE
|
||||
Log.d(TAG, "Data received: ${result.data?.size ?: 0} items")
|
||||
// allOrders = result.data ?: emptyList()
|
||||
// applyFilter() // ← apply current query to fresh data
|
||||
|
||||
if (result.data.isNullOrEmpty()) {
|
||||
binding.rvSells.visibility = View.GONE
|
||||
@ -135,7 +168,8 @@ class SellsListFragment : Fragment() {
|
||||
|
||||
sellsAdapter.submitList(result.data)
|
||||
Log.d(TAG, "Data submitted to adapter")
|
||||
Log.d(TAG, "Adapter item count: ${sellsAdapter.itemCount}") }
|
||||
Log.d(TAG, "Adapter item count: ${sellsAdapter.itemCount}")
|
||||
}
|
||||
}
|
||||
is ViewState.Error -> {
|
||||
Log.e(TAG, "❌ ViewState.Error received: ${result.message}")
|
||||
@ -144,9 +178,7 @@ class SellsListFragment : Fragment() {
|
||||
binding.tvEmptyState.visibility = View.VISIBLE
|
||||
// Toast.makeText(requireContext(), result.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
is ViewState.Loading -> {
|
||||
binding.progressBar.visibility = View.VISIBLE
|
||||
}
|
||||
is ViewState.Loading -> binding.progressBar.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -213,7 +245,7 @@ class SellsListFragment : Fragment() {
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
viewModel.getSellList(status)
|
||||
observeSellsList()
|
||||
//observeSellsList()
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
||||
@ -26,4 +26,7 @@ class SellsViewPagerAdapter(
|
||||
// Create a new instance of SellsListFragment with the appropriate status
|
||||
return SellsListFragment.newInstance(sellsStatuses[position])
|
||||
}
|
||||
// override fun getItemId(position: Int): Long = sellsStatuses[position].hashCode().toLong()
|
||||
// override fun containsItem(itemId: Long): Boolean =
|
||||
// sellsStatuses.any { it.hashCode().toLong() == itemId }
|
||||
}
|
||||
@ -145,7 +145,8 @@ class DetailPaymentActivity : AppCompatActivity() {
|
||||
tvOrderCustomer.text = sell.username
|
||||
tvOrderDate.text = formatDate(sell.updatedAt.toString())
|
||||
tvOrderTotalProduct.text = "(${sell.orderItems?.size ?: 0} Barang)"
|
||||
tvOrderSubtotal.text = formatPrice(sell.totalAmount.toString())
|
||||
val totalPrice = (sell.totalAmount?.toDouble()?.toInt() ?: 0) - (sell.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvOrderSubtotal.text = formatPrice(totalPrice.toString())
|
||||
tvOrderShipPrice.text = formatPrice(sell.shipmentPrice.toString())
|
||||
tvOrderPrice.text = formatPrice(sell.totalAmount.toString())
|
||||
tvOrderDue.text = formatDueDate(sell.updatedAt.toString(), 2)
|
||||
|
||||
@ -101,7 +101,8 @@ class DetailShipmentActivity : AppCompatActivity() {
|
||||
tvOrderCustomer.text = sell.username
|
||||
tvOrderDate.text = formatDate(sell.updatedAt.toString())
|
||||
tvOrderTotalProduct.text = "(${sell.orderItems?.size ?: 0} Barang)"
|
||||
tvOrderSubtotal.text = formatPrice(sell.totalAmount.toString())
|
||||
val totalPrice = (sell.totalAmount?.toDouble()?.toInt() ?: 0) - (sell.shipmentPrice?.toDouble()?.toInt() ?: 0)
|
||||
tvOrderSubtotal.text = formatPrice(totalPrice.toString())
|
||||
tvOrderShipPrice.text = formatPrice(sell.shipmentPrice.toString())
|
||||
tvOrderPrice.text = formatPrice(sell.totalAmount.toString())
|
||||
tvOrderDue.text = formatDueDate(sell.updatedAt.toString(), 2)
|
||||
|
||||
@ -4,6 +4,9 @@ import android.os.Bundle
|
||||
import android.widget.Toast
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.widget.doAfterTextChanged
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.data.api.response.store.sells.Orders
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiConfig
|
||||
import com.alya.ecommerce_serang.data.repository.SellsRepository
|
||||
@ -47,6 +50,8 @@ class ShipmentConfirmationActivity : AppCompatActivity() {
|
||||
binding.edtKurir.setText(sells?.courier ?: "")
|
||||
binding.edtLayananKirim.setText(sells?.service ?: "")
|
||||
|
||||
setupValidation()
|
||||
|
||||
binding.btnConfirm.setOnClickListener {
|
||||
val receiptNum = binding.edtNoResi.text.toString().trim()
|
||||
val orderId = sells?.orderId
|
||||
@ -68,4 +73,32 @@ class ShipmentConfirmationActivity : AppCompatActivity() {
|
||||
if (success) finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupValidation() {
|
||||
// Re-validate whenever any field changes
|
||||
listOf(
|
||||
binding.edtKurir,
|
||||
binding.edtLayananKirim,
|
||||
binding.edtNoResi
|
||||
).forEach { edit ->
|
||||
edit.doAfterTextChanged { validateForm() }
|
||||
}
|
||||
// Initial state
|
||||
validateForm()
|
||||
}
|
||||
|
||||
private fun validateForm() {
|
||||
val allFilled = binding.edtKurir.text?.toString()?.trim()?.isNotEmpty() == true &&
|
||||
binding.edtLayananKirim.text?.toString()?.trim()?.isNotEmpty() == true &&
|
||||
binding.edtNoResi.text?.toString()?.trim()?.isNotEmpty() == true
|
||||
|
||||
binding.btnConfirm.isEnabled = allFilled
|
||||
binding.btnConfirm.setBackgroundResource(
|
||||
if (allFilled) R.drawable.bg_button_active else R.drawable.bg_button_disabled
|
||||
)
|
||||
binding.btnConfirm.setTextColor(
|
||||
ContextCompat.getColor(this, if (allFilled) R.color.white else R.color.black_300)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,8 +1,12 @@
|
||||
package com.alya.ecommerce_serang.utils
|
||||
|
||||
import android.os.Build
|
||||
import android.text.InputFilter
|
||||
import android.view.View
|
||||
import android.view.WindowInsetsController
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import androidx.core.widget.doAfterTextChanged
|
||||
import androidx.fragment.app.Fragment
|
||||
|
||||
fun Fragment.setLightStatusBar(){
|
||||
@ -19,4 +23,27 @@ fun Fragment.setLightStatusBar(){
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public fun applyLiveCounter(
|
||||
editText: EditText,
|
||||
tvCount: TextView,
|
||||
tvMax: TextView
|
||||
) {
|
||||
val max = tvMax.text.toString().toIntOrNull() ?: Int.MAX_VALUE
|
||||
|
||||
// Replace any existing LengthFilter with the new max
|
||||
val current = editText.filters?.toMutableList() ?: mutableListOf()
|
||||
current.removeAll { it is InputFilter.LengthFilter }
|
||||
current.add(InputFilter.LengthFilter(max))
|
||||
editText.filters = current.toTypedArray()
|
||||
|
||||
// Set initial count (handles prefilled text / edit mode)
|
||||
tvCount.text = (editText.text?.length ?: 0).toString()
|
||||
|
||||
// Update on change
|
||||
editText.doAfterTextChanged {
|
||||
val len = it?.length ?: 0
|
||||
tvCount.text = len.toString()
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,7 @@ import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.alya.ecommerce_serang.data.api.dto.UserProfile
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.ChangePassResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.DeleteFCMResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.HasStoreResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.customer.profile.EditProfileResponse
|
||||
import com.alya.ecommerce_serang.data.repository.Result
|
||||
@ -27,6 +28,10 @@ class ProfileViewModel(private val userRepository: UserRepository) : ViewModel()
|
||||
|
||||
private val _checkStore = MutableLiveData<Boolean>()
|
||||
val checkStore: LiveData<Boolean> = _checkStore
|
||||
|
||||
private val _deleteFCMT = MutableLiveData<String>()
|
||||
val deleteFCMT: LiveData<String> = _deleteFCMT
|
||||
|
||||
val changePasswordResult = MutableLiveData<Result<ChangePassResponse>>()
|
||||
private val _logout = MutableLiveData<Boolean>()
|
||||
val logout : LiveData<Boolean> = _logout
|
||||
@ -61,7 +66,25 @@ class ProfileViewModel(private val userRepository: UserRepository) : ViewModel()
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteFCM(){
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
// Call the repository function to request OTP
|
||||
val response: DeleteFCMResponse = userRepository.deleteFCMToken()
|
||||
|
||||
// Log and store success message
|
||||
Log.d("ProfileViewModel", "Has store: ${response.message}")
|
||||
_deleteFCMT.postValue(response.message) // Store the message for UI feedback
|
||||
|
||||
} catch (exception: Exception) {
|
||||
// Handle any errors and update state
|
||||
_deleteFCMT.postValue(exception.message)
|
||||
|
||||
// Log the error for debugging
|
||||
Log.e(":ProfileViewModel", "Error:", exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun editProfileDirect(
|
||||
context: Context,
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB |
@ -85,14 +85,45 @@
|
||||
android:id="@+id/etDetailAlamat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/edit_text_background"
|
||||
android:gravity="top"
|
||||
android:hint="Isi detail alamat (nomor rumah, lantai, dll)"
|
||||
android:inputType="textMultiLine"
|
||||
android:lines="3"
|
||||
android:padding="12dp"
|
||||
android:textSize="14sp" />
|
||||
android:background="@drawable/bg_text_field"
|
||||
android:padding="8dp"
|
||||
style="@style/body_small"
|
||||
android:hint="Isi detail alamat di sini, contoh: Blok, No. Kavling, dsb."
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_detail_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="100"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Provinsi -->
|
||||
<TextView
|
||||
@ -200,7 +231,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Desa"
|
||||
android:text="Desa / Kelurahan"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
@ -312,7 +343,7 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnReloadLocation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:text="Reload"
|
||||
android:textSize="12sp"
|
||||
|
||||
@ -411,11 +411,25 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_hold_payment"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:layout_weight="1"
|
||||
android:scrollHorizontally="false"
|
||||
android:singleLine="false"
|
||||
style="@style/button.large.secondary.medium"
|
||||
android:text="Tahan Konfirmasi"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm_payment"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:layout_weight="1"
|
||||
android:scrollHorizontally="false"
|
||||
android:singleLine="false"
|
||||
style="@style/button.large.active.medium"
|
||||
android:text="Konfirmasi Terima"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
@ -205,7 +205,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- Jalan -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -223,13 +222,49 @@
|
||||
<EditText
|
||||
android:id="@+id/edt_street"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="70dp"
|
||||
android:background="@drawable/bg_text_field"
|
||||
android:hint="Isi nama jalan di sini"
|
||||
android:padding="8dp"
|
||||
style="@style/body_small"
|
||||
android:hint="Isi nama jalan di sini"
|
||||
android:inputType="text|textMultiLine"
|
||||
android:gravity="top"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_street"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_street_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="255"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Kode Pos -->
|
||||
@ -254,6 +289,7 @@
|
||||
android:padding="8dp"
|
||||
style="@style/body_small"
|
||||
android:hint="Isi kode pos di sini"
|
||||
android:inputType="number"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -275,15 +311,47 @@
|
||||
<EditText
|
||||
android:id="@+id/edt_detail_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_text_field"
|
||||
android:hint="Isi detail alamat di sini, contoh: Blok, No. Kavling, dsb."
|
||||
android:padding="8dp"
|
||||
style="@style/body_small"
|
||||
android:inputType="text|textMultiLine"
|
||||
android:gravity="top"
|
||||
android:hint="Isi detail alamat di sini, contoh: Blok, No. Kavling, dsb."
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_detail_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="100"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Pinpoint Lokasi -->
|
||||
@ -379,6 +447,10 @@
|
||||
<Button
|
||||
android:id="@+id/btn_save_address"
|
||||
android:text="Simpan Perubahan"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
style="@style/button.large.active.long"
|
||||
android:enabled="true"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
@ -167,6 +167,40 @@
|
||||
style="@style/body_small"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_name_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="50"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Kategori Produk -->
|
||||
@ -271,6 +305,40 @@
|
||||
android:gravity="top"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_desc_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="255"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Harga Produk -->
|
||||
|
||||
@ -138,6 +138,40 @@
|
||||
style="@style/body_small"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_name_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="30"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Deskripsi Toko -->
|
||||
@ -166,6 +200,40 @@
|
||||
android:gravity="top"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_desc_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="255"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Jenis UMKM -->
|
||||
@ -435,7 +503,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="24dp">
|
||||
android:layout_marginVertical="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -463,13 +531,49 @@
|
||||
<EditText
|
||||
android:id="@+id/et_street"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="70dp"
|
||||
android:background="@drawable/bg_text_field"
|
||||
android:hint="Isi jalan tempat toko Anda di sini"
|
||||
android:padding="8dp"
|
||||
style="@style/body_small"
|
||||
android:inputType="text|textMultiLine"
|
||||
android:gravity="top"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_street"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_street_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="255"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Kode Pos -->
|
||||
@ -532,15 +636,49 @@
|
||||
<EditText
|
||||
android:id="@+id/et_address_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_text_field"
|
||||
android:hint="Isi detail alamat toko Anda di sini"
|
||||
android:padding="8dp"
|
||||
style="@style/body_small"
|
||||
android:inputType="text|textMultiLine"
|
||||
android:inputType="text"
|
||||
android:gravity="top"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_address_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="0"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="/"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count_address_detail_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/label_small"
|
||||
android:text="100"
|
||||
android:textColor="@color/black_300"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Nama Bank-->
|
||||
@ -626,7 +764,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="12. Nama Pemilik Rekening"
|
||||
android:text="11. Nama Pemilik Rekening"
|
||||
style="@style/body_medium"
|
||||
android:layout_marginEnd="4dp"/>
|
||||
|
||||
@ -668,7 +806,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="11. Nomor Rekening"
|
||||
android:text="12. Nomor Rekening"
|
||||
style="@style/body_medium"
|
||||
android:layout_marginEnd="4dp"/>
|
||||
|
||||
@ -887,7 +1025,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="17. Dokumen NPWP"
|
||||
android:text="16. Dokumen NPWP"
|
||||
style="@style/body_medium"
|
||||
android:layout_marginEnd="4dp"/>
|
||||
|
||||
@ -954,7 +1092,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="16. Dokumen NIB"
|
||||
android:text="17. Dokumen NIB"
|
||||
style="@style/body_medium"
|
||||
android:layout_marginEnd="4dp"/>
|
||||
|
||||
@ -1015,7 +1153,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="17. Pilih Titik Lokasi Usaha"
|
||||
android:text="18. Pilih Titik Lokasi Usaha"
|
||||
style="@style/body_medium"
|
||||
android:layout_marginEnd="4dp"/>
|
||||
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@color/white">
|
||||
android:background="@color/white"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@ -28,14 +28,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Judul"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:paddingTop="4dp"
|
||||
android:ellipsize="end"
|
||||
android:scrollHorizontally="false"
|
||||
android:singleLine="false"
|
||||
android:gravity="center"
|
||||
android:textSize="16sp"
|
||||
android:textSize="18sp"
|
||||
android:maxLines="3"
|
||||
android:fontFamily="@font/dmsans_semibold"
|
||||
android:textColor="?attr/colorOnSurface" />
|
||||
@ -45,6 +46,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="3"
|
||||
android:paddingHorizontal="16dp"
|
||||
@ -54,7 +56,7 @@
|
||||
android:singleLine="false"
|
||||
android:text="Pesan Dialog"
|
||||
android:fontFamily="@font/dmsans_regular"
|
||||
android:textSize="12sp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
<LinearLayout
|
||||
@ -72,8 +74,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/dmsans_regular"
|
||||
android:theme="@style/body_small"
|
||||
|
||||
android:theme="@style/body_medium"
|
||||
android:text="Tidak" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
@ -83,7 +84,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:fontFamily="@font/dmsans_regular"
|
||||
android:theme="@style/body_small"
|
||||
android:theme="@style/body_medium"
|
||||
android:text="Ya" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
android:background="@null"
|
||||
android:hint="Isi stok produk di sini"
|
||||
android:inputType="number"
|
||||
android:textAlignment="center"
|
||||
android:padding="8dp"
|
||||
style="@style/body_small" />
|
||||
|
||||
|
||||
@ -133,35 +133,36 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_left"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_button_outline"
|
||||
android:backgroundTint="@color/white"
|
||||
android:visibility="gone"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:scrollHorizontally="false"
|
||||
android:singleLine="false"
|
||||
android:padding="4dp"
|
||||
android:visibility="gone"
|
||||
android:text="Tidak"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDeadlineDate"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="8dp"/>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_right"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_button_filled"
|
||||
android:visibility="gone"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:visibility="gone"
|
||||
android:scrollHorizontally="false"
|
||||
android:singleLine="false"
|
||||
android:padding="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:text="Kirim Bukti Bayar"
|
||||
android:text="Ya"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDeadlineDate"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="8dp"/>
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
<TextView
|
||||
android:id="@+id/courier_name_cost"
|
||||
android:fontFamily="@font/dmsans_semibold"
|
||||
android:textSize="14sp"
|
||||
android:textSize="16sp"
|
||||
android:paddingHorizontal="2dp"
|
||||
android:paddingTop="4dp"
|
||||
android:ellipsize="end"
|
||||
@ -54,7 +54,7 @@
|
||||
android:id="@+id/est_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="12sp"
|
||||
android:textSize="14sp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:text="Estimasi 3-4 hari"/>
|
||||
</LinearLayout>
|
||||
@ -65,7 +65,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.3"
|
||||
android:textSize="14sp"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:fontFamily="@font/dmsans_semibold"
|
||||
android:text="Rp15.000"/>
|
||||
|
||||
@ -188,7 +188,7 @@
|
||||
</style>
|
||||
|
||||
<style name="button.large.active.long">
|
||||
<item name="android:layout_width">380dp</item>
|
||||
<item name="android:layout_width">320dp</item>
|
||||
</style>
|
||||
|
||||
<style name="button.large.active.medium">
|
||||
|
||||
Reference in New Issue
Block a user