Foydalanilgan adabiyotlar.
Effective Java 2001-yil . Joshua Bloch .
https://www.jetbrains.com sayti .
Internet qo’lanmalari .
Head First Android Development 15-mart, 2011. David Griffiths, Dawn Griffiths .
Android internet ma’lumotlari .
Ilova (dastur kodi)
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".StartActivity"
android:background="#F39D20">
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="123dp"
android:text="O'zbekiston Olimpia chempionlari"
android:textColor="#3d33a8"
android:textStyle="bold"
android:textSize="30sp"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView" />
android:id="@+id/imageView2"
android:layout_width="360dp"
android:layout_height="300dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/imageView"
app:layout_constraintVertical_bias="0.4"
app:srcCompat="@drawable/img"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"/>
android:id="@+id/startBtn"
android:layout_width="0dp"
android:layout_height="55dp"
android:layout_marginStart="100dp"
android:layout_marginEnd="100dp"
android:background="@drawable/white_button"
android:elevation="4dp"
android:foregroundGravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2"
app:layout_constraintVertical_bias="0.507">
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get Started"
android:textColor="#ff5e00"
android:textSize="23sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
package com.example.olympics;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearSnapHelper;
import androidx.recyclerview.widget.SnapHelper;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.example.olympics.Adapters.NewsAdapter;
import com.example.olympics.databinding.ActivityMainBinding;
import com.example.olympics.models.NewsData;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private List newsDataList;
private NewsAdapter newsAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
loadNews();
newsAdapter = new NewsAdapter(newsDataList, (newsData, position) -> {
Intent intent = new Intent(MainActivity.this,NewsActivity.class);
intent.putExtra("news", (Serializable) newsDataList.get(position));
startActivity(intent);
});
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this, DividerItemDecoration.VERTICAL);
binding.rv.addItemDecoration(dividerItemDecoration);
SnapHelper snapHelper = new LinearSnapHelper();
snapHelper.attachToRecyclerView(binding.rv);
binding.rv.setAdapter(newsAdapter);
binding.rv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this,NewsActivity.class);
intent.putExtra("news", (Serializable) newsDataList);
startActivity(intent);
}
});
}
private void loadNews() {
newsDataList = new ArrayList<>();
newsDataList.add(new NewsData("https://olympic.uz/uploads/news/6e829d927f3e35566cf226aa9e56db72.jpg","Olimpiada sovrindori bilan mahorat saboqlari","Ayni paytda rossiyalik taniqli voleybolchi, Afina-2004 Olimpiadasining kumush medal sohibasi rossiyalik Olga Nikolayeva mamlakatimizda boʻlib turibdi. Tashrif davomida mutaxassis bir qator hududlarda yosh voleybolchilar uchun mahorat saboqlari oʻtkazishi koʻzda tutilgan.\n" +
"\n" +
"Ana shunday tadbirlardan biri Qoʻqon shahrida tashkil etildi. Qoʻqon pedagogika institutida oʻtgan mahorat saboqlarida mazkur taʼlim dargohining jamoasi va Oʻzbekiston tumani yoshlari ishtirok etishdi. Tajribali voleybolchi uchrashuv davomida ushbu sport turidagi oʻziga xos qirralar, zamonaviy metodika boʻyicha qimmatli maʼlumotlar berdi."));
newsDataList.add(new NewsData("https://ichef.bbci.co.uk/news/800/cpsprodpb/1432A/production/_90803728_hi034720123.jpg","Rio 2016: O'zbekistonlik Olimpiada rekordini yangiladi","Ruslan Nuriddinov -105 kg vazn toifasida dast ko'tarishda 194 kg, siltab ko'tarishda 237 kg toshni ko'tarishga muvaffaq bo'ldi va Rio Olimpiadasi chempioniga aylandi.\n" +
"\n" +
"Aynan toshni siltab ko'tarishda qayd etgan natijasi Ruslan Nuriddinovning Olimpiada rekordini yangilashi uchun kifoya qildi.\n" +
"\n" +
"Ruslan Nuriddinov g'oliblik uchun kurashda armanistonlik og'ir atletikachi Simon Martirosyan(417 kg) va qozog'istonlik Aleksandr Zaychikov(416 kg)larni ortda qoldirib ketdi."));
newsDataList.add(new NewsData("https://www.gazeta.uz/media/img/2021/07/Um1gNs16270163096149_b.jpg","Olimpiada cho‘qqisini zabt etgan O‘zbekiston sportchilari","Lina Cheryazova 1989 yilda fristayl bo‘yicha Jahon kubogida Sobiq Ittifoq terma jamoasi tarkibida ishtirok etgan. Ittifoq parchalanganidan so‘ng O‘zbekiston nomidan xalqaro musobaqalarda qatnashgan.\n" +
"\n" +
"1994 yilda Norvegiyaning Lillexemmerida o‘tgan Olimpiada o‘yinlarida O‘zbekiston nomidan qatnashdi. U qo‘lga kiritgan qishki olimpiada o‘yinlari oltin medali hamon mamlakat tarixida yagonaligicha qolmoqda. Bundan tashqari, u akrobatikada fristayl bo‘yicha ham birinchi olimpiya chempioni hisoblanadi. Sportchi 1992−1994 yillarda Jahon kubogining 18 ta bosqichidan 13 tasida g‘alaba qozongan."));
newsDataList.add(new NewsData("https://www.gazeta.uz/media/img/2021/07/LkpIo916270411056585_b.jpg","Oksana Chusovitina","Oksana Chusovitina yetti bor (1992, 1996, 2000, 2004, 2008, 2012, 2016) yozgi Olimpiadada ishtirok etgan holda Ginnesning rekordlar kitobiga kiritilgan. Sportchi SSSR, Germaniya (2006−2012) nomidan Olimpiada o‘yinlarida ishtirok etgan, ayni vaqtda esa O‘zbekiston sharafini himoya qilmoqda. Chusovitina — 1992 yili jamoaviy bahsda olimpiya chempioni, uch karra jahon chempioni, Yevropa chempioni, Osiyo o‘yinlari chempioni bo‘lgan. U tayanib sakrashga ixtisoslashgan."));
newsDataList.add(new NewsData("https://www.gazeta.uz/media/img/2021/07/TFlzGZ16270258997685_b.jpg","Muhammadqodir Abdullayev","Muhammadqodir Abdullayev boks bo‘yicha Osiyo va jahon chempioni, Osiyo va Olimpiya o‘yinlari g‘olibi. 1999 va 2000 yillarda mamlakatimizda «Yilning eng yaxshi sportchisi» deb topilgan.\n" +
"\n" +
"Muhammadqodir Abdullayev 1995 yili Toshkentda o‘tkazilgan Markaziy Osiyo o‘yinlarida g‘olib chiqdi, Osiyo chempionatida ikkinchi o‘rinni egalladi, 1996 yili esa Atlantada o‘tadigan Olimpiya o‘yinlariga yo‘llanma oldi.\n" +
"\n" +
"U 1997 yili Malayziya poytaxti Kuala-Lumpurda Osiyo chempioni bo‘lgan. 1998 yili Xitoyning Chong-Ging shahridan jahon kubogi bilan qaytdi, Bangkokda o‘tkazilgan XIII Osiyo o‘yinlarida esa oltin medalga sazovor bo‘ldi.\n" +
"\n" +
"1999 yili AQShning Xyuston shahrida jahon chempioni degan yuksak unvonga musharraf bo‘ldi. Toshkentda o‘tgan Osiyo chempionatida g‘olib chiqib, Sidney Olimpiadasi yo‘llanmasini ko‘lga kiritgan.\n" +
"\n" +
"Sidney Olimpiadasida Muhammadqodir «jang\"larda raqiblari ustidan g‘alaba qozongan va yozgi Olimpiya o‘yinlarining birinchi chempioni sifatida O‘zbekiston sport tarixidan joy olgan."));
newsDataList.add(new NewsData("https://www.gazeta.uz/media/img/2021/07/6gPDky16270205878454_o.jpg","Artur Taymazov","Artur Taymazov kelib chiqishi osetin bo‘lgan o‘zbekistonlik erkin kurashchi. U uch karra Olimpiada chempioni (2004, 2008 va 2012 yillar), Sidney-2000 Olimpiadasi kumush medali sovrindori, ikki karra jahon chempioni, ikki karra Osiyo chempioni, uch karra Osiyo o‘yinlari g‘olibidir.\n" +
"\n" +
"Artur Taymazov sportning erkin kurash turi bo‘yicha O‘zbekiston sharafini xalqaro arenalarda munosib himoya qilgan sportchilardan biri. O‘zbekiston Olimpiya tarixida qo‘lga kiritilgan 6 ta oltin medaldan 3 tasining egasi.\n" +
"\n" +
"2000 yil Avstraliyaning Sidney shahridagi Olimpiada o‘yinlarida 2-o‘rin, 2004 yil Gretsiyaning Afina shahrida, 2008 yil Xitoyning Pekin shahridagi Olimpiada o‘yinlarida 1-o‘rinni egallab, O‘zbekiston tarixida birinchi marta ikki karra olimpiada g‘olibi degan nomni qo‘lga kiritgan.\n" +
"\n" +
"2012 yil Angliyaning London shahrida o‘tkazilgan yozgi Olimpiya o‘yinlarida ham 1-o‘rinni egallagan."));
newsDataList.add(new NewsData("https://www.gazeta.uz/media/img/2021/07/5uK6XO16270259707131_b.jpg","Artur Dokturishvili","Artur Dokturishvili kattalar o‘rtasidagi musobaqalarda qatnashishni 2000 yilda boshlagan va ilk urinishda Yevropa chempioni unvoniga sazovor bo‘lgan.\n" +
"\n" +
"2001 yildan O‘zbekiston terma jamoasi tarkibida gilamga chiqa boshlagan. 2003 yili Osiyo Kubogi sohibiga aylangan. 2004 yili Osiyo chempioniga aylangan, olimpiada arafasidagi saralash musobaqasida ikkinchi o‘rinni egallagan.\n" +
"\n" +
"Gretsiya poytaxti Afinada o‘tgan Olimpiada o‘yinlarida yunon-rum kurashi bo‘yicha musobaqada -74 kg vazn toifasida gilamga chiqqan. Ishtirokchilar avval guruhlarda davra tizimida bellashishgan. G‘oliblar bevosita yarim final yo‘llanmasiga ega bo‘lgan. Dokturishvili guruhda vengriyalik Tamash Berjich, gretsiyalik Aleksios Kolitsopulos va ozarbayjonlik Vugar Aslanov ustidan ishonchli g‘alabaga erishgan. Yarim finalda amaldagi olimpiada chempioni rossiyalik Varteres Samurgashevni mag‘lubiyatga uchratgan. Nihoyat, finalda fin sportchisi — avvalgi olimpiada o‘yinlarining kumush medali sohibi Marko Yuli-Xannukselani yenggan o‘zbek sportchisi Afinadagi olimpiadaning oltin medali egasiga aylangan."));
}
}
-
package com.example.olympics;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.example.olympics.databinding.ActivityStartBinding;
public class StartActivity extends AppCompatActivity {
private ActivityStartBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityStartBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
binding.startBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(StartActivity.this,MainActivity.class);
startActivity(intent);
}
});
}
}
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="horizontal"
android:id="@+id/recyclerView">
android:id="@+id/image"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@color/white"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
android:gravity=""
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="italic"
android:ellipsize="end"
android:maxLines="3"
android:id="@+id/title_tv"/>
|