Home oynasi class sifatida elon qilindi va fragmentdan ikki nuqta orqali voris olindi


Download 1.88 Mb.
bet2/2
Sana17.06.2023
Hajmi1.88 Mb.
#1552565
1   2
Bog'liq
MM

//about oynasiga o`tish
binding.drawerLayout.closeDrawer(GravityCompat.START)
}
binding.drawerLayout.closeDrawer(GravityCompat.START){//drawerni ishga tushurish jarayoni
findNavController().navigate(HomeScreenDirections.actionHomeFragmentToSavedWordFragment())//qidiruv oynasiga o`tish
}
R.id.
exit_app -> {//chiqish knopkasini bosilishini sezish
requireActivity().finish()//activitiyni finish qildik
}
//ilovadan chiqib ketish
}
return@setNavigationItemSelectedListener true//operatsiya bajarilishi haqidagi elon
}

viewModel.getAllWord()//barcha sozlarni ekranga yig`ish
viewModel.allWords.observe(viewLifecycleOwner) {//observer patterga asoslangan holatda kod yozishda davom etdik , owner sifatida view nikini berdik.
adapter.submitCursor(it)//submit qildik , yangiladik malumotlarni
}

}

xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
app:cardBackgroundColor="@color/white"
android:foreground="?attr/selectableItemBackground"
app:cardCornerRadius="12dp"
app:cardElevation="4dp"
app:cardMaxElevation="12dp"
android:background="@drawable/bg_list_item"
app:cardPreventCornerOverlap="true"
>


android:layout_margin="12dp"
android:layout_width="match_parent"
android:layout_height="match_parent">

android:id="@+id/tv_word_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

android:id="@+id/tv_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_word_name" />

android:layout_marginTop="4dp"
app:layout_constraintTop_toBottomOf="@id/tv_word_name"
app:layout_constraintStart_toEndOf="@id/tv_txt"
android:id="@+id/tv_txt2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="6dp"
android:text="wkjed"
android:fontFamily="@font/prata"
android:textColor="@color/black"
android:textSize="18sp"
/>

app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/img_bookmark"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="12dp"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_bookmark"
app:tint="@color/app_color" />





3.Foydalanilgan adabiyotlar :
https://translate.google.com/?hl=ru HYPERLINK "https://translate.google.com/?hl=ru&sl=uz&tl=en&text=yo%60l&op=translate"& HYPERLINK "https://translate.google.com/?hl=ru&sl=uz&tl=en&text=yo%60l&op=translate"sl=uz HYPERLINK "https://translate.google.com/?hl=ru&sl=uz&tl=en&text=yo%60l&op=translate"& HYPERLINK "https://translate.google.com/?hl=ru&sl=uz&tl=en&text=yo%60l&op=translate"tl=en HYPERLINK "https://translate.google.com/?hl=ru&sl=uz&tl=en&text=yo%60l&op=translate"& HYPERLINK "https://translate.google.com/?hl=ru&sl=uz&tl=en&text=yo%60l&op=translate"text=yo%60l HYPERLINK "https://translate.google.com/?hl=ru&sl=uz&tl=en&text=yo%60l&op=translate"& HYPERLINK "https://translate.google.com/?hl=ru&sl=uz&tl=en&text=yo%60l&op=translate"op=translate


https://www.google.com/


https://lms.tuit.uz/student/my-courses/show/12987
Download 1.88 Mb.

Do'stlaringiz bilan baham:
1   2




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