Skip to content

Instantly share code, notes, and snippets.

View jisungbin's full-sized avatar
🌴
언어의 정원사

Ji Sungbin jisungbin

🌴
언어의 정원사
  • 여의도 (South Korea)
  • South Korea, Seoul
  • 00:00 (UTC +09:00)
View GitHub Profile
@jisungbin
jisungbin / Modifier.drawHorizontalFadingEdges.kt
Last active October 18, 2023 18:16
Jetpack Compose horizontal fading edges with ScrollableState.
@Stable
fun Modifier.drawHorizontalFadingEdges(
target: Color = Color.White,
width: Dp = 10.dp,
scrollState: ScrollableState,
) =
if (!scrollState.canScrollForward && !scrollState.canScrollBackward) this
else drawWithCache {
val gradientWidth = width.toPx()
@fvilarino
fvilarino / draggable_content_final.kt
Created June 22, 2023 18:56
Draggable Contente - Final
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
PlaygroundTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background,
) {
Box {
@oianmol
oianmol / platform.android.kt
Created May 19, 2023 10:01
Jetpack Compose Side Effect to update Android or iOS status-bar and navigation-bar color
@Composable
actual fun PlatformColors(statusBarColor: Color, navBarColor: Color){
val sysUiController = rememberSystemUiController()
SideEffect {
sysUiController.setSystemBarsColor(color = topColor)
sysUiController.setNavigationBarColor(color = bottomColor)
}
}
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

안녕하세요! 성빈랜드 스터디 공지 드립니다. 성빈랜드 메인 프로젝트 개발을 시작하기 전에 한 달간 코루틴과 안드로이드 프레임워크 내부 딥다이브 스터디를 진행하려고 합니다. 평소 혼자 공부하는 편이지만 워낙 어렵고 좋은 주제인 만큼 함께 공부해 보면 좋을 거 같아 스터디원을 모집하게 됐습니다.

최신 내용은 성빈랜드 공지를 통해 확인해 주세요!

목적

이 스터디의 첫 번째 목적은 엔지니어적 관점에서 역량을 키우기 위함입니다. 또한 내부를 알고 설계하는 것과 내부를 모르고 설계하는 것에서 분명한 차이가 있음을 제가 컴포즈 내부 공부를 통해 느꼈으므로 더 좋은 안드로이드 개발을 위한 목적도 있습니다.

제가 컴포즈 내부를 공부하면서 느낀 점이 혼자서 이 많은 내용을 이해하기가 너무 어렵다는 거였습니다. 초반엔 어느 흐름을 봐야 할 지도 모르겠어서 방황하는 시간이 너무 많았습니다. 이를 극복하기 위해 제가 시도했던 일들은 제가 참고한 컴포즈 내부 레퍼런스의 작성자분과 외국 안드로이드 GDE 이신 분들, StackOverflow, kotlinlang 슬랙, 그리고 구글 컴포즈 팀에 계신 분들에게 여러 번 질문을 통해 6개월간 씨름 끝에 드디어 방향을 잡고 이해할 수 있었고, 성빈랜드에 컴포즈 내부 글을 작성할 수 있었습니다.

package foo.bar
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.*
private val testingScope = CoroutineScope(CoroutineName("TestingScope"))
@alexvanyo
alexvanyo / ScreenshotTests.kt
Last active April 11, 2024 08:34
Automatic @Preview screenshot tests with Showkase and Paparazzi
// Copyright 2022 Google LLC.
// SPDX-License-Identifier: Apache-2.0
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.platform.LocalInspectionMode
import app.cash.paparazzi.DeviceConfig
import app.cash.paparazzi.Paparazzi
import com.airbnb.android.showkase.models.Showkase
@jisungbin
jisungbin / README.MD
Created January 5, 2022 15:28 — forked from gabrielemariotti/README.MD
How to use the ShapeableImageView.

The Material Components Library introduced with the 1.2.0-alpha03 the new ShapeableImageView.

In your layout you can use:

 <com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:srcCompat="@drawable/..." />

Then in your code apply the ShapeAppearanceModel to define your custom corners:

@bloooi
bloooi / SegmentedControl.kt
Created December 4, 2021 12:28
iOS-style segmented control in Compose with Color Custom
package com.example.util.composable
import android.annotation.SuppressLint
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.awaitFirstDown
import androidx.compose.foundation.gestures.forEachGesture
import androidx.compose.foundation.gestures.horizontalDrag
@dovahkiin98
dovahkiin98 / FadingEdge.kt
Last active March 12, 2024 15:00
A Jetpack Compose implementation of the `fadingEdge` effect.
import androidx.compose.foundation.ScrollState
import androidx.compose.material.MaterialTheme
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.debugInspectorInfo