mirror of
https://github.com/shaulascr/ecommerce_serang.git
synced 2025-08-10 09:22:21 +00:00
sells update
This commit is contained in:

committed by
Gracia Hotmauli

parent
67964d43cb
commit
a93d039b27
@ -34,6 +34,7 @@
|
|||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.auth.RegisterStoreActivity"
|
android:name=".ui.auth.RegisterStoreActivity"
|
||||||
|
android:windowSoftInputMode="adjustResize"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.profile.editprofile.EditProfileCustActivity"
|
android:name=".ui.profile.editprofile.EditProfileCustActivity"
|
||||||
@ -47,15 +48,23 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.profile.mystore.sells.shipment.ShipmentConfirmationActivity"
|
android:name=".ui.profile.mystore.sells.shipment.ShipmentConfirmationActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.profile.mystore.profile.EditStoreProfileActivity"
|
||||||
|
android:windowSoftInputMode="adjustResize"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.profile.mystore.sells.shipment.DetailShipmentActivity"
|
android:name=".ui.profile.mystore.sells.shipment.DetailShipmentActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.profile.mystore.sells.payment.DetailPaymentActivity"
|
android:name=".ui.profile.mystore.sells.payment.DetailPaymentActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.profile.mystore.sells.order.DetailOrderActivity"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.chat.ChatActivity"
|
android:name=".ui.chat.ChatActivity"
|
||||||
android:exported="false" /> <!-- <provider -->
|
android:exported="false"
|
||||||
|
android:windowSoftInputMode="adjustResize|stateHidden" /> <!-- <provider -->
|
||||||
<!-- android:name="androidx.startup.InitializationProvider" -->
|
<!-- android:name="androidx.startup.InitializationProvider" -->
|
||||||
<!-- android:authorities="${applicationId}.androidx-startup" -->
|
<!-- android:authorities="${applicationId}.androidx-startup" -->
|
||||||
<!-- tools:node="remove" /> -->
|
<!-- tools:node="remove" /> -->
|
||||||
@ -88,6 +97,7 @@
|
|||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.order.address.AddAddressActivity"
|
android:name=".ui.order.address.AddAddressActivity"
|
||||||
|
android:windowSoftInputMode="adjustResize"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.order.address.AddressActivity"
|
android:name=".ui.order.address.AddressActivity"
|
||||||
@ -136,6 +146,7 @@
|
|||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.auth.RegisterActivity"
|
android:name=".ui.auth.RegisterActivity"
|
||||||
|
android:windowSoftInputMode="adjustResize"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
@ -450,6 +450,13 @@ interface ApiService {
|
|||||||
@Part chatimg: MultipartBody.Part?
|
@Part chatimg: MultipartBody.Part?
|
||||||
): Response<SendChatResponse>
|
): Response<SendChatResponse>
|
||||||
|
|
||||||
|
@Multipart
|
||||||
|
@POST("sendchat")
|
||||||
|
suspend fun sendChatMessage(
|
||||||
|
@PartMap parts: Map<String, @JvmSuppressWildcards RequestBody>,
|
||||||
|
@Part chatimg: MultipartBody.Part? = null
|
||||||
|
): Response<SendChatResponse>
|
||||||
|
|
||||||
@PUT("chatstatus")
|
@PUT("chatstatus")
|
||||||
suspend fun updateChatStatus(
|
suspend fun updateChatStatus(
|
||||||
@Body request: UpdateChatRequest
|
@Body request: UpdateChatRequest
|
||||||
|
@ -8,8 +8,9 @@ import com.alya.ecommerce_serang.data.api.response.chat.ChatItemList
|
|||||||
import com.alya.ecommerce_serang.data.api.response.chat.SendChatResponse
|
import com.alya.ecommerce_serang.data.api.response.chat.SendChatResponse
|
||||||
import com.alya.ecommerce_serang.data.api.response.chat.UpdateChatResponse
|
import com.alya.ecommerce_serang.data.api.response.chat.UpdateChatResponse
|
||||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiService
|
import com.alya.ecommerce_serang.data.api.retrofit.ApiService
|
||||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
import okhttp3.MediaType.Companion.toMediaType
|
||||||
import okhttp3.MultipartBody
|
import okhttp3.MultipartBody
|
||||||
|
import okhttp3.RequestBody
|
||||||
import okhttp3.RequestBody.Companion.asRequestBody
|
import okhttp3.RequestBody.Companion.asRequestBody
|
||||||
import okhttp3.RequestBody.Companion.toRequestBody
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -38,62 +39,130 @@ class ChatRepository @Inject constructor(
|
|||||||
suspend fun sendChatMessage(
|
suspend fun sendChatMessage(
|
||||||
storeId: Int,
|
storeId: Int,
|
||||||
message: String,
|
message: String,
|
||||||
productId: Int? = null,
|
productId: Int?, // Nullable and optional
|
||||||
imageFile: File? = null,
|
imageFile: File? = null // Nullable and optional
|
||||||
chatRoomId: Int? = null // Not used in the actual API call but kept for compatibility
|
|
||||||
): Result<SendChatResponse> {
|
): Result<SendChatResponse> {
|
||||||
return try {
|
return try {
|
||||||
// Create multipart request parts
|
val parts = mutableMapOf<String, RequestBody>()
|
||||||
val storeIdPart = storeId.toString().toRequestBody("text/plain".toMediaTypeOrNull())
|
|
||||||
val messagePart = message.toRequestBody("text/plain".toMediaTypeOrNull())
|
|
||||||
|
|
||||||
// Add product ID part if provided
|
// Required fields
|
||||||
val productIdPart = if (productId != null && productId > 0) {
|
parts["store_id"] = storeId.toString().toRequestBody("text/plain".toMediaType())
|
||||||
productId.toString().toRequestBody("text/plain".toMediaTypeOrNull())
|
parts["message"] = message.toRequestBody("text/plain".toMediaType())
|
||||||
} else {
|
|
||||||
null
|
// Optional: Only include if productId is valid
|
||||||
|
if (productId != null && productId > 0) {
|
||||||
|
parts["product_id"] = productId.toString().toRequestBody("text/plain".toMediaType())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create image part if file is provided
|
// Optional: Only include if imageFile is valid
|
||||||
val imagePart = if (imageFile != null && imageFile.exists()) {
|
val imagePart = imageFile?.takeIf { it.exists() }?.let { file ->
|
||||||
val requestFile = imageFile.asRequestBody("image/*".toMediaTypeOrNull())
|
// val requestFile = file.asRequestBody("image/*".toMediaType())
|
||||||
MultipartBody.Part.createFormData("chatimg", imageFile.name, requestFile)
|
val mimeType = when {
|
||||||
} else {
|
file.name.endsWith(".png", ignoreCase = true) -> "image/png"
|
||||||
null
|
file.name.endsWith(".jpg", ignoreCase = true) || file.name.endsWith(".jpeg", ignoreCase = true) -> "image/jpeg"
|
||||||
|
else -> "image/jpeg" // fallback
|
||||||
|
}
|
||||||
|
val requestFile = file.asRequestBody(mimeType.toMediaType())
|
||||||
|
MultipartBody.Part.createFormData("chatimg", file.name, requestFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug log the request parameters
|
// Log the parts map keys and values (string representations)
|
||||||
Log.d("ChatRepository", "Sending chat with: storeId=$storeId, productId=$productId, " +
|
Log.d("ChatRepository", "Sending chat message with parts:")
|
||||||
"message length=${message.length}, hasImage=${imageFile != null}")
|
parts.forEach { (key, body) ->
|
||||||
|
Log.d("ChatRepository", "Key: $key, Value (approx): ${bodyToString(body)}")
|
||||||
|
}
|
||||||
|
Log.d("ChatRepository", "Sending chat message with imagePart: ${imagePart != null}")
|
||||||
|
|
||||||
// Make API call using your actual endpoint and parameter names
|
// Send request
|
||||||
val response = apiService.sendChatLine(
|
val response = apiService.sendChatMessage(parts, imagePart)
|
||||||
storeId = storeIdPart,
|
|
||||||
message = messagePart,
|
|
||||||
productId = productIdPart,
|
|
||||||
chatimg = imagePart
|
|
||||||
)
|
|
||||||
|
|
||||||
Log.d("ChatRepository", "check data productId=$productIdPart, storeId=$storeIdPart, messageTxt=$messagePart, chatImg=$imagePart")
|
|
||||||
|
|
||||||
if (response.isSuccessful) {
|
if (response.isSuccessful) {
|
||||||
val body = response.body()
|
response.body()?.let { Result.Success(it) } ?: Result.Error(Exception("Empty response body"))
|
||||||
if (body != null) {
|
|
||||||
Result.Success(body)
|
|
||||||
} else {
|
|
||||||
Result.Error(Exception("Empty response body"))
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
val errorBody = response.errorBody()?.string() ?: "{}"
|
val errorMsg = response.errorBody()?.string().orEmpty()
|
||||||
Log.e("ChatRepository", "API Error: ${response.code()} - $errorBody")
|
Log.e("ChatRepository", "API Error: ${response.code()} - $errorMsg")
|
||||||
Result.Error(Exception("API Error: ${response.code()} - $errorBody"))
|
Result.Error(Exception("API Error: ${response.code()} - $errorMsg"))
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("ChatRepository", "Exception sending message", e)
|
Log.e("ChatRepository", "Exception sending chat message", e)
|
||||||
Result.Error(e)
|
Result.Error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper function to get string content from RequestBody (best effort)
|
||||||
|
private fun bodyToString(requestBody: RequestBody): String {
|
||||||
|
return try {
|
||||||
|
val buffer = okio.Buffer()
|
||||||
|
requestBody.writeTo(buffer)
|
||||||
|
buffer.readUtf8()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
"Could not read body"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// suspend fun sendChatMessage(
|
||||||
|
// storeId: Int,
|
||||||
|
// message: String,
|
||||||
|
// productId: Int?,
|
||||||
|
// imageFile: File? = null,
|
||||||
|
// chatRoomId: Int? = null
|
||||||
|
// ): Result<SendChatResponse> {
|
||||||
|
// return try {
|
||||||
|
// Log.d(TAG, "=== SEND CHAT MESSAGE ===")
|
||||||
|
// Log.d(TAG, "StoreId: $storeId")
|
||||||
|
// Log.d(TAG, "Message: '$message'")
|
||||||
|
// Log.d(TAG, "ProductId: $productId")
|
||||||
|
// Log.d(TAG, "ImageFile: ${imageFile?.absolutePath}")
|
||||||
|
// Log.d(TAG, "ImageFile exists: ${imageFile?.exists()}")
|
||||||
|
// Log.d(TAG, "ImageFile size: ${imageFile?.length()} bytes")
|
||||||
|
//
|
||||||
|
// // Convert primitive fields to RequestBody
|
||||||
|
// val storeIdBody = storeId.toString().toRequestBody("text/plain".toMediaTypeOrNull())
|
||||||
|
// val messageBody = message.toRequestBody("text/plain".toMediaTypeOrNull())
|
||||||
|
// val productIdBody = productId?.takeIf { it > 0 } // null if 0
|
||||||
|
// ?.toString()
|
||||||
|
// ?.toRequestBody("text/plain".toMediaTypeOrNull())
|
||||||
|
//
|
||||||
|
// // Convert image file to MultipartBody.Part if exists
|
||||||
|
// val imagePart: MultipartBody.Part? = imageFile?.takeIf { it.exists() }?.let { file ->
|
||||||
|
// val requestFile = file.asRequestBody("image/*".toMediaTypeOrNull())
|
||||||
|
// MultipartBody.Part.createFormData("chatimg", file.name, requestFile)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // Call the API
|
||||||
|
// Log.d(TAG, "Sending request. ProductIdBody is null: ${productIdBody == null}")
|
||||||
|
//
|
||||||
|
// val response = apiService.sendChatLine(
|
||||||
|
// storeId = storeIdBody,
|
||||||
|
// message = messageBody,
|
||||||
|
// productId = productIdBody,
|
||||||
|
// chatimg = imagePart
|
||||||
|
// )
|
||||||
|
//
|
||||||
|
// // Handle API response
|
||||||
|
// if (response.isSuccessful) {
|
||||||
|
// response.body()?.let {
|
||||||
|
// Log.d(TAG, "Success: ${it.message}")
|
||||||
|
// Result.Success(it)
|
||||||
|
// } ?: run {
|
||||||
|
// Log.e(TAG, "Response body is null")
|
||||||
|
// Result.Error(Exception("Empty response body"))
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// val errorMsg = response.errorBody()?.string() ?: "Unknown error"
|
||||||
|
// Log.e(TAG, "API Error: ${response.code()} - $errorMsg")
|
||||||
|
// Result.Error(Exception("API Error: ${response.code()} - $errorMsg"))
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// } catch (e: Exception) {
|
||||||
|
// Log.e(TAG, "Exception sending chat message", e)
|
||||||
|
// Result.Error(e)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
suspend fun updateMessageStatus(
|
suspend fun updateMessageStatus(
|
||||||
messageId: Int,
|
messageId: Int,
|
||||||
status: String
|
status: String
|
||||||
|
@ -59,6 +59,8 @@ class RegisterActivity : AppCompatActivity() {
|
|||||||
windowInsets
|
windowInsets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log.d("RegisterActivity", "Token in storage: '${sessionManager.getToken()}'")
|
Log.d("RegisterActivity", "Token in storage: '${sessionManager.getToken()}'")
|
||||||
Log.d("RegisterActivity", "User ID in storage: '${sessionManager.getUserId()}'")
|
Log.d("RegisterActivity", "User ID in storage: '${sessionManager.getUserId()}'")
|
||||||
|
|
||||||
|
@ -8,6 +8,9 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsAnimationCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import com.alya.ecommerce_serang.R
|
import com.alya.ecommerce_serang.R
|
||||||
@ -91,6 +94,8 @@ class RegisterStep3Fragment : Fragment() {
|
|||||||
// Set up province and city dropdowns
|
// Set up province and city dropdowns
|
||||||
setupAutoComplete()
|
setupAutoComplete()
|
||||||
|
|
||||||
|
setupEdgeToEdge()
|
||||||
|
|
||||||
// Set up button listeners
|
// Set up button listeners
|
||||||
binding.btnPrevious.setOnClickListener {
|
binding.btnPrevious.setOnClickListener {
|
||||||
// Go back to the previous step
|
// Go back to the previous step
|
||||||
@ -116,6 +121,55 @@ class RegisterStep3Fragment : Fragment() {
|
|||||||
setupCityObserver()
|
setupCityObserver()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setupEdgeToEdge() {
|
||||||
|
// Apply insets to your fragment's root view
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view, windowInsets ->
|
||||||
|
val systemBars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
|
view.setPadding(
|
||||||
|
systemBars.left,
|
||||||
|
systemBars.top,
|
||||||
|
systemBars.right,
|
||||||
|
systemBars.bottom
|
||||||
|
)
|
||||||
|
windowInsets
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up IME animation callback
|
||||||
|
ViewCompat.setWindowInsetsAnimationCallback(
|
||||||
|
binding.root,
|
||||||
|
object : WindowInsetsAnimationCompat.Callback(DISPATCH_MODE_STOP) {
|
||||||
|
var startBottom = 0f
|
||||||
|
var endBottom = 0f
|
||||||
|
|
||||||
|
override fun onPrepare(animation: WindowInsetsAnimationCompat) {
|
||||||
|
startBottom = binding.root.bottom.toFloat()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStart(
|
||||||
|
animation: WindowInsetsAnimationCompat,
|
||||||
|
bounds: WindowInsetsAnimationCompat.BoundsCompat
|
||||||
|
): WindowInsetsAnimationCompat.BoundsCompat {
|
||||||
|
endBottom = binding.root.bottom.toFloat()
|
||||||
|
return bounds
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onProgress(
|
||||||
|
insets: WindowInsetsCompat,
|
||||||
|
runningAnimations: MutableList<WindowInsetsAnimationCompat>
|
||||||
|
): WindowInsetsCompat {
|
||||||
|
val imeAnimation = runningAnimations.find {
|
||||||
|
it.typeMask and WindowInsetsCompat.Type.ime() != 0
|
||||||
|
} ?: return insets
|
||||||
|
|
||||||
|
binding.root.translationY =
|
||||||
|
(startBottom - endBottom) * (1 - imeAnimation.interpolatedFraction)
|
||||||
|
|
||||||
|
return insets
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupAutoComplete() {
|
private fun setupAutoComplete() {
|
||||||
// Same implementation as before
|
// Same implementation as before
|
||||||
binding.autoCompleteProvinsi.setAdapter(provinceAdapter)
|
binding.autoCompleteProvinsi.setAdapter(provinceAdapter)
|
||||||
@ -351,6 +405,8 @@ class RegisterStep3Fragment : Fragment() {
|
|||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(binding.root, null)
|
||||||
|
ViewCompat.setWindowInsetsAnimationCallback(binding.root, null)
|
||||||
_binding = null
|
_binding = null
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -3,6 +3,7 @@ package com.alya.ecommerce_serang.ui.chat
|
|||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.app.AlertDialog
|
import android.app.AlertDialog
|
||||||
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
@ -12,6 +13,7 @@ import android.text.Editable
|
|||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
@ -22,6 +24,7 @@ import androidx.core.content.ContextCompat
|
|||||||
import androidx.core.content.FileProvider
|
import androidx.core.content.FileProvider
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
|
import androidx.core.view.WindowInsetsAnimationCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
@ -40,6 +43,7 @@ import java.text.SimpleDateFormat
|
|||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
import kotlin.math.max
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
class ChatActivity : AppCompatActivity() {
|
class ChatActivity : AppCompatActivity() {
|
||||||
@ -100,16 +104,7 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
|
|
||||||
// Apply insets to your root layout
|
// Apply insets to your root layout
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view, windowInsets ->
|
|
||||||
val systemBars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
||||||
view.setPadding(
|
|
||||||
systemBars.left,
|
|
||||||
systemBars.top,
|
|
||||||
systemBars.right,
|
|
||||||
systemBars.bottom
|
|
||||||
)
|
|
||||||
windowInsets
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get parameters from intent
|
// Get parameters from intent
|
||||||
val storeId = intent.getIntExtra(Constants.EXTRA_STORE_ID, 0)
|
val storeId = intent.getIntExtra(Constants.EXTRA_STORE_ID, 0)
|
||||||
@ -146,6 +141,84 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
.placeholder(R.drawable.placeholder_image)
|
.placeholder(R.drawable.placeholder_image)
|
||||||
.into(binding.imgProfile)
|
.into(binding.imgProfile)
|
||||||
|
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(binding.layoutChatInput) { view, insets ->
|
||||||
|
val imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime())
|
||||||
|
val navBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
||||||
|
|
||||||
|
val bottomPadding = max(imeInsets.bottom, navBarInsets.bottom)
|
||||||
|
view.setPadding(view.paddingLeft, view.paddingTop, view.paddingRight, bottomPadding)
|
||||||
|
insets
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle top inset on toolbar (status bar height)
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(binding.chatToolbar) { view, insets ->
|
||||||
|
val statusBarHeight = insets.getInsets(WindowInsetsCompat.Type.statusBars()).top
|
||||||
|
view.setPadding(view.paddingLeft, statusBarHeight, view.paddingRight, view.paddingBottom)
|
||||||
|
insets
|
||||||
|
}
|
||||||
|
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(binding.recyclerChat) { view, insets ->
|
||||||
|
val navBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
||||||
|
val bottomPadding = binding.layoutChatInput.height + navBarInsets.bottom
|
||||||
|
|
||||||
|
view.setPadding(
|
||||||
|
view.paddingLeft,
|
||||||
|
view.paddingTop,
|
||||||
|
view.paddingRight,
|
||||||
|
bottomPadding
|
||||||
|
)
|
||||||
|
insets
|
||||||
|
}
|
||||||
|
|
||||||
|
// For RecyclerView, add bottom padding = chat input height + nav bar height (to avoid last message hidden)
|
||||||
|
|
||||||
|
ViewCompat.setWindowInsetsAnimationCallback(binding.root,
|
||||||
|
object : WindowInsetsAnimationCompat.Callback(DISPATCH_MODE_STOP) {
|
||||||
|
|
||||||
|
private var startPaddingBottom = 0
|
||||||
|
private var endPaddingBottom = 0
|
||||||
|
|
||||||
|
override fun onPrepare(animation: WindowInsetsAnimationCompat) {
|
||||||
|
startPaddingBottom = binding.layoutChatInput.paddingBottom
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStart(
|
||||||
|
animation: WindowInsetsAnimationCompat,
|
||||||
|
bounds: WindowInsetsAnimationCompat.BoundsCompat
|
||||||
|
): WindowInsetsAnimationCompat.BoundsCompat {
|
||||||
|
endPaddingBottom = binding.layoutChatInput.paddingBottom
|
||||||
|
return bounds
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onProgress(
|
||||||
|
insets: WindowInsetsCompat,
|
||||||
|
runningAnimations: MutableList<WindowInsetsAnimationCompat>
|
||||||
|
): WindowInsetsCompat {
|
||||||
|
val imeAnimation = runningAnimations.find {
|
||||||
|
it.typeMask and WindowInsetsCompat.Type.ime() != 0
|
||||||
|
} ?: return insets
|
||||||
|
|
||||||
|
val animatedBottomPadding = startPaddingBottom +
|
||||||
|
(endPaddingBottom - startPaddingBottom) * imeAnimation.interpolatedFraction
|
||||||
|
|
||||||
|
binding.layoutChatInput.setPadding(
|
||||||
|
binding.layoutChatInput.paddingLeft,
|
||||||
|
binding.layoutChatInput.paddingTop,
|
||||||
|
binding.layoutChatInput.paddingRight,
|
||||||
|
animatedBottomPadding.toInt()
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.recyclerChat.setPadding(
|
||||||
|
binding.recyclerChat.paddingLeft,
|
||||||
|
binding.recyclerChat.paddingTop,
|
||||||
|
binding.recyclerChat.paddingRight,
|
||||||
|
animatedBottomPadding.toInt() + binding.layoutChatInput.height
|
||||||
|
)
|
||||||
|
|
||||||
|
return insets
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// Set chat parameters to ViewModel
|
// Set chat parameters to ViewModel
|
||||||
viewModel.setChatParameters(
|
viewModel.setChatParameters(
|
||||||
storeId = storeId,
|
storeId = storeId,
|
||||||
@ -178,6 +251,12 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
stackFromEnd = true
|
stackFromEnd = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// binding.recyclerChat.setPadding(
|
||||||
|
// binding.recyclerChat.paddingLeft,
|
||||||
|
// binding.recyclerChat.paddingTop,
|
||||||
|
// binding.recyclerChat.paddingRight,
|
||||||
|
// binding.layoutChatInput.height + binding.root.rootWindowInsets?.getInsets(WindowInsetsCompat.Type.navigationBars())?.bottom ?: 0
|
||||||
|
// )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -222,6 +301,11 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
override fun afterTextChanged(s: Editable?) {}
|
override fun afterTextChanged(s: Editable?) {}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
binding.editTextMessage.requestFocus()
|
||||||
|
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
|
imm.showSoftInput(binding.editTextMessage, InputMethodManager.SHOW_IMPLICIT)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun observeViewModel() {
|
private fun observeViewModel() {
|
||||||
@ -256,10 +340,17 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
binding.tvSellerName.text = state.storeName
|
binding.tvSellerName.text = state.storeName
|
||||||
binding.tvStoreName.text=state.storeName
|
binding.tvStoreName.text=state.storeName
|
||||||
|
|
||||||
|
val fullImageUrl = when (val img = state.productImageUrl) {
|
||||||
|
is String -> {
|
||||||
|
if (img.startsWith("/")) BASE_URL + img.substring(1) else img
|
||||||
|
}
|
||||||
|
else -> R.drawable.placeholder_image
|
||||||
|
}
|
||||||
|
|
||||||
// Load product image
|
// Load product image
|
||||||
if (!state.productImageUrl.isNullOrEmpty()) {
|
if (!state.productImageUrl.isNullOrEmpty()) {
|
||||||
Glide.with(this@ChatActivity)
|
Glide.with(this@ChatActivity)
|
||||||
.load(BASE_URL + state.productImageUrl)
|
.load(fullImageUrl)
|
||||||
.centerCrop()
|
.centerCrop()
|
||||||
.placeholder(R.drawable.placeholder_image)
|
.placeholder(R.drawable.placeholder_image)
|
||||||
.error(R.drawable.placeholder_image)
|
.error(R.drawable.placeholder_image)
|
||||||
@ -294,8 +385,6 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun showOptionsMenu() {
|
private fun showOptionsMenu() {
|
||||||
val options = arrayOf(
|
val options = arrayOf(
|
||||||
getString(R.string.block_user),
|
getString(R.string.block_user),
|
||||||
@ -380,67 +469,36 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
try {
|
try {
|
||||||
Log.d(TAG, "Processing selected image: $uri")
|
Log.d(TAG, "Processing selected image: $uri")
|
||||||
|
|
||||||
// First try the direct approach to get the file path
|
// Always use the copy-to-cache approach for reliability
|
||||||
var filePath: String? = null
|
contentResolver.openInputStream(uri)?.use { inputStream ->
|
||||||
|
val fileName = "chat_img_${System.currentTimeMillis()}.jpg"
|
||||||
|
val outputFile = File(cacheDir, fileName)
|
||||||
|
|
||||||
// For newer Android versions, we need to handle content URIs properly
|
outputFile.outputStream().use { outputStream ->
|
||||||
if (uri.scheme == "content") {
|
inputStream.copyTo(outputStream)
|
||||||
val cursor = contentResolver.query(uri, null, null, null, null)
|
|
||||||
cursor?.use {
|
|
||||||
if (it.moveToFirst()) {
|
|
||||||
val columnIndex = it.getColumnIndex(MediaStore.Images.Media.DATA)
|
|
||||||
if (columnIndex != -1) {
|
|
||||||
filePath = it.getString(columnIndex)
|
|
||||||
Log.d(TAG, "Found file path from cursor: $filePath")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we couldn't get the path directly, create a copy in our cache directory
|
if (outputFile.exists() && outputFile.length() > 0) {
|
||||||
if (filePath == null) {
|
if (outputFile.length() > 5 * 1024 * 1024) {
|
||||||
contentResolver.openInputStream(uri)?.use { inputStream ->
|
Log.e(TAG, "File too large: ${outputFile.length()} bytes")
|
||||||
val fileName = "img_${System.currentTimeMillis()}.jpg"
|
Toast.makeText(this, "Image too large (max 5MB)", Toast.LENGTH_SHORT).show()
|
||||||
val outputFile = File(cacheDir, fileName)
|
|
||||||
|
|
||||||
outputFile.outputStream().use { outputStream ->
|
|
||||||
inputStream.copyTo(outputStream)
|
|
||||||
}
|
|
||||||
|
|
||||||
filePath = outputFile.absolutePath
|
|
||||||
Log.d(TAG, "Created temp file from input stream: $filePath")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (uri.scheme == "file") {
|
|
||||||
// Direct file URI
|
|
||||||
filePath = uri.path
|
|
||||||
Log.d(TAG, "Got file path directly from URI: $filePath")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Process the file path
|
|
||||||
if (filePath != null) {
|
|
||||||
val file = File(filePath)
|
|
||||||
if (file.exists()) {
|
|
||||||
// Check file size (limit to 5MB)
|
|
||||||
if (file.length() > 5 * 1024 * 1024) {
|
|
||||||
Toast.makeText(this, "Image too large (max 5MB), please select a smaller image", Toast.LENGTH_SHORT).show()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the file to the ViewModel
|
Log.d(TAG, "Image processed successfully: ${outputFile.absolutePath}, size: ${outputFile.length()}")
|
||||||
viewModel.setSelectedImageFile(file)
|
viewModel.setSelectedImageFile(outputFile)
|
||||||
Toast.makeText(this, R.string.image_selected, Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Image selected", Toast.LENGTH_SHORT).show()
|
||||||
Log.d(TAG, "Successfully set image file: ${file.absolutePath}, size: ${file.length()} bytes")
|
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "File does not exist: $filePath")
|
Log.e(TAG, "Failed to create image file")
|
||||||
Toast.makeText(this, "Could not access the selected image", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Failed to process image", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
} else {
|
} ?: run {
|
||||||
Log.e(TAG, "Could not get file path from URI: $uri")
|
Log.e(TAG, "Could not open input stream for URI: $uri")
|
||||||
Toast.makeText(this, "Could not process the selected image", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Could not access image", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Error handling selected image", e)
|
Log.e(TAG, "Error handling selected image", e)
|
||||||
Toast.makeText(this, "Error processing image: ${e.message}", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Error: ${e.message}", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,8 +78,16 @@ class ChatAdapter : ListAdapter<ChatUiMessage, RecyclerView.ViewHolder>(ChatMess
|
|||||||
// Handle attachment if exists
|
// Handle attachment if exists
|
||||||
if (message.attachment?.isNotEmpty() == true) {
|
if (message.attachment?.isNotEmpty() == true) {
|
||||||
binding.imgAttachment.visibility = View.VISIBLE
|
binding.imgAttachment.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
val fullImageUrl = when (val img = message.attachment) {
|
||||||
|
is String -> {
|
||||||
|
if (img.startsWith("/")) BASE_URL + img.substring(1) else img
|
||||||
|
}
|
||||||
|
else -> R.drawable.placeholder_image
|
||||||
|
}
|
||||||
|
|
||||||
Glide.with(binding.root.context)
|
Glide.with(binding.root.context)
|
||||||
.load(BASE_URL + message.attachment)
|
.load(fullImageUrl)
|
||||||
.centerCrop()
|
.centerCrop()
|
||||||
.placeholder(R.drawable.placeholder_image)
|
.placeholder(R.drawable.placeholder_image)
|
||||||
.error(R.drawable.placeholder_image)
|
.error(R.drawable.placeholder_image)
|
||||||
@ -101,10 +109,17 @@ class ChatAdapter : ListAdapter<ChatUiMessage, RecyclerView.ViewHolder>(ChatMess
|
|||||||
binding.tvTimestamp.text = message.time
|
binding.tvTimestamp.text = message.time
|
||||||
|
|
||||||
// Handle attachment if exists
|
// Handle attachment if exists
|
||||||
|
val fullImageUrl = when (val img = message.attachment) {
|
||||||
|
is String -> {
|
||||||
|
if (img.startsWith("/")) BASE_URL + img.substring(1) else img
|
||||||
|
}
|
||||||
|
else -> R.drawable.placeholder_image
|
||||||
|
}
|
||||||
|
|
||||||
if (message.attachment?.isNotEmpty() == true) {
|
if (message.attachment?.isNotEmpty() == true) {
|
||||||
binding.imgAttachment.visibility = View.VISIBLE
|
binding.imgAttachment.visibility = View.VISIBLE
|
||||||
Glide.with(binding.root.context)
|
Glide.with(binding.root.context)
|
||||||
.load(BASE_URL + message.attachment)
|
.load(fullImageUrl)
|
||||||
.centerCrop()
|
.centerCrop()
|
||||||
.placeholder(R.drawable.placeholder_image)
|
.placeholder(R.drawable.placeholder_image)
|
||||||
.error(R.drawable.placeholder_image)
|
.error(R.drawable.placeholder_image)
|
||||||
|
@ -46,7 +46,7 @@ class ChatViewModel @Inject constructor(
|
|||||||
|
|
||||||
// Store and product parameters
|
// Store and product parameters
|
||||||
private var storeId: Int = 0
|
private var storeId: Int = 0
|
||||||
private var productId: Int? = 0
|
private var productId: Int = 0
|
||||||
private var currentUserId: Int? = null
|
private var currentUserId: Int? = null
|
||||||
private var defaultUserId: Int = 0
|
private var defaultUserId: Int = 0
|
||||||
|
|
||||||
@ -100,8 +100,9 @@ class ChatViewModel @Inject constructor(
|
|||||||
productRating: Float? = 0f,
|
productRating: Float? = 0f,
|
||||||
storeName: String
|
storeName: String
|
||||||
) {
|
) {
|
||||||
|
this.productId = if (productId != null && productId > 0) productId else 0
|
||||||
|
|
||||||
this.storeId = storeId
|
this.storeId = storeId
|
||||||
this.productId = productId!!
|
|
||||||
this.productName = productName.toString()
|
this.productName = productName.toString()
|
||||||
this.productPrice = productPrice.toString()
|
this.productPrice = productPrice.toString()
|
||||||
this.productImage = productImage.toString()
|
this.productImage = productImage.toString()
|
||||||
@ -247,6 +248,11 @@ class ChatViewModel @Inject constructor(
|
|||||||
* Sends a chat message
|
* Sends a chat message
|
||||||
*/
|
*/
|
||||||
fun sendMessage(message: String) {
|
fun sendMessage(message: String) {
|
||||||
|
Log.d(TAG, "=== SEND MESSAGE ===")
|
||||||
|
Log.d(TAG, "Message: '$message'")
|
||||||
|
Log.d(TAG, "Has attachment: ${selectedImageFile != null}")
|
||||||
|
Log.d(TAG, "Selected image file: ${selectedImageFile?.absolutePath}")
|
||||||
|
Log.d(TAG, "File exists: ${selectedImageFile?.exists()}")
|
||||||
if (message.isBlank() && selectedImageFile == null) {
|
if (message.isBlank() && selectedImageFile == null) {
|
||||||
Log.e(TAG, "Cannot send message: Both message and image are empty")
|
Log.e(TAG, "Cannot send message: Both message and image are empty")
|
||||||
return
|
return
|
||||||
@ -282,12 +288,14 @@ class ChatViewModel @Inject constructor(
|
|||||||
// Send the message using the repository
|
// Send the message using the repository
|
||||||
// Note: We keep the chatRoomId parameter for compatibility with the repository method signature,
|
// Note: We keep the chatRoomId parameter for compatibility with the repository method signature,
|
||||||
// but it's not actually used in the API call
|
// but it's not actually used in the API call
|
||||||
|
val safeProductId = if (productId == 0) null else productId
|
||||||
|
|
||||||
|
|
||||||
val result = chatRepository.sendChatMessage(
|
val result = chatRepository.sendChatMessage(
|
||||||
storeId = storeId,
|
storeId = storeId,
|
||||||
message = message,
|
message = message,
|
||||||
productId = productId,
|
productId = safeProductId,
|
||||||
imageFile = selectedImageFile,
|
imageFile = selectedImageFile
|
||||||
chatRoomId = existingChatRoomId
|
|
||||||
)
|
)
|
||||||
|
|
||||||
when (result) {
|
when (result) {
|
||||||
|
@ -44,7 +44,14 @@ class PersonalNotificationAdapter(
|
|||||||
|
|
||||||
fun bind(notification: NotifItem) {
|
fun bind(notification: NotifItem) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
tvNotificationType.text = notification.type
|
val typeNotif = notification.type.toString()
|
||||||
|
if(typeNotif == "User"){
|
||||||
|
tvNotificationType.text = "Pembelian"
|
||||||
|
} else if (typeNotif == "Store"){
|
||||||
|
tvNotificationType.text = "Penjualan"
|
||||||
|
} else {
|
||||||
|
tvNotificationType.text = notification.type
|
||||||
|
}
|
||||||
tvTitle.text = notification.title
|
tvTitle.text = notification.title
|
||||||
tvDescription.text = notification.message
|
tvDescription.text = notification.message
|
||||||
|
|
||||||
@ -63,7 +70,7 @@ class PersonalNotificationAdapter(
|
|||||||
try {
|
try {
|
||||||
// Parse the date with the expected format from API
|
// Parse the date with the expected format from API
|
||||||
val inputFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault())
|
val inputFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault())
|
||||||
val outputFormat = SimpleDateFormat("HH:mm", Locale.getDefault())
|
val outputFormat = SimpleDateFormat("dd/MM/yyyy HH:mm", Locale.getDefault())
|
||||||
|
|
||||||
val date = inputFormat.parse(createdAt)
|
val date = inputFormat.parse(createdAt)
|
||||||
date?.let {
|
date?.let {
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="false"
|
||||||
android:theme="@style/Theme.Ecommerce_serang"
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.chat.ChatActivity">
|
tools:context=".ui.chat.ChatActivity">
|
||||||
|
|
||||||
@ -55,17 +56,17 @@
|
|||||||
app:layout_constraintTop_toTopOf="@+id/imgProfile"
|
app:layout_constraintTop_toTopOf="@+id/imgProfile"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/btnOptions" />
|
app:layout_constraintEnd_toStartOf="@+id/btnOptions" />
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:id="@+id/tvLastActive"
|
<!-- android:id="@+id/tvLastActive"-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginStart="8dp"
|
<!-- android:layout_marginStart="8dp"-->
|
||||||
android:text="Aktif 3 jam lalu"
|
<!-- android:text="Aktif 3 jam lalu"-->
|
||||||
android:textColor="#888888"
|
<!-- android:textColor="#888888"-->
|
||||||
android:textSize="12sp"
|
<!-- android:textSize="12sp"-->
|
||||||
app:layout_constraintStart_toEndOf="@+id/imgProfile"
|
<!-- app:layout_constraintStart_toEndOf="@+id/imgProfile"-->
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tvStoreName"
|
<!-- app:layout_constraintTop_toBottomOf="@+id/tvStoreName"-->
|
||||||
app:layout_constraintEnd_toEndOf="@+id/tvStoreName" />
|
<!-- app:layout_constraintEnd_toEndOf="@+id/tvStoreName" />-->
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btnOptions"
|
android:id="@+id/btnOptions"
|
||||||
@ -225,6 +226,8 @@
|
|||||||
android:hint="Tulis pesan"
|
android:hint="Tulis pesan"
|
||||||
android:fontFamily="@font/dmsans_regular"
|
android:fontFamily="@font/dmsans_regular"
|
||||||
android:inputType="textMultiLine"
|
android:inputType="textMultiLine"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
android:maxLines="4"
|
android:maxLines="4"
|
||||||
android:minHeight="40dp"
|
android:minHeight="40dp"
|
||||||
android:padding="8dp" />
|
android:padding="8dp" />
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black_800"
|
android:background="@color/black_800"
|
||||||
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.order.CheckoutActivity">
|
tools:context=".ui.order.CheckoutActivity">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
android:id="@+id/main"
|
android:id="@+id/main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.order.history.detailorder.DetailOrderStatusActivity">
|
tools:context=".ui.order.history.detailorder.DetailOrderStatusActivity">
|
||||||
|
|
||||||
<include
|
<include
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.profile.mystore.sells.payment.DetailPaymentActivity">
|
tools:context=".ui.profile.mystore.sells.payment.DetailPaymentActivity">
|
||||||
|
|
||||||
<include
|
<include
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.profile.DetailProfileActivity">
|
tools:context=".ui.profile.DetailProfileActivity">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
android:id="@+id/main"
|
android:id="@+id/main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.profile.editprofile.EditProfileCustActivity">
|
tools:context=".ui.profile.editprofile.EditProfileCustActivity">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.notif.NotificationActivity">
|
tools:context=".ui.notif.NotificationActivity">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
@ -31,7 +32,7 @@
|
|||||||
android:text="Notifikasi"
|
android:text="Notifikasi"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold" />
|
android:fontFamily="@font/dmsans_semibold" />
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
@ -46,6 +47,7 @@
|
|||||||
<com.google.android.material.tabs.TabItem
|
<com.google.android.material.tabs.TabItem
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/body_medium"
|
||||||
android:text="Notifikasi Saya" />
|
android:text="Notifikasi Saya" />
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabItem
|
<com.google.android.material.tabs.TabItem
|
||||||
@ -54,17 +56,17 @@
|
|||||||
android:text="Notifikasi Toko" />
|
android:text="Notifikasi Toko" />
|
||||||
</com.google.android.material.tabs.TabLayout>
|
</com.google.android.material.tabs.TabLayout>
|
||||||
|
|
||||||
<TextView
|
<!-- <TextView-->
|
||||||
android:id="@+id/tvMarkAllRead"
|
<!-- android:id="@+id/tvMarkAllRead"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginEnd="16dp"
|
<!-- android:layout_marginEnd="16dp"-->
|
||||||
android:padding="8dp"
|
<!-- android:padding="8dp"-->
|
||||||
android:text="Tandai Sudah Dibaca Semua"
|
<!-- android:text="Tandai Sudah Dibaca Semua"-->
|
||||||
android:textColor="@color/blue_500"
|
<!-- android:textColor="@color/blue_500"-->
|
||||||
android:textSize="12sp"
|
<!-- android:textSize="12sp"-->
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||||
app:layout_constraintTop_toBottomOf="@id/tabLayout" />
|
<!-- app:layout_constraintTop_toBottomOf="@id/tabLayout" />-->
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvNewest"
|
android:id="@+id/tvNewest"
|
||||||
@ -75,9 +77,9 @@
|
|||||||
android:text="Terbaru"
|
android:text="Terbaru"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:fontFamily="@font/dmsans_semibold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvMarkAllRead" />
|
app:layout_constraintTop_toBottomOf="@id/tabLayout" />
|
||||||
|
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/swipeRefreshLayout"
|
android:id="@+id/swipeRefreshLayout"
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.order.detail.PaymentActivity">
|
tools:context=".ui.order.detail.PaymentActivity">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
|
android:theme="@style/Theme.Ecommerce_serang"
|
||||||
tools:context=".ui.profile.mystore.profile.payment_info.PaymentInfoActivity">
|
tools:context=".ui.profile.mystore.profile.payment_info.PaymentInfoActivity">
|
||||||
|
|
||||||
<include
|
<include
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:text="Daftar Akun"
|
android:text="Daftar Akun"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
|
android:fontFamily="@font/dmsans_bold"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
android:text="Buka Toko"
|
android:text="Buka Toko"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold" />
|
android:fontFamily="@font/dmsans_medium" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -570,7 +570,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:background="#3F9CE8"
|
android:background="@color/blue_500"
|
||||||
|
android:fontFamily="@font/dmsans_medium"
|
||||||
android:text="Daftar"
|
android:text="Daftar"
|
||||||
android:textColor="@android:color/white" />
|
android:textColor="@android:color/white" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -40,6 +40,9 @@
|
|||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||||
<!-- <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>-->
|
<!-- <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>-->
|
||||||
|
|
||||||
|
<item name="android:textViewStyle">@style/body_medium</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Text Styles -->
|
<!-- Text Styles -->
|
||||||
|
Reference in New Issue
Block a user