Package com example computergraphics import android os. Bundle



Download 200,3 Kb.
bet11/20
Sana08.01.2022
Hajmi200,3 Kb.
#331779
1   ...   7   8   9   10   11   12   13   14   ...   20
Bog'liq
Kompyuter Grafikasi

}

return binding.root
}

private fun loadData() {


list = ArrayList()
list.add(
Info(
"Sillabus Kompyuter grafikasi",
1,
"15 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24, "syllabus.pdf", 0
)
)
}

companion object {


/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment InfoFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
InfoFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}

override fun onMyClick(position: Int, info: Info) {


val bundle = bundleOf("info" to info)
MySharedPreferences.save2("ali1", info)
findNavController().navigate(R.id.dataFragment, bundle)
var loadData = MySharedPreferences.loadData("syllabus")
if (loadData==100){
loadData+=0
}else{
loadData += 100
MySharedPreferences.save("syllabus",loadData)
}

}

override fun setImage(position: Int, info: Info, imageView: Int) {



}
}

package com.example.computergraphics

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.core.os.bundleOf
import androidx.navigation.fragment.findNavController
import com.example.computergraphics.adapters.InfoAdapter
import com.example.computergraphics.adapters.OnMyClickListener1
import com.example.computergraphics.databinding.FragmentLaboratoriesBinding
import com.example.computergraphics.db.MyDbHelper
import com.example.computergraphics.utils.Count
import com.example.computergraphics.utils.Info
import com.example.computergraphics.utils.MySharedPreferences

// TODO: Rename parameter arguments, choose names that match


// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [LaboratoriesFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class LaboratoriesFragment : Fragment(), OnMyClickListener1 {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}

lateinit var infoAdapter: InfoAdapter


lateinit var list: ArrayList
lateinit var binding: FragmentLaboratoriesBinding
lateinit var myDbHelper: MyDbHelper
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
binding = FragmentLaboratoriesBinding.inflate(inflater, container, false)
MySharedPreferences.init(requireContext())
myDbHelper = MyDbHelper(
requireContext()
)
loadData()
infoAdapter = InfoAdapter(list, this)
binding.rvLab.adapter = infoAdapter
infoAdapter.setListener {
val list1 = myDbHelper.getAllMovies()
var a = false
for (i in 0 until list1.size) {
a = list[it].name == list1[i].name
if (a) {
break
} else {
continue
}
}
if (a) {
Toast.makeText(requireContext(), "Previously added.", Toast.LENGTH_SHORT).show()
} else {
list[it].image = R.drawable.ic_baseline_bookmark_added_24
infoAdapter.list = list
myDbHelper.addMovie(list[it])
infoAdapter.notifyDataSetChanged()
}


}
return binding.root
}

private fun loadData() {


list = ArrayList()
list.add(
Info(
"Laboratoriya ishi",
1,
"15 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab1.pdf",
0
)
)
list.add(
Info(
"Laboratoriya ishi",
2,
"25 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab2.pdf",
0
)
)
list.add(
Info(
"Laboratoriya ishi",
3,
"20 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab3.pdf",
0
)
)
list.add(
Info(
"Laboratoriya ishi",
4,
"18 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab4.pdf",
0
)
)
list.add(
Info(
"Laboratoriya ishi",
5,
"17 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab5.pdf",
0
)
)
list.add(
Info(
"Laboratoriya ishi",
6,
"10 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab6.pdf",
0
)
)
list.add(
Info(
"Laboratoriya ishi",
7,
"16 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab7.pdf",
0
)
)
list.add(
Info(
"Laboratoriya ishi",
8,
"15 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab8.pdf",
0
)
)
list.add(
Info(
"Laboratoriya ishi",
9,
"20 daqiqa o'qish",
R.drawable.ic_baseline_bookmark_add_24,
"lab9.pdf",
0
)
)
}

companion object {


/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment LaboratoriesFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
LaboratoriesFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)

Download 200,3 Kb.

Do'stlaringiz bilan baham:
1   ...   7   8   9   10   11   12   13   14   ...   20




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