Deponentlanadigan materiallarning titul varag‘i ehm uchun dastur


} linearlayouttest.setOnClickListener {



Yüklə 118,5 Kb.
səhifə3/8
tarix03.05.2023
ölçüsü118,5 Kb.
#107053
1   2   3   4   5   6   7   8
dep-materiallar-varaq

}
linearlayouttest.setOnClickListener {
startActivity(Intent(this@MainActivity2,MainActivity4::class.java))
}
}
}
}

package com.example.enlishforkidsbeginner

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.GridLayoutManager
import com.example.enlishforkidsbeginner.adapters.LearningAdapter
import com.example.enlishforkidsbeginner.databinding.ActivityMain3Binding
import com.example.enlishforkidsbeginner.model.Learning

class MainActivity3 : AppCompatActivity() {


lateinit var binding: ActivityMain3Binding
lateinit var learningAdapter: LearningAdapter

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)
binding = ActivityMain3Binding.inflate(layoutInflater)
setContentView(binding.root)

title="Learning"

var learnigarraylist = arrayListOf(


Learning("alphabet",R.drawable.abclearningimage ),
Learning("number",R.drawable.number ),
Learning("my room",R.drawable.myroom ),
Learning("my faimly",R.drawable.family1 ),
Learning("my school",R.drawable.school ),
Learning("days of the week",R.drawable.weekdays1),
Learning("fruits and vegetables",R.drawable.fruit),
Learning("body parts",R.drawable.feet),
Learning("weather and seasons",R.drawable.season),
Learning("Pets",R.drawable.pet),
Learning("color",R.drawable.palette),
)

learningAdapter= LearningAdapter(this@MainActivity3,learnigarraylist)


binding.recyclerviewlearning.layoutManager =GridLayoutManager(this@MainActivity3,1)
binding.recyclerviewlearning.adapter=learningAdapter

}
}

package com.example.enlishforkidsbeginner

import androidx.appcompat.app.AppCompatActivity


import android.os.Bundle
import androidx.recyclerview.widget.GridLayoutManager
import com.example.enlishforkidsbeginner.adapters.TestAdapter
import com.example.enlishforkidsbeginner.databinding.ActivityMain4Binding
import com.example.enlishforkidsbeginner.model.Learning

class MainActivity4 : AppCompatActivity() {


lateinit var binding: ActivityMain4Binding
lateinit var testAdapter: TestAdapter

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)
binding = ActivityMain4Binding.inflate(layoutInflater)
setContentView(binding.root)
title="Test"

var testarraylist = arrayListOf(


Learning("alphabet test", R.drawable.testing),
Learning("test for numbers", R.drawable.choice),
Learning("test for words", R.drawable.testnumber),
)

testAdapter= TestAdapter(this@MainActivity4,testarraylist)


binding.recryclerviewtest.layoutManager=GridLayoutManager(this@MainActivity4,1)
binding.recryclerviewtest.adapter=testAdapter

}

}


package com.example.enlishforkidsbeginner

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.GridLayoutManager
import com.example.enlishforkidsbeginner.adapters.AnotherAdapter
import com.example.enlishforkidsbeginner.adapters.LearningAlphabetAdapter
import com.example.enlishforkidsbeginner.adapters.NumberAdapter
import com.example.enlishforkidsbeginner.array.AlphabetArray
import com.example.enlishforkidsbeginner.array.AnotherArray
import com.example.enlishforkidsbeginner.array.NumberArray
import com.example.enlishforkidsbeginner.databinding.ActivityMainActivity5LearingBinding

class MainActivity5Learing : AppCompatActivity() {


lateinit var binding: ActivityMainActivity5LearingBinding
lateinit var learningAlphabetAdapter: LearningAlphabetAdapter
lateinit var numberAdapter: NumberAdapter
lateinit var anotherAdapter: AnotherAdapter

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)
binding = ActivityMainActivity5LearingBinding.inflate(layoutInflater)
setContentView(binding.root)
supportActionBar?.hide()

intent = intent


var titlename: String? = intent.getStringExtra("titlename")
binding.textviewTolbar.text = titlename.toString()

when(titlename){


"alphabet"->{
val alphabetArray = AlphabetArray()
learningAlphabetAdapter= LearningAlphabetAdapter(this@MainActivity5Learing,alphabetArray.arraylistalphabet)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,1)
binding.recrylerviewlearning2.adapter=learningAlphabetAdapter
}
"number"->{
val numberArray = NumberArray()
numberAdapter= NumberAdapter(this@MainActivity5Learing,numberArray.arraylistnuber)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=numberAdapter
}
"my room"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistmyroom)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
"my faimly"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistmyfamily)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
"my school"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistmyschool)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
"days of the week"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistdaysofweek)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
"fruits and vegetables"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistFruits)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
"body parts"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistbodyparts)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
"weather and seasons"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistweatherandseasons)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
"Pets"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistpets)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
"color"->{
val anotherArray = AnotherArray()
anotherAdapter= AnotherAdapter(this@MainActivity5Learing,anotherArray.arraylistcolor)
binding.recrylerviewlearning2.layoutManager=GridLayoutManager(this@MainActivity5Learing,2)
binding.recrylerviewlearning2.adapter=anotherAdapter
}
}
}
}

package com.example.enlishforkidsbeginner


import androidx.appcompat.app.AppCompatActivity


import android.os.Bundle
import android.view.View
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.example.enlishforkidsbeginner.databinding.ActivityMainActivity6TestBinding
import com.example.enlishforkidsbeginner.model.QuestionModel

class MainActivity6Test : AppCompatActivity() {


lateinit var binding:ActivityMainActivity6TestBinding
lateinit var questionRepository: QuestionRepository
lateinit var arrayList: ArrayList
lateinit var questionModel: QuestionModel
var trueanswer=0
var falseanswer=0
var count = 0
var cheked=true

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)
binding = ActivityMainActivity6TestBinding.inflate(layoutInflater)
setContentView(binding.root)
supportActionBar?.hide()

questionRepository = QuestionRepository()


arrayList = questionRepository.getAllQuestions()
arrayList.shuffle()

setQuestions()

binding.apply {
textviewnext.setOnClickListener {
setQuestions()


Yüklə 118,5 Kb.

Dostları ilə paylaş:
1   2   3   4   5   6   7   8




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin