Package com example computergraphics import android os. Bundle



Download 200,3 Kb.
bet1/20
Sana08.01.2022
Hajmi200,3 Kb.
#331779
  1   2   3   4   5   6   7   8   9   ...   20
Bog'liq
Kompyuter Grafikasi



package com.example.computergraphics

import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.navigation.NavigationView
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import androidx.drawerlayout.widget.DrawerLayout
import androidx.appcompat.app.AppCompatActivity
import com.example.computergraphics.databinding.ActivityMainBinding
import com.example.computergraphics.databinding.NavHeaderMainBinding
import com.google.android.material.internal.ContextUtils.getActivity

class MainActivity : AppCompatActivity() {

private lateinit var appBarConfiguration: AppBarConfiguration
private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)

binding = ActivityMainBinding.inflate(layoutInflater)


setContentView(binding.root)
binding.appBarMain.toolbar.title = "Computer Graphics"
setSupportActionBar(binding.appBarMain.toolbar)

val drawerLayout: DrawerLayout = binding.drawerLayout


val navView: NavigationView = binding.navView

val navController = findNavController(R.id.nav_host_fragment_content_main)


// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
appBarConfiguration = AppBarConfiguration(
setOf(
R.id.nav_home, R.id.bookmarksFragment, R.id.helpCenterFragment
), drawerLayout
)
setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)
navView.setNavigationItemSelectedListener(object :
NavigationView.OnNavigationItemSelectedListener {
override fun onNavigationItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.rate -> {
Toast.makeText(
this@MainActivity,
"Mazkur funksiya tez orada qo`shiladi :)",
Toast.LENGTH_SHORT
).show()
}
R.id.more -> {
Toast.makeText(
this@MainActivity,
"Mazkur funksiya tez orada qo`shiladi :)",
Toast.LENGTH_SHORT
).show()
}
R.id.send -> {
Toast.makeText(
this@MainActivity,
"Mazkur funksiya tez orada qo`shiladi :)",
Toast.LENGTH_SHORT
).show()
}
R.id.share -> {
Toast.makeText(
this@MainActivity,
"Mazkur funksiya tez orada qo`shiladi :)",
Toast.LENGTH_SHORT
).show()
}

}
return false


}

})
}


override fun onSupportNavigateUp(): Boolean {


val navController = findNavController(R.id.nav_host_fragment_content_main)
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
}

}

package com.example.computergraphics.adapters



import android.util.Log
import android.view.LayoutInflater
import android.view.ViewGroup
import android.view.animation.AnimationUtils
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.example.computergraphics.R
import com.example.computergraphics.databinding.ItemInfoBinding
import com.example.computergraphics.utils.Info

class InfoAdapter(var list: ArrayList, var onMyClickListener1: OnMyClickListener1) :


RecyclerView.Adapter() {

private var listener: ((Int) -> Unit)? = null

inner class Vh(var binding: ItemInfoBinding) : RecyclerView.ViewHolder(binding.root) {
fun onBind(info: Info) {
binding.number.text = info.number.toString()
binding.reading.text = info.read
binding.text.text = info.name
binding.imageView.setImageResource(info.image!!)
binding.infoBtn.setOnClickListener {
onMyClickListener1.onMyClick(adapterPosition, info)


Download 200,3 Kb.

Do'stlaringiz bilan baham:
  1   2   3   4   5   6   7   8   9   ...   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