This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** first push **/ | |
cd github/ | |
git init | |
git add . | |
git config --global user.email "email" | |
git config --global user.name "user_name" | |
git commit -m "initial commit" | |
git remote add origin https://github.com/user_name/repo.git | |
git push origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implementation "io.reactivex.rxjava3:rxkotlin:3.0.0" | |
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' | |
implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0' | |
binding.buttonOne.clicks() | |
.buffer(4, TimeUnit.SECONDS, 5) | |
.filter { it.size == 5 } | |
.subscribe { | |
// code here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
supportFragmentManager.commit { | |
replace(binding.container.id, MyFragment::class.java, bundleOf( | |
"KEY" to "userId" | |
)) | |
addToBackStack(null) | |
} | |
FragmentTransaction ft = supportFragmentManager.beginTransaction() | |
ft.replace(binding.container.id, MyFragment.newInstance("userId")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyAdapter (val list : List<Model>) | |
: RecyclerView.Adapter<MyAdapter.ViewHolder>(){ | |
class ViewHolder(val binding: ListItemBinding): RecyclerView.ViewHolder(binding.root) | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | |
val binding: ListItemBinding = ListItemBinding.inflate( | |
LayoutInflater.from(parent.context), parent, false | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<androidx.cardview.widget.CardView | |
android:background="?attr/selectableItemBackground" | |
android:clickable="true" | |
android:focusable="true" | |
app:cardElevation="0dp"/> | |
card.setCardBackgroundColor(ContextCompat.getColor(context, R.color.light_ash)) | |
<TextView | |
android:background="?attr/editTextBackground" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0' | |
val plants: LiveData<String> = liveData { | |
emit("Mango tree") | |
delay(500) | |
emit("JackFruit tree") | |
} | |
val fruits: Flow<String> = flow { | |
emit("Apple") |