Amaliy ish №3,4 Topshirdi: Ustaboyev Abbosbek Qabul qildi: Jabborova N. Toshkent 022 Mavzu: Dasturiy mahsulotning backend qismi. Dastur kodi va screenshot: Bu ilova mvvm arhitekturasida qili Shopping Repository


}) viewModel.progress.observe(this,Observer{



Download 453,35 Kb.
bet7/11
Sana20.07.2022
Hajmi453,35 Kb.
#829770
1   2   3   4   5   6   7   8   9   10   11
Bog'liq
UnitTest Dik 3-4

})
viewModel.progress.observe(this,Observer{
swipe.isRefreshing = it
}
)
}

override fun onCreateView(


inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_favorite, container, false)
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {


super.onViewCreated(view, savedInstanceState)
recyclerProducts.layoutManager = LinearLayoutManager(requireActivity())

swipe.setOnRefreshListener {


loadData()
}
loadData()
}

fun loadData(){


viewModel.getProductsByIds(PrefUtils.getFavoriteList())
}

companion object {


@JvmStatic
fun newInstance() = FavoriteFragment()
}
}
package mobiler.abbosbek.onlineshopping.screen.CartScreen

import android.content.Intent


import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.Toast
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.fragment_cart.*
import kotlinx.android.synthetic.main.fragment_cart.view.*
import kotlinx.android.synthetic.main.fragment_favorite.*
import mobiler.abbosbek.onlineshopping.MakeOrderActivity
import mobiler.abbosbek.onlineshopping.R
import mobiler.abbosbek.onlineshopping.model.ProductModel
import mobiler.abbosbek.onlineshopping.screen.MainViewModel
import mobiler.abbosbek.onlineshopping.utils.Constants
import mobiler.abbosbek.onlineshopping.utils.PrefUtils
import mobiler.abbosbek.onlineshopping.view.CartAdapter
import java.io.Serializable

class CartFragment : Fragment() {

lateinit var viewModel : MainViewModel

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)

viewModel = ViewModelProvider(this).get(MainViewModel::class.java)

viewModel.progress.observe(this,Observer{
swipeCart.isRefreshing = it
}
)

viewModel.error.observe(this,Observer{


Toast.makeText(requireActivity(),it,Toast.LENGTH_SHORT).show()

Download 453,35 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   10   11




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish