Skip to content

Instantly share code, notes, and snippets.

View dkaera's full-sized avatar

Dmytro Puzak dkaera

  • Ukraine, Kharkiv
View GitHub Profile
fun Modifier.ticketBorder(
cornerTopStart: Dp? = null,
cornerTopEnd: Dp? = null,
cornerBottomEnd: Dp? = null,
cornerBottomStart: Dp? = null,
strokeWidth: Dp = 1.dp,
color: Color,
) = composed(
factory = {
with(LocalDensity.current) {
@dkaera
dkaera / TicketShape.kt
Last active April 29, 2023 12:23
Jetpack compose TicketShape with specified corners.
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.Offset
@dkaera
dkaera / AppBackdropScaffoldState
Last active April 29, 2023 12:14
Extends the list of configuration options by the frontLayerOffset.
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package com.dkaera.test
import android.content.Context
import android.database.ContentObserver
import android.media.AudioManager
import android.os.Handler
import android.os.HandlerThread
import io.reactivex.Observable
import io.reactivex.ObservableEmitter
import io.reactivex.ObservableOnSubscribe