Skip to content

Instantly share code, notes, and snippets.

View Kaaveh's full-sized avatar
🤓
Learning new technologies

Kaaveh Mohamedi Kaaveh

🤓
Learning new technologies
View GitHub Profile
plugins {
libs.plugins.apply {
alias(android.application) apply false
alias(kotlin.parcelize) apply false
alias(android.library) apply false
alias(kotlin.android) apply false
alias(hilt.android) apply false
alias(kotliner) apply false
alias(detekt) apply false
alias(ksp) apply false
@Kaaveh
Kaaveh / 1.kt
Last active December 4, 2022 17:30
@Composable
fun ContactList(
contacts: List<Contact>,
comparator: Comparator<Contact>,
modifier: Modifier = Modifier
) {
LazyColumn(modifier) {
// DON’T DO THIS
items(contacts.sortedWith(comparator)) { contact ->
// ...
class BannerAdapter(private val listener: OnCategoryClickListener) :
ListAdapter<Banner, BannerAdapter.BannerViewHolder>(DiffCallBack()) {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BannerViewHolder {
val binding = ItemRecyclerviewCategoriesSearchBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
)
return BannerViewHolder(binding)
package com.sanaebadi.foursquare.presentaion.util
import android.content.Context
import android.content.Context.CONNECTIVITY_SERVICE
import android.content.Intent
import android.content.pm.PackageManager
import android.net.ConnectivityManager
import android.net.Uri
import android.os.Build
import android.provider.Settings