Skip to content

Instantly share code, notes, and snippets.

Avatar

Angelo Marchesin arcadefire

View GitHub Profile
@arcadefire
arcadefire / RecyclerViewExtension.kt
Last active Jun 11, 2022
Add addOnItemClickListener easily to a RecyclerView using Kotlin
View RecyclerViewExtension.kt
import android.support.v7.widget.RecyclerView
import android.view.View
interface OnItemClickListener {
fun onItemClicked(position: Int, view: View)
}
fun RecyclerView.addOnItemClickListener(onClickListener: OnItemClickListener) {
this.addOnChildAttachStateChangeListener(object: RecyclerView.OnChildAttachStateChangeListener {
override fun onChildViewDetachedFromWindow(view: View?) {
@arcadefire
arcadefire / build-times-json-format.json
Created May 16, 2019
Build times plugin JSON format
View build-times-json-format.json
{
"success": true,
"count": 663,
"measurements": [
{
"timestamp": 1558000984082,
"order": 0,
"task": ":clean",
"success": true,
"did_work": true,
@arcadefire
arcadefire / FullScreenNotification.kt
Last active Aug 3, 2021
FullScreenNotification redone with Compose
View FullScreenNotification.kt
package com.glovoapp.components
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
View bottomsheet.kt
enum class States {
EXPANDED,
COLLAPSED
}
@ExperimentalMaterialApi
@Composable
fun FullHeightBottomSheet(
header: @Composable () -> Unit,
body: @Composable () -> Unit