mirror of
https://github.com/shaulascr/ecommerce_serang.git
synced 2025-08-10 09:22:21 +00:00
store under review
This commit is contained in:
@ -29,6 +29,9 @@
|
||||
android:theme="@style/Theme.Ecommerce_serang"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".ui.profile.mystore.StoreOnReviewActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.profile.mystore.review.ReviewActivity"
|
||||
android:exported="false" />
|
||||
@ -51,7 +54,7 @@
|
||||
android:name=".ui.product.storeDetail.StoreDetailActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.auth.RegisterStoreActivity"
|
||||
android:name=".ui.profile.mystore.RegisterStoreActivity"
|
||||
android:exported="false"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
|
@ -16,15 +16,18 @@ import com.alya.ecommerce_serang.BuildConfig.BASE_URL
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.data.api.dto.UserProfile
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiConfig
|
||||
import com.alya.ecommerce_serang.data.repository.MyStoreRepository
|
||||
import com.alya.ecommerce_serang.data.repository.UserRepository
|
||||
import com.alya.ecommerce_serang.databinding.FragmentProfileBinding
|
||||
import com.alya.ecommerce_serang.ui.auth.LoginActivity
|
||||
import com.alya.ecommerce_serang.ui.auth.RegisterStoreActivity
|
||||
import com.alya.ecommerce_serang.ui.profile.mystore.RegisterStoreActivity
|
||||
import com.alya.ecommerce_serang.ui.order.address.AddressActivity
|
||||
import com.alya.ecommerce_serang.ui.order.history.HistoryActivity
|
||||
import com.alya.ecommerce_serang.ui.profile.mystore.MyStoreActivity
|
||||
import com.alya.ecommerce_serang.ui.profile.mystore.StoreOnReviewActivity
|
||||
import com.alya.ecommerce_serang.utils.BaseViewModelFactory
|
||||
import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.MyStoreViewModel
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.ProfileViewModel
|
||||
import com.bumptech.glide.Glide
|
||||
import kotlinx.coroutines.delay
|
||||
@ -44,6 +47,14 @@ class ProfileFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
private val myStoreViewModel: MyStoreViewModel by viewModels {
|
||||
BaseViewModelFactory {
|
||||
val apiService = ApiConfig.getApiService(sessionManager)
|
||||
val myStoreRepository = MyStoreRepository(apiService)
|
||||
MyStoreViewModel(myStoreRepository)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
sessionManager = SessionManager(requireContext())
|
||||
@ -59,26 +70,32 @@ class ProfileFragment : Fragment() {
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
observeUserProfile()
|
||||
|
||||
viewModel.loadUserProfile()
|
||||
viewModel.checkStoreUser()
|
||||
|
||||
|
||||
val hasStore = viewModel.checkStore.value
|
||||
Log.d("Profile Fragment", "Check store $hasStore")
|
||||
binding.tvBukaToko.text = if (hasStore == true) "Toko Saya" else "Buka Toko"
|
||||
|
||||
binding.cardBukaToko.setOnClickListener{
|
||||
val hasStore = viewModel.checkStore.value
|
||||
|
||||
Log.d("Profile Fragment", "Check store $hasStore")
|
||||
|
||||
if (hasStore == true){
|
||||
binding.tvBukaToko.text = "Lihat Toko Saya"
|
||||
val intentBuka = Intent(requireContext(), MyStoreActivity::class.java)
|
||||
startActivity(intentBuka)
|
||||
} else {
|
||||
binding.tvBukaToko.text = "Buka Toko"
|
||||
val intentBuka = Intent(requireContext(), RegisterStoreActivity::class.java)
|
||||
startActivity(intentBuka)
|
||||
}
|
||||
// if (hasStore == true) startActivity(Intent(requireContext(), MyStoreActivity::class.java))
|
||||
// else startActivity(Intent(requireContext(), RegisterStoreActivity::class.java))
|
||||
if (viewModel.checkStore.value == true) {
|
||||
myStoreViewModel.loadMyStore()
|
||||
myStoreViewModel.myStoreProfile.observe(viewLifecycleOwner) { store ->
|
||||
store?.let {
|
||||
when (store.storeStatus) {
|
||||
"active" -> startActivity(Intent(requireContext(), MyStoreActivity::class.java))
|
||||
else -> startActivity(Intent(requireContext(), StoreOnReviewActivity::class.java))
|
||||
}
|
||||
} ?: run {
|
||||
Toast.makeText(requireContext(), "Gagal memuat data toko", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
} else startActivity(Intent(requireContext(), RegisterStoreActivity::class.java))
|
||||
}
|
||||
|
||||
binding.btnDetailProfile.setOnClickListener{
|
||||
@ -96,15 +113,14 @@ class ProfileFragment : Fragment() {
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.cardLogout.setOnClickListener({
|
||||
binding.cardLogout.setOnClickListener{
|
||||
logout()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
binding.cardAddress.setOnClickListener({
|
||||
binding.cardAddress.setOnClickListener{
|
||||
val intent = Intent(requireContext(), AddressActivity::class.java)
|
||||
startActivity(intent)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun observeUserProfile() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.alya.ecommerce_serang.ui.auth
|
||||
package com.alya.ecommerce_serang.ui.profile.mystore
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
@ -26,6 +25,7 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.StoreTypesItem
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiConfig
|
||||
import com.alya.ecommerce_serang.data.repository.Result
|
||||
@ -35,6 +35,9 @@ import com.alya.ecommerce_serang.ui.order.address.CityAdapter
|
||||
import com.alya.ecommerce_serang.ui.order.address.ProvinceAdapter
|
||||
import com.alya.ecommerce_serang.utils.BaseViewModelFactory
|
||||
import com.alya.ecommerce_serang.utils.SessionManager
|
||||
import com.alya.ecommerce_serang.utils.viewmodel.RegisterStoreViewModel
|
||||
import androidx.core.graphics.drawable.toDrawable
|
||||
import androidx.core.widget.ImageViewCompat
|
||||
|
||||
class RegisterStoreActivity : AppCompatActivity() {
|
||||
|
||||
@ -48,15 +51,13 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
private val PICK_KTP_REQUEST = 1002
|
||||
private val PICK_NPWP_REQUEST = 1003
|
||||
private val PICK_NIB_REQUEST = 1004
|
||||
private val PICK_PERSETUJUAN_REQUEST = 1005
|
||||
private val PICK_QRIS_REQUEST = 1006
|
||||
|
||||
// Location request code
|
||||
private val LOCATION_PERMISSION_REQUEST = 2001
|
||||
|
||||
private val viewModel: RegisterStoreViewModel by viewModels {
|
||||
BaseViewModelFactory {
|
||||
val apiService = ApiConfig.getApiService(sessionManager)
|
||||
val apiService = ApiConfig.Companion.getApiService(sessionManager)
|
||||
val orderRepository = UserRepository(apiService)
|
||||
RegisterStoreViewModel(orderRepository)
|
||||
}
|
||||
@ -84,6 +85,8 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
windowInsets
|
||||
}
|
||||
|
||||
setupHeader()
|
||||
|
||||
provinceAdapter = ProvinceAdapter(this)
|
||||
cityAdapter = CityAdapter(this)
|
||||
Log.d(TAG, "onCreate: Adapters initialized")
|
||||
@ -114,6 +117,9 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
Log.d(TAG, "onCreate: Fetching provinces from API")
|
||||
viewModel.getProvinces()
|
||||
|
||||
viewModel.provinceId.observe(this) { validateRequiredFields() }
|
||||
viewModel.cityId.observe(this) { validateRequiredFields() }
|
||||
viewModel.storeTypeId.observe(this) { validateRequiredFields() }
|
||||
|
||||
// Setup register button
|
||||
binding.btnRegister.setOnClickListener {
|
||||
@ -130,6 +136,45 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
Log.d(TAG, "onCreate: RegisterStoreActivity setup completed")
|
||||
}
|
||||
|
||||
private fun setupHeader() {
|
||||
binding.header.main.background = ContextCompat.getColor(this, R.color.blue_500).toDrawable()
|
||||
binding.header.headerTitle.visibility = View.GONE
|
||||
binding.header.headerLeftIcon.setColorFilter(
|
||||
ContextCompat.getColor(this, R.color.white),
|
||||
android.graphics.PorterDuff.Mode.SRC_IN
|
||||
)
|
||||
binding.header.headerLeftIcon.setOnClickListener {
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun validateRequiredFields() {
|
||||
val isFormValid = !viewModel.storeName.value.isNullOrBlank() &&
|
||||
!viewModel.street.value.isNullOrBlank() &&
|
||||
(viewModel.postalCode.value ?: 0) > 0 &&
|
||||
!viewModel.subdistrict.value.isNullOrBlank() &&
|
||||
!viewModel.bankName.value.isNullOrBlank() &&
|
||||
(viewModel.bankNumber.value ?: 0) > 0 &&
|
||||
(viewModel.provinceId.value ?: 0) > 0 &&
|
||||
(viewModel.cityId.value ?: 0) > 0 &&
|
||||
(viewModel.storeTypeId.value ?: 0) > 0 &&
|
||||
viewModel.ktpUri != null &&
|
||||
viewModel.nibUri != null &&
|
||||
viewModel.npwpUri != null &&
|
||||
viewModel.selectedCouriers.isNotEmpty()
|
||||
|
||||
binding.btnRegister.isEnabled = isFormValid
|
||||
|
||||
if (isFormValid) {
|
||||
binding.btnRegister.setBackgroundResource(R.drawable.bg_button_active)
|
||||
binding.btnRegister.setTextColor(ContextCompat.getColor(this, R.color.white))
|
||||
} else {
|
||||
binding.btnRegister.setBackgroundResource(R.drawable.bg_button_disabled)
|
||||
binding.btnRegister.setTextColor(ContextCompat.getColor(this, R.color.black_300))
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupObservers() {
|
||||
Log.d(TAG, "setupObservers: Setting up LiveData observers")
|
||||
|
||||
@ -138,12 +183,12 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
when (state) {
|
||||
is Result.Loading -> {
|
||||
Log.d(TAG, "setupObservers: Loading provinces...")
|
||||
binding.provinceProgressBar?.visibility = View.VISIBLE
|
||||
binding.provinceProgressBar.visibility = View.VISIBLE
|
||||
binding.spinnerProvince.isEnabled = false
|
||||
}
|
||||
is Result.Success -> {
|
||||
Log.d(TAG, "setupObservers: Provinces loaded successfully: ${state.data.size} provinces")
|
||||
binding.provinceProgressBar?.visibility = View.GONE
|
||||
binding.provinceProgressBar.visibility = View.GONE
|
||||
binding.spinnerProvince.isEnabled = true
|
||||
|
||||
// Update adapter with data
|
||||
@ -151,7 +196,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
}
|
||||
is Result.Error -> {
|
||||
Log.e(TAG, "setupObservers: Error loading provinces: ${state.exception.message}")
|
||||
binding.provinceProgressBar?.visibility = View.GONE
|
||||
binding.provinceProgressBar.visibility = View.GONE
|
||||
binding.spinnerProvince.isEnabled = true
|
||||
}
|
||||
}
|
||||
@ -162,12 +207,12 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
when (state) {
|
||||
is Result.Loading -> {
|
||||
Log.d(TAG, "setupObservers: Loading cities...")
|
||||
binding.cityProgressBar?.visibility = View.VISIBLE
|
||||
binding.cityProgressBar.visibility = View.VISIBLE
|
||||
binding.spinnerCity.isEnabled = false
|
||||
}
|
||||
is Result.Success -> {
|
||||
Log.d(TAG, "setupObservers: Cities loaded successfully: ${state.data.size} cities")
|
||||
binding.cityProgressBar?.visibility = View.GONE
|
||||
binding.cityProgressBar.visibility = View.GONE
|
||||
binding.spinnerCity.isEnabled = true
|
||||
|
||||
// Update adapter with data
|
||||
@ -175,7 +220,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
}
|
||||
is Result.Error -> {
|
||||
Log.e(TAG, "setupObservers: Error loading cities: ${state.exception.message}")
|
||||
binding.cityProgressBar?.visibility = View.GONE
|
||||
binding.cityProgressBar.visibility = View.GONE
|
||||
binding.spinnerCity.isEnabled = true
|
||||
}
|
||||
}
|
||||
@ -214,11 +259,11 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
Log.d(TAG, "setupStoreTypesObserver: Loading store types...")
|
||||
// Show loading indicator for store types spinner
|
||||
binding.spinnerStoreType.isEnabled = false
|
||||
binding.storeTypeProgressBar?.visibility = View.VISIBLE
|
||||
binding.storeTypeProgressBar.visibility = View.VISIBLE
|
||||
} else {
|
||||
Log.d(TAG, "setupStoreTypesObserver: Store types loading completed")
|
||||
binding.spinnerStoreType.isEnabled = true
|
||||
binding.storeTypeProgressBar?.visibility = View.GONE
|
||||
binding.storeTypeProgressBar.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
@ -309,7 +354,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
// Hide progress bar after setup
|
||||
binding.storeTypeProgressBar?.visibility = View.GONE
|
||||
binding.storeTypeProgressBar.visibility = View.GONE
|
||||
Log.d(TAG, "setupStoreTypeSpinner: Store type spinner setup completed")
|
||||
}
|
||||
|
||||
@ -398,23 +443,11 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
// NPWP
|
||||
binding.containerNpwp?.setOnClickListener {
|
||||
binding.containerNpwp.setOnClickListener {
|
||||
Log.d(TAG, "NPWP container clicked, picking image")
|
||||
pickImage(PICK_NPWP_REQUEST)
|
||||
}
|
||||
|
||||
// SPPIRT
|
||||
binding.containerSppirt.setOnClickListener {
|
||||
Log.d(TAG, "SPPIRT container clicked, picking document")
|
||||
pickDocument(PICK_PERSETUJUAN_REQUEST)
|
||||
}
|
||||
|
||||
// Halal
|
||||
binding.containerHalal.setOnClickListener {
|
||||
Log.d(TAG, "Halal container clicked, picking document")
|
||||
pickDocument(PICK_QRIS_REQUEST)
|
||||
}
|
||||
|
||||
Log.d(TAG, "setupDocumentUploads: Document upload buttons setup completed")
|
||||
}
|
||||
|
||||
@ -442,16 +475,16 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
handleCourierSelection("jne", isChecked)
|
||||
}
|
||||
|
||||
binding.checkboxJnt.setOnCheckedChangeListener { _, isChecked ->
|
||||
Log.d(TAG, "JNT checkbox ${if (isChecked) "checked" else "unchecked"}")
|
||||
handleCourierSelection("tiki", isChecked)
|
||||
}
|
||||
|
||||
binding.checkboxPos.setOnCheckedChangeListener { _, isChecked ->
|
||||
Log.d(TAG, "POS checkbox ${if (isChecked) "checked" else "unchecked"}")
|
||||
handleCourierSelection("pos", isChecked)
|
||||
}
|
||||
|
||||
binding.checkboxTiki.setOnCheckedChangeListener { _, isChecked ->
|
||||
Log.d(TAG, "TIKI checkbox ${if (isChecked) "checked" else "unchecked"}")
|
||||
handleCourierSelection("tiki", isChecked)
|
||||
}
|
||||
|
||||
Log.d(TAG, "setupCourierSelection: Courier checkboxes setup completed")
|
||||
}
|
||||
|
||||
@ -465,6 +498,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
viewModel.selectedCouriers.remove(courier)
|
||||
Log.d(TAG, "handleCourierSelection: Removed courier: $courier. Current couriers: ${viewModel.selectedCouriers}")
|
||||
}
|
||||
validateRequiredFields()
|
||||
}
|
||||
|
||||
private fun setupMap() {
|
||||
@ -516,6 +550,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
viewModel.storeName.value = s.toString()
|
||||
Log.d(TAG, "Store name updated: ${s.toString()}")
|
||||
validateRequiredFields()
|
||||
}
|
||||
})
|
||||
|
||||
@ -534,6 +569,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
viewModel.street.value = s.toString()
|
||||
Log.d(TAG, "Street address updated: ${s.toString()}")
|
||||
validateRequiredFields()
|
||||
}
|
||||
})
|
||||
|
||||
@ -547,6 +583,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
} catch (e: NumberFormatException) {
|
||||
// Handle invalid input
|
||||
Log.e(TAG, "Invalid postal code input: ${s.toString()}, error: $e")
|
||||
validateRequiredFields()
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -578,6 +615,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
viewModel.bankNumber.value = 0 // or 0
|
||||
Log.d(TAG, "Bank number set to default: 0")
|
||||
}
|
||||
validateRequiredFields()
|
||||
}
|
||||
})
|
||||
|
||||
@ -587,6 +625,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
viewModel.subdistrict.value = s.toString()
|
||||
Log.d(TAG, "Subdistrict updated: ${s.toString()}")
|
||||
validateRequiredFields()
|
||||
}
|
||||
})
|
||||
|
||||
@ -596,6 +635,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
viewModel.bankName.value = s.toString()
|
||||
Log.d(TAG, "Bank name updated: ${s.toString()}")
|
||||
validateRequiredFields()
|
||||
}
|
||||
})
|
||||
|
||||
@ -605,7 +645,7 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
Log.d(TAG, "onActivityResult: Request code: $requestCode, Result code: $resultCode")
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
val uri = data.data
|
||||
Log.d(TAG, "onActivityResult: URI received: $uri")
|
||||
when (requestCode) {
|
||||
@ -618,26 +658,19 @@ class RegisterStoreActivity : AppCompatActivity() {
|
||||
Log.d(TAG, "KTP image selected")
|
||||
viewModel.ktpUri = uri
|
||||
updateImagePreview(uri, binding.imgKtp, binding.layoutUploadKtp)
|
||||
validateRequiredFields()
|
||||
}
|
||||
PICK_NPWP_REQUEST -> {
|
||||
Log.d(TAG, "NPWP document selected")
|
||||
viewModel.npwpUri = uri
|
||||
updateDocumentPreview(binding.layoutUploadNpwp)
|
||||
validateRequiredFields()
|
||||
}
|
||||
PICK_NIB_REQUEST -> {
|
||||
Log.d(TAG, "NIB document selected")
|
||||
viewModel.nibUri = uri
|
||||
updateDocumentPreview(binding.layoutUploadNib)
|
||||
}
|
||||
PICK_PERSETUJUAN_REQUEST -> {
|
||||
Log.d(TAG, "SPPIRT document selected")
|
||||
viewModel.persetujuanUri = uri
|
||||
updateDocumentPreview(binding.layoutUploadSppirt)
|
||||
}
|
||||
PICK_QRIS_REQUEST -> {
|
||||
Log.d(TAG, "Halal document selected")
|
||||
viewModel.qrisUri = uri
|
||||
updateDocumentPreview(binding.layoutUploadHalal)
|
||||
validateRequiredFields()
|
||||
}
|
||||
else -> {
|
||||
Log.w(TAG, "Unknown request code: $requestCode")
|
@ -0,0 +1,25 @@
|
||||
package com.alya.ecommerce_serang.ui.profile.mystore
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.databinding.ActivityStoreOnReviewBinding
|
||||
|
||||
class StoreOnReviewActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityStoreOnReviewBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityStoreOnReviewBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.header.headerTitle.text = "Verifikasi Pengajuan Toko"
|
||||
binding.header.headerLeftIcon.setOnClickListener {
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.alya.ecommerce_serang.ui.auth
|
||||
package com.alya.ecommerce_serang.utils.viewmodel
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
@ -21,8 +21,8 @@ class RegisterStoreViewModel(
|
||||
) : ViewModel() {
|
||||
|
||||
// LiveData for UI state
|
||||
private val _registerState = MutableLiveData<com.alya.ecommerce_serang.data.repository.Result<RegisterStoreResponse>>()
|
||||
val registerState: LiveData<com.alya.ecommerce_serang.data.repository.Result<RegisterStoreResponse>> = _registerState
|
||||
private val _registerState = MutableLiveData<Result<RegisterStoreResponse>>()
|
||||
val registerState: LiveData<Result<RegisterStoreResponse>> = _registerState
|
||||
|
||||
private val _storeTypes = MutableLiveData<List<StoreTypesItem>>()
|
||||
val storeTypes: LiveData<List<StoreTypesItem>> = _storeTypes
|
||||
@ -141,7 +141,7 @@ class RegisterStoreViewModel(
|
||||
|
||||
_registerState.value = result
|
||||
} catch (e: Exception) {
|
||||
_registerState.value = com.alya.ecommerce_serang.data.repository.Result.Error(e)
|
||||
_registerState.value = Result.Error(e)
|
||||
}
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable/ic_under_review.png
Normal file
BIN
app/src/main/res/drawable/ic_under_review.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
File diff suppressed because it is too large
Load Diff
39
app/src/main/res/layout/activity_store_on_review.xml
Normal file
39
app/src/main/res/layout/activity_store_on_review.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.profile.mystore.StoreOnReviewActivity"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<include
|
||||
android:id="@+id/header"
|
||||
layout="@layout/header" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:src="@drawable/ic_under_review"
|
||||
app:tint="@color/blue_500"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Pengajuan toko Anda masih dalam tahap verifikasi oleh Admin"
|
||||
style="@style/body_large"
|
||||
android:fontFamily="@font/dmsans_extrabold"
|
||||
android:textAlignment="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -11,14 +11,15 @@
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
android:background="@null">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:contentInsetStart="0dp"
|
||||
app:contentInsetStartWithNavigation="0dp">
|
||||
app:contentInsetStartWithNavigation="0dp"
|
||||
android:background="@null">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/header_left_icon"
|
||||
|
@ -145,6 +145,7 @@
|
||||
<string name="disconnected_reconnecting">Disconnected. Reconnecting...</string>
|
||||
<string name="connection_error">Connection error: %1$s</string>
|
||||
<string name="typing">User is typing...</string>
|
||||
<string name="buka_toko_desc">Mohon untuk melengkapi formulir pendaftaran ini agar dapat mengakses fitur penjual pada aplikasi.</string>
|
||||
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user