목록Android (75)
시배's Android

TiTi 프로젝트에서는 Timer와 StopWatch 기능을 구현하기 위해, 실제 시간이 흐르는 듯한 Animate Counter Timer를 구현해야 합니다. 이 과정은 앱의 핵심 부분 중 하나이며, 사용자에게 시간 경과를 시각적으로 제공하는 중요한 요소입니다. 블로그 글에서는 이 Animate Counter Timer의 구현 방법을 자세히 알아보겠습니다. 실제로 시, 분, 초가 흐르는 것처럼 보이는 놀라운 효과를 어떻게 만들 수 있는지, 코드와 함께 상세히 살펴보겠습니다. AnimatedCounter @Composable fun TdsAnimatedCounter( modifier: Modifier = Modifier, count: Int, ) { var oldCount by remember { mut..
Compose를 활용한 커스텀 테마 및 다크 모드 / 라이트 모드 대응 Jetpack Compose를 사용하면 Android 앱의 사용자 인터페이스를 구축할 때 커스텀 테마를 설정하고 다크 모드와 라이트 모드 간에 전환하는 기능을 쉽게 구현할 수 있습니다. 이 글에서는 커스텀 테마를 설정하고 다크 모드와 라이트 모드를 대응하는 방법을 알아보겠습니다. 커스텀 컬러 팔레트 정의 @Immutable data class CustomColorsPalette( val d1: Color = Color.Unspecified, val d2: Color = Color.Unspecified, // 다른 컬러들도 포함... val clearColor: Color = Color.Unspecified ) 먼저, 앱에서 사용할 커..

The “Real” Clean Architecture in Android: Modularization An overview of the principles behind modularization betterprogramming.pub “If the SOLID principles tell us how to arrange the bricks into walls and rooms, then the component principles tell us how to arrange the rooms into buildings.” ~ Robert C. Martin, Clean Architecture 레이어별로 패키징해야 하나요, 아니면 피쳐별로 패키징해야 하나요? 다른 접근 방식이 있나요? 프로젝트 컴파일 시간을 단축..
이번 글에서는 animateScrollToItem or scrollToItem을 통해 특정 아이템으로 스크롤을 할 때 NestedScrollConnection 불려지지 않아 커스텀 된 TopAppBar의 상태가 변경되지 않는 문제로 삽질을 하다가, 구글의 의도를 알 수 있었고 조금은 cracky 한 방법으로 해결을 하였는 것을 공유하고자 합니다. 문제의 발생 현재 저는 NetstedScrollConnection을 활용하여 scroll에 따라 특정 state를 변경시키며 이를 TopAppBar에 적용시켜 커스텀한 동작을하는 TopAppBar를 구현하여 사용 중에 있었습니다. 추후 요구사항이 추가되어 animateScrollToItem을 통해 최상단을 도달하게 하는 기능을 추가하고 나니 animateScro..

Animation modifiers and composables | Jetpack Compose | Android Developers Animation modifiers and composables Stay organized with collections Save and categorize content based on your preferences. Compose comes with built-in composables and modifiers for handling common animation use cases. Built-in animated composables Animate developer.android.com Built-in animated composables Animate appeara..

Modular Navigation with Jetpack Compose A large amount of mobile apps will need some form of Navigation, allowing users to move between different parts of an application. When… medium.com 대부분의 모바일 앱에는 사용자가 애플리케이션의 여러 부분 사이를 이동할 수 있도록 하는 일종의 내비게이션이 필요합니다. Android 앱 내에서 이러한 요구 사항을 구현할 때 애플리케이션은 자체 솔루션을 구현하거나 기존의 인텐트 또는 조각 관리자에 의존하거나 최근 몇 년 동안 탐색 컴포넌트 옵션을 탐색해 왔습니다. Jetpack Compose의 알파 버전과 개발자 프리뷰 버..
이번 글에서는 Compose에서 다중 클릭 이벤트를 처리하는 방법에 대해 소개하겠습니다. interface MultipleEventsCutterManager { fun processEvent(event: () -> Unit) } @OptIn(FlowPreview::class) @Composable fun multipleEventsCutter( content: @Composable (MultipleEventsCutterManager) -> T ) : T { val debounceState = remember { MutableSharedFlow Unit>( replay = 0, extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST ) ..

목록 및 그리드 | Jetpack Compose | Android Developers 목록 및 그리드 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. 많은 앱에서 항목의 컬렉션을 표시해야 합니다. 이 문서에서는 Jetpack Compose에서 이 작업을 효 developer.android.com Lazy lists 많은 수의 항목(또는 길이를 알 수 없는 목록)을 표시해야 하는 경우 열과 같은 레이아웃을 사용하면 모든 항목이 표시 여부와 관계없이 구성되고 배치되므로 성능 문제가 발생할 수 있습니다. Compose는 컴포넌트의 뷰포트에 표시되는 항목만 컴포넌트를 작성하고 레이아웃하는 컴포넌트 세트를 제공합니다. 이러한 컴포넌트에는 LazyColumn과 LazyRow가 포함됩니..