masila trailer viewing in theme 2 and more screen.
Connectivity check. Apply coupon api integration and caching data in view models. Coupon selections and applications handling Integrated addresses api. Made views ready for cart addresses screen.
This commit is contained in:
@@ -7,6 +7,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.jwplayer.pub.api.media.playlists.PlaylistItem
|
||||
import com.woka.R
|
||||
import com.woka.WokaApp
|
||||
import com.woka.audiobooks.views.AudioBooksActivity
|
||||
@@ -15,7 +16,9 @@ import com.woka.home.viewmodels.HomeViewModel
|
||||
import com.woka.home.views.FMActivity
|
||||
import com.woka.karaoke.views.KaraokeActivity
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.players.models.VideoPlayList
|
||||
import com.woka.players.views.LiveStreamPlayerActivity
|
||||
import com.woka.players.views.PlayerActivity
|
||||
import com.woka.userPreference.UserType
|
||||
import com.woka.userdata.userDataModels.UserDataResponse
|
||||
import com.woka.utils.hide
|
||||
@@ -124,6 +127,29 @@ class Home2Fragment : Fragment() {
|
||||
startActivity(Intent(it, KaraokeActivity::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
playTrailer.setOnClickListener {
|
||||
activity?.let {
|
||||
it.startActivity(Intent(it, PlayerActivity::class.java).apply {
|
||||
putExtra(
|
||||
PlayerActivity.EXTRA_PLAY_LIST,
|
||||
VideoPlayList(
|
||||
ArrayList<PlaylistItem>().apply {
|
||||
add(
|
||||
PlaylistItem.Builder()
|
||||
.file("https://cdn.jwplayer.com/manifests/Iygt11AD.m3u8")
|
||||
.image("https://cdn.jwplayer.com/manifests/Iygt11AD.m3u8")
|
||||
.title("Masila")
|
||||
.build()
|
||||
)
|
||||
},
|
||||
null
|
||||
)
|
||||
)
|
||||
putExtra(PlayerActivity.EXTRA_PLAY_INDEX, 0)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +175,7 @@ class Home2Fragment : Fragment() {
|
||||
|
||||
exploreWokaTxt.text = getString(R.string.explore_woka)
|
||||
comingSoonTxt.text = getString(R.string.coming_soonn_on_woka)
|
||||
playTrailer.text = getString(R.string.play_trailer)
|
||||
playTrailerTxt.text = getString(R.string.play_trailer)
|
||||
masila.text = getString(R.string.masila)
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.woka.shop
|
||||
|
||||
import com.woka.networking.ApiResponse
|
||||
import com.woka.shop.models.addresslisting.ParentAddress
|
||||
import com.woka.shop.models.applycoupon.ApplyCouponResponse
|
||||
import com.woka.shop.models.cartlisting.CartResponse
|
||||
import com.woka.shop.models.categorylisting.CategoryResponse
|
||||
import com.woka.shop.models.couponlisting.CouponsResponse
|
||||
@@ -31,4 +33,10 @@ interface ShopApiService {
|
||||
|
||||
@GET("coupon_listing")
|
||||
suspend fun couponsListing(): Response<ApiResponse<CouponsResponse>>
|
||||
|
||||
@POST("applied_coupon_discount")
|
||||
suspend fun applyCoupon(@Body formBody: FormBody): Response<ApiResponse<ApplyCouponResponse>>
|
||||
|
||||
@GET("parent_address_listing")
|
||||
suspend fun parentAddressListing(): Response<ApiResponse<MutableList<ParentAddress>>>
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.woka.shop
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.networking.RetrofitHelper
|
||||
import com.woka.networking.RetrofitHelper.handleApiCall
|
||||
import com.woka.shop.models.addresslisting.ParentAddress
|
||||
import com.woka.shop.models.applycoupon.ApplyCouponResponse
|
||||
import com.woka.shop.models.cartlisting.CartResponse
|
||||
import com.woka.shop.models.categorylisting.CategoryResponse
|
||||
import com.woka.shop.models.couponlisting.CouponsResponse
|
||||
@@ -106,4 +108,21 @@ object ShopRepository {
|
||||
apiService.couponsListing()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun applyCoupon(couponData: String, amount: String): ApiResult<ApplyCouponResponse> {
|
||||
return handleApiCall {
|
||||
apiService.applyCoupon(
|
||||
FormBody.Builder()
|
||||
.add("coupon_code", couponData)
|
||||
.add("total_amount", amount)
|
||||
.build()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun parentAddressListing(): ApiResult<MutableList<ParentAddress>> {
|
||||
return handleApiCall {
|
||||
apiService.parentAddressListing()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,13 @@ import androidx.recyclerview.widget.AsyncDifferConfig
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||
import com.woka.R
|
||||
import com.woka.databinding.CouponViewHolderrBinding
|
||||
import com.woka.shop.models.couponlisting.CouponData
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
class CouponAdapter : ListAdapter<CouponData, CouponAdapter.CouponViewHolder>(DIFF_CONFIG) {
|
||||
class CouponAdapter(private var selectedCouponId: Int?) :
|
||||
ListAdapter<CouponData, CouponAdapter.CouponViewHolder>(DIFF_CONFIG) {
|
||||
|
||||
companion object {
|
||||
private val DIFF_UTIL = object : DiffUtil.ItemCallback<CouponData>() {
|
||||
@@ -18,7 +20,7 @@ class CouponAdapter : ListAdapter<CouponData, CouponAdapter.CouponViewHolder>(DI
|
||||
oldItem.id == newItem.id
|
||||
|
||||
override fun areContentsTheSame(oldItem: CouponData, newItem: CouponData): Boolean =
|
||||
oldItem == newItem
|
||||
oldItem.id == newItem.id
|
||||
}
|
||||
|
||||
private val DIFF_CONFIG = AsyncDifferConfig.Builder(DIFF_UTIL)
|
||||
@@ -28,6 +30,10 @@ class CouponAdapter : ListAdapter<CouponData, CouponAdapter.CouponViewHolder>(DI
|
||||
|
||||
inner class CouponViewHolder(val binding: CouponViewHolderrBinding) : ViewHolder(binding.root)
|
||||
|
||||
var onSelectionChanged: ((CouponData) -> Unit)? = null
|
||||
|
||||
private var selectedCouponPos: Int? = null
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CouponViewHolder {
|
||||
return CouponViewHolder(
|
||||
CouponViewHolderrBinding.inflate(
|
||||
@@ -47,6 +53,28 @@ class CouponAdapter : ListAdapter<CouponData, CouponAdapter.CouponViewHolder>(DI
|
||||
|
||||
val finalTxt = "$off OFF with coupon code ${coupon.coupon_code}"
|
||||
textView.text = finalTxt
|
||||
|
||||
textView.setBackgroundResource(
|
||||
if (selectedCouponId == coupon.id) R.color.coupon_selection
|
||||
else R.color.white
|
||||
)
|
||||
|
||||
root.setOnClickListener {
|
||||
if (selectedCouponId != coupon.id) {
|
||||
selectedCouponId = coupon.id
|
||||
onSelectionChanged?.invoke(coupon)
|
||||
|
||||
selectedCouponPos?.let {
|
||||
if (it >= 0 && it < currentList.size){
|
||||
notifyItemChanged(it)
|
||||
}
|
||||
}
|
||||
|
||||
selectedCouponPos = holder.absoluteAdapterPosition
|
||||
|
||||
textView.setBackgroundResource(R.color.coupon_selection)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.woka.shop.models.addresslisting
|
||||
|
||||
data class ParentAddress(
|
||||
val address: String?,
|
||||
val address_name: String?,
|
||||
val address_type: String?,
|
||||
val city: String?,
|
||||
val country: String?,
|
||||
val email: String?,
|
||||
val id: Int?,
|
||||
val phone_no: String?,
|
||||
val pincode: String?,
|
||||
val state: String?
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.woka.shop.models.applycoupon
|
||||
|
||||
data class ApplyCouponResponse(
|
||||
val cart_discounted_amount: String?,
|
||||
val cart_total_amount: String?,
|
||||
val discount_value: String?
|
||||
)
|
||||
@@ -6,6 +6,8 @@ import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.shop.ShopRepository
|
||||
import com.woka.shop.models.addresslisting.ParentAddress
|
||||
import com.woka.shop.models.applycoupon.ApplyCouponResponse
|
||||
import com.woka.shop.models.cartlisting.CartResponse
|
||||
import com.woka.shop.models.couponlisting.CouponsResponse
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -14,6 +16,9 @@ class CartViewModel: ViewModel() {
|
||||
|
||||
// ui callbacks
|
||||
var onToolBarTitleChange: ((String) -> Unit)? = null
|
||||
var appliedCoupon: String? = null
|
||||
var selectedCouponId: Int? = null
|
||||
var selectedCouponCode: String? = null
|
||||
|
||||
// data callbacks
|
||||
private val repository = ShopRepository
|
||||
@@ -36,4 +41,27 @@ class CartViewModel: ViewModel() {
|
||||
suspend fun loadCoupons(): ApiResult<CouponsResponse>{
|
||||
return repository.couponsListing()
|
||||
}
|
||||
|
||||
// applying coupon
|
||||
private val _applyCouponLiveData = MutableLiveData<ApiResult<ApplyCouponResponse>?>()
|
||||
val applyCouponLiveData: LiveData<ApiResult<ApplyCouponResponse>?>
|
||||
get() = _applyCouponLiveData
|
||||
|
||||
fun applyCoupon(couponData: String, amount: String){
|
||||
viewModelScope.launch {
|
||||
_applyCouponLiveData.postValue(ApiResult.Loading())
|
||||
_applyCouponLiveData.postValue(repository.applyCoupon(couponData, amount))
|
||||
}
|
||||
}
|
||||
|
||||
fun clearAppliedCoupon(){
|
||||
_applyCouponLiveData.postValue(null)
|
||||
appliedCoupon = null
|
||||
selectedCouponCode = null
|
||||
selectedCouponId = null
|
||||
}
|
||||
|
||||
suspend fun parentAddressListing(): ApiResult<MutableList<ParentAddress>> {
|
||||
return repository.parentAddressListing()
|
||||
}
|
||||
}
|
||||
@@ -101,6 +101,7 @@ class CartFragment: Fragment() {
|
||||
}
|
||||
|
||||
binding.checkout.setOnClickListener {
|
||||
viewModel.clearAppliedCoupon()
|
||||
findNavController().navigate(R.id.action_cartFragment_to_orderSummaryFragment)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,14 +8,17 @@ import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.woka.R
|
||||
import com.woka.databinding.FragmentOrderSummaryBinding
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.shop.adapters.CouponAdapter
|
||||
import com.woka.shop.adapters.SummaryCartAdapter
|
||||
import com.woka.shop.viewmodels.CartViewModel
|
||||
import com.woka.utils.ProgressView
|
||||
import com.woka.utils.hide
|
||||
import com.woka.utils.show
|
||||
import com.woka.utils.toast
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class OrderSummaryFragment : Fragment() {
|
||||
@@ -24,6 +27,9 @@ class OrderSummaryFragment : Fragment() {
|
||||
private lateinit var viewModel: CartViewModel
|
||||
private lateinit var adapter: SummaryCartAdapter
|
||||
private lateinit var couponAdapter: CouponAdapter
|
||||
private lateinit var progressView: ProgressView
|
||||
|
||||
private var cartTotalAmount: String? = null
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
@@ -33,7 +39,8 @@ class OrderSummaryFragment : Fragment() {
|
||||
|
||||
viewModel = ViewModelProvider(requireActivity())[CartViewModel::class.java]
|
||||
adapter = SummaryCartAdapter()
|
||||
couponAdapter = CouponAdapter()
|
||||
couponAdapter = CouponAdapter(viewModel.selectedCouponId)
|
||||
progressView = ProgressView(requireContext())
|
||||
|
||||
return binding.root
|
||||
}
|
||||
@@ -50,62 +57,141 @@ class OrderSummaryFragment : Fragment() {
|
||||
loadCoupons()
|
||||
}
|
||||
|
||||
private fun initViews(){
|
||||
private fun initViews() {
|
||||
binding.apply {
|
||||
viewModel.onToolBarTitleChange?.invoke(getString(R.string.payment_options))
|
||||
|
||||
rvCart.adapter = adapter
|
||||
rvCoupons.adapter = couponAdapter
|
||||
rvCoupons.itemAnimator = null
|
||||
|
||||
couponCode.setText(viewModel.selectedCouponCode)
|
||||
}
|
||||
}
|
||||
|
||||
private fun clickEvents(){
|
||||
private fun clickEvents() {
|
||||
binding.apply {
|
||||
showCoupons.setOnClickListener{
|
||||
if (rvCoupons.isVisible){
|
||||
rvCoupons.hide()
|
||||
showCoupons.setOnClickListener {
|
||||
if (couponsView.isVisible) {
|
||||
couponsView.hide()
|
||||
showCouponIndicator.setImageResource(R.drawable.ic_half_arrow_right)
|
||||
}else{
|
||||
rvCoupons.show()
|
||||
} else {
|
||||
couponsView.show()
|
||||
showCouponIndicator.setImageResource(R.drawable.ic_half_arrow_up)
|
||||
}
|
||||
}
|
||||
|
||||
applyBtn.setOnClickListener {
|
||||
if (couponCode.text.isEmpty()) {
|
||||
toast(getString(R.string.enter_a_valid_coupon_code))
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
if (viewModel.appliedCoupon == couponCode.text.toString()) {
|
||||
toast(getString(R.string.coupon_already_applied))
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
viewModel.applyCoupon(couponCode.text.toString(), "$cartTotalAmount")
|
||||
}
|
||||
|
||||
confirm.setOnClickListener {
|
||||
findNavController().navigate(R.id.action_orderSummaryFragment_to_parentAddressFragment)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadCoupons(){
|
||||
private fun loadCoupons() {
|
||||
lifecycleScope.launch {
|
||||
when (val response = viewModel.loadCoupons()){
|
||||
when (val response = viewModel.loadCoupons()) {
|
||||
is ApiResult.Error -> {}
|
||||
is ApiResult.Loading -> {}
|
||||
is ApiResult.Success -> {
|
||||
response.data?.result?.filterNotNull()?.let {
|
||||
couponAdapter.submitList(it)
|
||||
if (it.isNotEmpty()) {
|
||||
couponAdapter.submitList(it) {
|
||||
binding.rvCoupons.show()
|
||||
binding.noCouponsView.hide()
|
||||
}
|
||||
|
||||
return@launch
|
||||
}
|
||||
}
|
||||
|
||||
binding.rvCoupons.hide()
|
||||
binding.noCouponsView.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setObservers() {
|
||||
viewModel.cartListLiveData.observe(viewLifecycleOwner){
|
||||
couponAdapter.onSelectionChanged = {
|
||||
binding.couponCode.setText(it.coupon_code)
|
||||
viewModel.selectedCouponCode = it.coupon_code
|
||||
viewModel.selectedCouponId = it.id
|
||||
}
|
||||
|
||||
viewModel.applyCouponLiveData.observe(viewLifecycleOwner) {
|
||||
when (it) {
|
||||
is ApiResult.Error -> {
|
||||
progressView.hide()
|
||||
toast(it.errorMessage)
|
||||
}
|
||||
|
||||
is ApiResult.Loading -> {
|
||||
progressView.show(getString(R.string.applying_coupon))
|
||||
}
|
||||
|
||||
is ApiResult.Success -> {
|
||||
progressView.hide()
|
||||
it.data?.let {
|
||||
binding.apply {
|
||||
|
||||
viewModel.appliedCoupon = couponCode.text.toString()
|
||||
|
||||
subTotalAmount.text = it.cart_total_amount
|
||||
discountAmount.text = it.discount_value
|
||||
totalAmount.text = it.cart_discounted_amount
|
||||
|
||||
discountView.show()
|
||||
|
||||
discountView.post {
|
||||
root.smoothScrollTo(0, root.height + discountView.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
null -> {}
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.cartListLiveData.observe(viewLifecycleOwner) {
|
||||
binding.apply {
|
||||
when (it){
|
||||
when (it) {
|
||||
is ApiResult.Error -> {
|
||||
rvCart.hide()
|
||||
}
|
||||
|
||||
is ApiResult.Loading -> {
|
||||
rvCart.hide()
|
||||
}
|
||||
|
||||
is ApiResult.Success -> {
|
||||
it.data?.let {cartData ->
|
||||
cartData.result?.let {cartList ->
|
||||
if (cartList.isNotEmpty()){
|
||||
it.data?.let { cartData ->
|
||||
cartData.result?.let { cartList ->
|
||||
if (cartList.isNotEmpty()) {
|
||||
mainLayout.show()
|
||||
adapter.submitList(cartList){
|
||||
adapter.submitList(cartList) {
|
||||
rvCart.show()
|
||||
|
||||
val finalAmount = "₹ ${cartData.total_amount}"
|
||||
totalAmount.text = finalAmount
|
||||
|
||||
cartTotalAmount = "${cartData.total_amount?.toInt()}"
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
// cart is empty
|
||||
rvCart.hide()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.woka.shop.views.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.woka.R
|
||||
import com.woka.databinding.FragmentParentAddressBinding
|
||||
import com.woka.shop.viewmodels.CartViewModel
|
||||
|
||||
class ParentAddressFragment : Fragment() {
|
||||
|
||||
private lateinit var binding: FragmentParentAddressBinding
|
||||
private lateinit var viewModel: CartViewModel
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
binding = FragmentParentAddressBinding.inflate(inflater, container, false)
|
||||
viewModel = ViewModelProvider(requireActivity())[CartViewModel::class.java]
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
initViews()
|
||||
}
|
||||
|
||||
private fun initViews(){
|
||||
binding.apply {
|
||||
viewModel.onToolBarTitleChange?.invoke(getString(R.string.address_details))
|
||||
}
|
||||
}
|
||||
}
|
||||
9
app/src/main/res/drawable/round_stroke_25.xml
Normal file
9
app/src/main/res/drawable/round_stroke_25.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<stroke android:color="@color/color_primary"
|
||||
android:width="1dp"/>
|
||||
|
||||
<corners android:radius="25dp"/>
|
||||
|
||||
</shape>
|
||||
83
app/src/main/res/layout/cart_address_view_holder.xml
Normal file
83
app/src/main/res/layout/cart_address_view_holder.xml
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:buttonTint="@color/color_primary"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="Aditya Gaikwad"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="@dimen/_12ssp"
|
||||
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="Palm Spring, New Link Raod\nMalad, Mumbai, Maharashtra\n400001"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
|
||||
android:layout_marginTop="2dp"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="Phone no: 828282827"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
|
||||
android:layout_marginTop="2dp"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/expected_delivery"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="Expected delivery by:\n2024-22-02"
|
||||
android:fontFamily="@font/exo_2_medium"
|
||||
android:textColor="@android:color/holo_red_light"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
|
||||
android:layout_marginTop="2dp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -590,6 +590,7 @@
|
||||
/>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/play_trailer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/round_25"
|
||||
@@ -598,7 +599,7 @@
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/play_trailer"
|
||||
android:id="@+id/play_trailer_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
|
||||
@@ -130,16 +130,40 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_coupons"
|
||||
<RelativeLayout
|
||||
android:id="@+id/coupons_view"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/coupon_view_holderr"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
/>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_coupons"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/coupon_view_holderr"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_coupons_view"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/no_coupons_found"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="@dimen/_12ssp"
|
||||
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="10dp"
|
||||
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/discount_view"
|
||||
@@ -280,7 +304,7 @@
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/checkout"
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
|
||||
151
app/src/main/res/layout/fragment_parent_address.xml
Normal file
151
app/src/main/res/layout/fragment_parent_address.xml
Normal file
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/grad_my_list"
|
||||
tools:context=".shop.views.fragments.ParentAddressFragment">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/round_25"
|
||||
android:layout_margin="15dp"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/round_stroke_25"
|
||||
android:layout_margin="10dp"
|
||||
>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_addresses"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/cart_address_view_holder"
|
||||
tools:itemCount="3"
|
||||
android:orientation="vertical"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/buttons"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/no_data_view"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/buttons">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/img_support"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/no_addresses_added"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
android:id="@+id/shimmer"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
|
||||
app:shimmer_auto_start="true"
|
||||
app:shimmer_duration="1500"
|
||||
app:shimmer_highlight_alpha="0.5"
|
||||
|
||||
android:layout_marginVertical="15dp"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/buttons"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/parent_addrress_placeholder"/>
|
||||
<include layout="@layout/parent_addrress_placeholder"/>
|
||||
<include layout="@layout/parent_addrress_placeholder"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.facebook.shimmer.ShimmerFrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
>
|
||||
|
||||
<Button
|
||||
android:id="@+id/select_address"
|
||||
android:visibility="visible"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/_30sdp"
|
||||
|
||||
android:text="@string/use_selected_address"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
android:textAllCaps="false"
|
||||
|
||||
android:background="@drawable/gradient_btn_bg"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginVertical="10dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_new_address"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/_30sdp"
|
||||
|
||||
android:text="@string/add_new_address"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
android:textAllCaps="false"
|
||||
|
||||
android:background="@drawable/gradient_btn_bg_2"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
52
app/src/main/res/layout/parent_addrress_placeholder.xml
Normal file
52
app/src/main/res/layout/parent_addrress_placeholder.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_margin="15dp"
|
||||
>
|
||||
|
||||
<View
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
|
||||
android:background="@drawable/round_25"
|
||||
android:backgroundTint="@android:color/darker_gray"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp"
|
||||
|
||||
android:background="@drawable/round_25"
|
||||
android:backgroundTint="@android:color/darker_gray"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
|
||||
android:background="@drawable/round_25"
|
||||
android:backgroundTint="@android:color/darker_gray"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
|
||||
android:background="@drawable/round_25"
|
||||
android:backgroundTint="@android:color/darker_gray"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -18,5 +18,14 @@
|
||||
android:id="@+id/orderSummaryFragment"
|
||||
android:name="com.woka.shop.views.fragments.OrderSummaryFragment"
|
||||
android:label="fragment_order_summary"
|
||||
tools:layout="@layout/fragment_order_summary" />
|
||||
tools:layout="@layout/fragment_order_summary" >
|
||||
<action
|
||||
android:id="@+id/action_orderSummaryFragment_to_parentAddressFragment"
|
||||
app:destination="@id/parentAddressFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/parentAddressFragment"
|
||||
android:name="com.woka.shop.views.fragments.ParentAddressFragment"
|
||||
android:label="fragment_parent_address"
|
||||
tools:layout="@layout/fragment_parent_address" />
|
||||
</navigation>
|
||||
@@ -7,6 +7,7 @@
|
||||
<color name="color_primary">#09005D</color>
|
||||
<color name="color_primary_dark">#050038</color>
|
||||
<color name="woka_sky_blue">#6ed5fe</color>
|
||||
<color name="coupon_selection">#B7EFFE</color>
|
||||
|
||||
<color name="my_orders_img_color">#8081D6F7</color>
|
||||
|
||||
|
||||
@@ -238,4 +238,12 @@
|
||||
<string name="confirm">CONFIRM</string>
|
||||
<string name="subtotal">Subtotal:</string>
|
||||
<string name="discount">Discount:</string>
|
||||
<string name="enter_a_valid_coupon_code">Enter a valid coupon code.</string>
|
||||
<string name="applying_coupon">Applying coupon</string>
|
||||
<string name="no_coupons_found">No coupons found</string>
|
||||
<string name="coupon_already_applied">Coupon already applied</string>
|
||||
<string name="address_details">ADDRESS DETAILS</string>
|
||||
<string name="add_new_address">Add New Address</string>
|
||||
<string name="use_selected_address">Use Selected Address</string>
|
||||
<string name="no_addresses_added">No Addresses added</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user