This file contains hidden or 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
package //your.package | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.lazy.grid.GridItemSpan | |
import androidx.compose.foundation.lazy.grid.LazyGridItemScope | |
import androidx.compose.foundation.lazy.grid.LazyGridItemSpanScope | |
import androidx.compose.foundation.lazy.grid.LazyGridScope | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Modifier | |
import androidx.paging.LoadState |
This file contains hidden or 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
//package ... | |
import androidx.compose.foundation.lazy.LazyItemScope | |
import androidx.compose.foundation.lazy.LazyListScope | |
import androidx.compose.foundation.lazy.grid.GridItemSpan | |
import androidx.compose.foundation.lazy.grid.LazyGridItemScope | |
import androidx.compose.foundation.lazy.grid.LazyGridItemSpanScope | |
import androidx.compose.foundation.lazy.grid.LazyGridScope | |
import androidx.compose.runtime.Composable | |
import androidx.paging.compose.LazyPagingItems |
This file contains hidden or 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
//package your.package.here | |
import android.content.Context | |
import android.os.Handler | |
import android.os.Looper | |
import android.util.AttributeSet | |
import android.view.MotionEvent | |
import android.view.View | |
import android.view.View.OnTouchListener | |
import androidx.appcompat.widget.AppCompatTextView |
This file contains hidden or 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
//package com.example.app.util | |
import android.view.HapticFeedbackConstants | |
import androidx.annotation.CallSuper | |
import androidx.recyclerview.widget.DiffUtil | |
import androidx.recyclerview.widget.ListAdapter | |
import androidx.recyclerview.widget.RecyclerView | |
abstract class HapticScrollListAdapter<T, VH : RecyclerView.ViewHolder>(diffCallback: DiffUtil.ItemCallback<T>) : ListAdapter<T, VH>(diffCallback) { | |
protected var isScrolling: Boolean = false |
This file contains hidden or 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
import android.os.Handler | |
import android.os.Looper | |
import android.os.Message | |
import kotlinx.coroutines.CoroutineDispatcher | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.launch | |
import java.lang.ref.WeakReference | |
import java.util.concurrent.atomic.AtomicBoolean |
This file contains hidden or 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
//package ... | |
import android.content.Context | |
import android.view.GestureDetector | |
import android.view.MotionEvent | |
import android.view.View | |
import androidx.recyclerview.widget.RecyclerView | |
fun RecyclerView.setOnItemClickListener(onItemClickListener: (itemView: View, position: Int) -> Unit) { | |
addOnItemTouchListener( |
This file contains hidden or 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
//package ... | |
import java.net.UnknownHostException | |
sealed class APIResponse<T>(val success: Boolean) { | |
class APISuccess<T>(val data: T) : APIResponse<T>(true) | |
sealed class APIFail<T>(val message: String) : APIResponse<T>(false) { | |
class APIUnsuccessful<T>(val code: Int, message: String) : APIFail<T>(message) { | |
constructor(other: APIUnsuccessful<out Any>) : this(other.code, other.message) | |
} |
This file contains hidden or 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
/** | |
* Home for useful extension functions. | |
*/ | |
//package ... | |
import android.content.Context | |
import android.content.Intent | |
import android.text.Editable | |
import android.text.Spannable | |
import android.text.SpannableString |
This file contains hidden or 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
//package ... | |
import android.content.ContentResolver | |
import android.content.Context | |
import android.graphics.Bitmap | |
import android.graphics.BitmapFactory | |
import android.graphics.ImageDecoder | |
import android.graphics.Matrix | |
import android.net.Uri | |
import android.os.Build |