Guruh: 314-17 Bajardi: Ne’matjonov A


Foydalanilgan Adabiyotlar


Download 1.68 Mb.
bet12/22
Sana08.01.2022
Hajmi1.68 Mb.
#247739
1   ...   8   9   10   11   12   13   14   15   ...   22
Bog'liq
Ne'matjonov Abduvohid

Foydalanilgan Adabiyotlar

  1. https://developer.android.com

  2. https://developer.android.com/docs

  3. https://about.gitlab.com

  4. https://www.linkedin.com

  5. https://sites.google.com/site/mxvpen/api


Ilova

package com.example.newsapp
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import com.example.newsapp.adapters.HomeAdapter
import com.example.newsapp.models.*
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity(), HomeAdapter.OnItemClickListener {

private var data: ArrayList = ArrayList()


private var adapter: HomeAdapter = HomeAdapter(this)

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
loadData()
adapter.setList(data)
home_list.adapter = adapter
home_list.layoutManager = LinearLayoutManager(this)
adapter.setItemClickListener(this)
}

private fun loadData() {


loadCategory()
loadSliderData()
loadNewsData()
}

private fun loadNewsData() {



var news = ArrayList()
news.add(
NewsData(
R.drawable.news1,

Download 1.68 Mb.

Do'stlaringiz bilan baham:
1   ...   8   9   10   11   12   13   14   15   ...   22




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