<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pluu Dev</title>
    <description>Android Developer Site</description>
    <link>http://pluu.github.io/</link>
    <atom:link href="http://pluu.github.io/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Thu, 12 Nov 2026 15:42:20 +0000</pubDate>
    <lastBuildDate>Thu, 12 Nov 2026 15:42:20 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Blog: [요약] Building reliable text editing experiences in Compose (Android Dev Summit &apos;26)</title>
        <description>&lt;div class=&quot;youtube&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/1DvjkRYGs2g&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;!--more--&gt;

&lt;blockquote&gt;
  &lt;p&gt;본 글은 Gemini를 사용하여 초안을 작성한 후 검수하였습니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;1-compose-텍스트-입력-api&quot;&gt;1. Compose 텍스트 입력 API&lt;/h1&gt;

&lt;p&gt;이번 세션에서 안정적인 텍스트 편집 환경을 구축하는 방법과 아키텍처 변화를 소개합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/01.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Compose는 세 가지 주요 텍스트 입력 컴포넌트를 제공합니다&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextField&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OutlinedTextField&lt;/code&gt; : Material 디자인 가이드라인을 구현한 표준 컴포넌트&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BasicTextField &lt;/code&gt;: 스타일이 없는 기본 컴포넌트. 커스텀 디자인 시스템 구축 시 사용하며 Compose 텍스트 필드 내부 구현 담당&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SecureTextField&lt;/code&gt; : 비밀번호 입력 특화 컴포넌트&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;textfieldstate-권장-및-기존-콜백-api의-deprecated&quot;&gt;TextFieldState 권장 및 기존 콜백 API의 Deprecated&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/02.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState&quot;&gt;TextFieldState&lt;/a&gt; 사용 권장
    &lt;ul&gt;
      &lt;li&gt;BasicTextField(state = rememberTextFieldState())는 Compose 1.7에서 Stable 전환&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;기존 콜백 API는 Deprecated
    &lt;ul&gt;
      &lt;li&gt;Compose 1.13부터 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BasicTextField&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextField&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OutlinedTextField&lt;/code&gt;에서 (value, onValueChange) 오버로드를 Deprecated로 전환&lt;/li&gt;
      &lt;li&gt;보안 및 접근성 결함을 제외한 신규 기능 추가와 일반 버그 수정 중단&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;2-비동기-상태와-ime-동기화-문제-해결&quot;&gt;2. 비동기 상태와 IME 동기화 문제 해결&lt;/h1&gt;

&lt;p&gt;기존 (value, onValueChange) 콜백은 동기식 입력에서는 정상 작동했지만, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;StateFlow&lt;/code&gt;와 같은 비동기 데이터 스트림과 결합하면 IME 동기화 결함이 발생합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/03.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;주요-문제&quot;&gt;주요 문제&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;사용자의 IME 입력 이벤트를 비동기 스트림으로 처리한 후 UI를 다시 그리는 구조&lt;/li&gt;
  &lt;li&gt;빠른 타이핑이나 글자 조합(Composition) 연산 중에 비동기 지연이 발생할 때 나타나는 문제
    &lt;ul&gt;
      &lt;li&gt;글자 누락&lt;/li&gt;
      &lt;li&gt;글자 중복&lt;/li&gt;
      &lt;li&gt;커서 위치 튐&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;textfieldstate의-해결-원리&quot;&gt;TextFieldState의 해결 원리&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;사용자가 입력할 때 비동기 왕복을 기다리지 않고 IME와 동기로 내부 상태 즉시 갱신&lt;/li&gt;
  &lt;li&gt;텍스트 값 외에 선택 영역, Undo/Redo 이력, 서식 스타일(Span/Paragraph Styles)을 단일 편집 세션 객체로 통합 관리&lt;/li&gt;
  &lt;li&gt;스냅샷 시스템 최적화
    &lt;ul&gt;
      &lt;li&gt;Layout 또는 Draw 단계에서만 텍스트 상태를 읽도록 최적화&lt;/li&gt;
      &lt;li&gt;타이핑 시 발생하는 불필요한 Recomposition 제거를 통한 렌더링 성능 개선&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;3-textfieldbuffer-활용&quot;&gt;3. TextFieldBuffer 활용&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState#text()&quot;&gt;TextFieldState.text&lt;/a&gt;는 읽기 전용 불변 스냅샷입니다. 코드로 텍스트를 직접 수정하려면 &lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState#edit(kotlin.Function1)&quot;&gt;edit&lt;/a&gt; 함수를 사용해야 합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/04.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;stateedit---와-textfieldbuffer&quot;&gt;state.edit { … }와 TextFieldBuffer&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState#edit(kotlin.Function1)&quot;&gt;state.edit { }&lt;/a&gt; 람다 내부에서 가변 객체인 &lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldBuffer&quot;&gt;TextFieldBuffer&lt;/a&gt;를 제공받아 글자 삽입, 치환, 삭제, 커서 이동 API를 호출합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;rememberTextFieldState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Hello&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;edit&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// 텍스트를 변경하고 커서를 끝으로 이동&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;placeCursorAtEnd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/05.png&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;성능 최적화: edit 호출을 하나로 묶기&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;여러 편집 작업을 처리할 때 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;edit&lt;/code&gt;을 반복 호출하지 말고 하나의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;edit { }&lt;/code&gt; 블록 안에 묶어야 합니다. Compose는 단일 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextFieldBuffer&lt;/code&gt; 인스턴스에서 인플레이스(In-place)로 메모리를 변경한 뒤, IME 및 스냅샷 시스템과 1회만 동기화합니다.&lt;br /&gt;
clearText(), setTextAndPlaceCursorAtEnd() 등 자주 쓰는 동작은 이미 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextFieldState&lt;/code&gt; 확장 함수로 제공됩니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/06.png&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;4-입력-제한과-시각적-가공-inputtransformation-vs-outputtransformation&quot;&gt;4. 입력 제한과 시각적 가공: InputTransformation vs OutputTransformation&lt;/h1&gt;

&lt;h3 id=&quot;inputtransformation-키보드-충돌-없는-입력-검증&quot;&gt;InputTransformation: 키보드 충돌 없는 입력 검증&lt;/h3&gt;
&lt;p&gt;과거 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;onValueChange&lt;/code&gt; 방식의 입력 검증은 텍스트가 키보드에 이미 커밋된 후에 실행되었습니다. 잘못된 입력을 되돌릴 때 IME 내부 상태와 충돌하여 글자가 깜빡이거나 엉키는 현상이 있었습니다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;사용자 입력이 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextFieldState&lt;/code&gt;에 반영되기 전 가로채기 수행&lt;/li&gt;
  &lt;li&gt;ChangeList를 사용해 실제 변경된 인덱스 범위만 전달하여 전체 문자열 비교 비용 제거&lt;/li&gt;
  &lt;li&gt;허용하지 않는 입력은 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;revertAllChanges()&lt;/code&gt;로 취소&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 숫자만 허용하는 InputTransformation&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;inputTransformation&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;InputTransformation&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;asCharSequence&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;all&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;isDigit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// Reject non-digit characters&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;revertAllChanges&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;outputtransformation-원본-데이터를-보존하는-화면-표시-가공&quot;&gt;OutputTransformation: 원본 데이터를 보존하는 화면 표시 가공&lt;/h3&gt;
&lt;p&gt;신용카드 번호 4자리 구분 공백이나 비밀번호 마스킹처럼 원본 데이터는 유지하고 화면 표시 형식만 변경해야 할 때 사용합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Raw data untouched; formatting is purely visual&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;outputTransformation&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;OutputTransformation&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;-&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;-&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;화면에 그리는 버퍼만 변경하고 원본 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextFieldState&lt;/code&gt; 데이터는 유지&lt;/li&gt;
  &lt;li&gt;스냅샷 시스템을 감지하여 변환 조건에 사용된 State 값이 변경될 때 화면 자동 재계산&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;5-상태-호이스팅state-hoisting-설계-패턴&quot;&gt;5. 상태 호이스팅(State Hoisting) 설계 패턴&lt;/h1&gt;

&lt;p&gt;아키텍처 구조에 맞춰 텍스트 필드 상태의 위치를 결정합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/07.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;1-composable-트리-내부-관리&quot;&gt;1) Composable 트리 내부 관리&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;단일 화면이나 인접한 Composable 간에 상태를 공유할 때 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rememberTextFieldState()&lt;/code&gt; 사용&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;2-viewmodel-직접-관리&quot;&gt;2) ViewModel 직접 관리&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;ViewModel에 Compose Runtime 종속성을 허용하는 프로젝트에 적합&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextFieldState&lt;/code&gt;를 ViewModel 프로퍼티로 직접 선언&lt;/li&gt;
  &lt;li&gt;프로세스 종료 후 복원을 위해 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SavedStateHandle.saveable(saver = TextFieldState.Saver)&lt;/code&gt; 사용&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FormViewModel&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ViewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;username&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TextFieldState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;uiState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;StateFlow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;FormUiState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FormViewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;savedStateHandle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SavedStateHandle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ViewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TextFieldState&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;savedStateHandle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;saveable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;username&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;saver&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TextFieldState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Saver&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;init&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TextFieldState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;3-conforming-패턴-순수-kotlin-viewmodel-유지&quot;&gt;3) Conforming 패턴: 순수 Kotlin ViewModel 유지&lt;/h3&gt;
&lt;p&gt;ViewModel 레이어에 Compose UI 런타임 종속성을 배제하고 순수 Kotlin 코루틴/Flow만 유지해야 한다면 Conforming 패턴을 적용합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/08.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Composable 내부에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rememberTextFieldState()&lt;/code&gt;로 텍스트 필드의 단일 진실 공급원(Single Source of Truth) 상태 유지&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LaunchedEffect&lt;/code&gt;와 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;snapshotFlow&lt;/code&gt;를 사용하여 텍스트 변화를 감지하고 ViewModel 메서드로 전달&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;LoginScreen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;viewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;LoginViewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;usernameState&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;rememberTextFieldState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;viewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;initialUsername&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;nc&quot;&gt;LaunchedEffect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;usernameState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;viewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;snapshotFlow&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;usernameState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;drop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// 최초 초기값 방출을 무시하여 ViewModel 상태 덮어쓰기 방지&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;collect&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;viewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;onUsernameChanged&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nc&quot;&gt;BasicTextField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;usernameState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;.drop(1) 호출 이유&lt;/strong&gt;:&lt;/p&gt;

  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;snapshotFlow&lt;/code&gt;는 수집을 시작할 때 현재 상태의 초기값을 즉시 방출합니다. ViewModel 초기값으로 텍스트 필드를 생성한 경우, 이 첫 번째 방출이 ViewModel로 역전달되어 중복 이벤트나 덮어쓰기 문제를 일으키므로 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.drop(1)&lt;/code&gt;로 초기 방출을 건너뜁니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href=&quot;https://goo.gle/migrate_to_state_textfield&quot;&gt;Migrate to state-based text fields&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;6-서식-있는-텍스트-편집-rich-text-editing&quot;&gt;6. 서식 있는 텍스트 편집 (Rich Text Editing)&lt;/h1&gt;

&lt;p&gt;Compose 1.12부터 서식 있는 텍스트 편집 API를 지원합니다.&lt;/p&gt;

&lt;h3 id=&quot;annotatedstring-대신-textfieldbuffer를-사용하는-이유&quot;&gt;AnnotatedString 대신 TextFieldBuffer를 사용하는 이유&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/09.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;정적 텍스트용 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AnnotatedString&lt;/code&gt;: 불변(Immutable) 객체. 글자를 입력할 때마다 문자열 전체와 스타일 리스트를 새로 복사·할당하므로 메모리 부하 발생&lt;/li&gt;
  &lt;li&gt;편집용 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextFieldBuffer&lt;/code&gt;: 가변 인플레이스(In-place) 엔진 탑재. 텍스트 입력 중에도 메모리 재할당 없이 스타일 추가, 수정, 삭제 가능&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;addstyle과-expandpolicy&quot;&gt;addStyle과 ExpandPolicy&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/10.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;특정 텍스트에 스타일을 지정한 후 경계 지점에서 타이핑을 이어갈 때 스타일을 유지할지 여부를 &lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy&quot;&gt;ExpandPolicy&lt;/a&gt;로 제어합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/11.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;InsideOnly: 스타일 범위 내부에서 입력할 때만 스타일 적용 (경계 지점 입력 시 확장 제외)&lt;/li&gt;
  &lt;li&gt;AtEnd: 스타일 범위 끝에서 입력 시 스타일 확장&lt;/li&gt;
  &lt;li&gt;AtStart: 스타일 범위 시작 지점에서 입력 시 스타일 확장&lt;/li&gt;
  &lt;li&gt;AtBoth: 시작과 끝 양쪽 모두 입력 시 스타일 확장&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;스타일-쿼리와-trackedrange&quot;&gt;스타일 쿼리와 TrackedRange&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/12.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;스타일 쿼리 (&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldBuffer#getSpanStyles(androidx.compose.ui.text.TextRange)&quot;&gt;getSpanStyles&lt;/a&gt;)
    &lt;ul&gt;
      &lt;li&gt;적용된 순서대로 반환(Order-aware)하여 나중에 적용한 스타일의 우선순위 보장&lt;/li&gt;
      &lt;li&gt;TextFieldBuffer에서는 TrackedRange 리스트 반환&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TrackedRange&quot;&gt;TrackedRange&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;버퍼 내 스타일 범위를 가리키는 포인터 핸들&lt;/li&gt;
      &lt;li&gt;기존 스타일 삭제 및 재생성 없이 범위(range), expandPolicy, 스타일 내용을 인플레이스로 직접 변경 가능&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Style rich text input : https://developer.android.com/develop/ui/compose/text/rich-text-input&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;7-실전-유즈케이스-구현&quot;&gt;7. 실전 유즈케이스 구현&lt;/h1&gt;

&lt;h3 id=&quot;1-wysiwyg-에디터의-볼드bold-토글&quot;&gt;1) WYSIWYG 에디터의 볼드(Bold) 토글&lt;/h3&gt;

&lt;p&gt;사용자가 선택한 영역의 볼드 스타일을 켜고 끄는 구현입니다&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/13.png&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TextFieldBuffer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;toggleBoldSelection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;selection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;collapsed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;boldSpans&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getSpandStyles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;selection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;isFullyBold&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;boldSpans&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;selection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// 볼드가 아니면 선택 영역에 볼드 스타일 적용&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;addStyle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;SpanStyle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fontWeight&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FontWeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Bold&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;selection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;ExpandPolicy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;AtEnd&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;unboldSelection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;boldSpans&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;2-패턴-기반-스타일링-마크다운-실시간-변환&quot;&gt;2) 패턴 기반 스타일링 (마크다운 실시간 변환)&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;**단어**&lt;/code&gt; 입력 시 마크다운 기호를 제거하고 볼드 서식을 적용합니다&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/14.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;InputTransformation&lt;/code&gt;을 활용하여 텍스트가 상태에 반영되기 전 아스테리스크(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;**&lt;/code&gt;)를 제거하고 내부 텍스트에 볼드 스타일 적용&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;3-검색어-하이라이트-search-highlighting&quot;&gt;3) 검색어 하이라이트 (Search Highlighting)&lt;/h3&gt;

&lt;p&gt;검색창에 입력한 단어와 일치하는 본문 텍스트를 노란색 배경으로 강조 표시합니다&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/15.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;원본 데이터 상태 변경 없이 시각적 하이라이트만 적용하기 위해 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OutputTransformation&lt;/code&gt; 사용&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MutableState&lt;/code&gt; 기반 검색 쿼리 변경 시 스냅샷 시스템이 감지하여 하이라이트 자동 재계산&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;8-차세대-라이브러리-markup-text-library&quot;&gt;8. 차세대 라이브러리: Markup Text Library&lt;/h1&gt;

&lt;p&gt;Compose 팀에서 개발 중인 신규 라이브러리 프리뷰입니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/building-reliable-text-editing-experiences-in-compose/16.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;마크다운 등 리치 텍스트 포맷 지원&lt;/li&gt;
  &lt;li&gt;증분 파싱(Incremental Parsing) 및 증분 렌더링(Incremental Rendering)
    &lt;ul&gt;
      &lt;li&gt;텍스트 전체를 다시 파싱하거나 그리지 않고 변경된 노드만 감지하여 갱신&lt;/li&gt;
      &lt;li&gt;대용량 문서 편집 및 LLM 마크다운 스트리밍 출력 시 깜빡임 없는 변경 부분 렌더링 지원&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Thu, 12 Nov 2026 11:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/androiddevsummit/2026/11/12/ads26-building-reliable-text-editing-experiences-in-compose/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/androiddevsummit/2026/11/12/ads26-building-reliable-text-editing-experiences-in-compose/</guid>
        
        <category>Android</category>
        
        <category>Compose</category>
        
        <category>UI</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
        <category>AndroidDevSummit</category>
        
      </item>
    
      <item>
        <title>Blog: [요약] Agentic engineering with Claude Code and Android CLI (Android Dev Summit &apos;26)</title>
        <description>&lt;div class=&quot;youtube&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/Mb9H43ia0kE&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;!--more--&gt;

&lt;blockquote&gt;
  &lt;p&gt;본 글은 Gemini를 사용하여 초안을 작성한 후 검수하였습니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;1-에이전틱-엔지니어링-패러다임과-개발자의-새로운-역할&quot;&gt;1. 에이전틱 엔지니어링 패러다임과 개발자의 새로운 역할&lt;/h1&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/01.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;AI 생태계의 변화 속도가 너무 빨라 발표 내용 중 일부는 시청 시점에 이미 구식이 되었을 수도 있습니다. 발표 내용은 미래를 내다보는 전향적인 관점을 담되, 세션에서 선보이는 데모들은 현재 시점에서도 안정적으로 재현되도록 현실적인 기반 위에서 구성했습니다. 또한 Claude Code를 대표적인 예시로 사용하지만, 제시하는 원칙들은 특정 도구에 얽매이지 않고 모든 에이전트 하네스에 공통으로 적용되는 개발자의 사고방식(Mindset)입니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/02.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;개발자의 역할은 자율 에이전트(Autonomous Agents) 팀을 지휘하고 이들이 성공할 수 있는 환경을 조성하는 방향으로 전환되고 있습니다. 에이전트가 특정 기능 구현에 실패했을 때 “AI는 아직 이것을 못한다”라며 작업을 포기하는 대신, 일반 소프트웨어 버그를 다루듯 “에이전트에게 어떤 정보가 누락되었는가?”를 되돌아보고 원인을 분석해야 합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/03.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;안드로이드 개발자에게 지금보다 흥미진진한 시기는 없었을거지만, 한편으로는 어디에 집중해야 할지 갈피를 잡기 어려울 수 있습니다. 핵심은 새로운 프론티어 모델이 출시될 때마다 지금까지 들인 노력이 헛수고가 되지 않도록 방지하는 데 있습니다. 모델의 발전과 함께 지능적으로 확장되는 도구와 워크플로우를 갖추어야 모델의 개선이 에이전트 워크플로우의 고도화로 이어지고, 궁극적으로 최종 사용자에게 더 나은 결과를 제공하는 미래 대비 체계가 완성됩니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/04.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;본 세션에서 다루는 네 가지 핵심 아젠다&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;01 환경(Environment) : 에이전트가 스스로 성공할 수 있도록 지원하는 작업 환경 조성의 중요성 설명&lt;/li&gt;
  &lt;li&gt;02 컨텍스트(Context) : 모델의 추론 능력을 극대화하기 위한 컨텍스트 개요 및 최적의 관리 방법 제시&lt;/li&gt;
  &lt;li&gt;03 도구(Tools) : 에이전트 내부에서 안드로이드 개발자가 활용할 수 있는 최상의 도구 체계 소개&lt;/li&gt;
  &lt;li&gt;04 루프(Loops) : 에이전틱 워크플로우에 자체 검증 루프를 추가해야 하는 당위성과 실증 근거 제시&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;2-에이전트-성공을-위한-환경environment-구축&quot;&gt;2. 에이전트 성공을 위한 환경(Environment) 구축&lt;/h1&gt;

&lt;p&gt;환경 구축이란 개발자가 화면 앞에 계속 앉아 프롬프트를 다시 입력하고 궤도를 수정해 줄 필요 없이, 에이전트가 자율적으로 작업을 완수할 수 있는 공간을 만드는 것을 의미합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/05.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;개발자의 상시 개입이 필요 없는 환경이 갖추어질 때 비로소 병렬 에이전트(Parallel agents) 운용이 가능해집니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/06.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;여러 에이전트 팀이 개발자를 대신해 동시에 작업을 처리할 수 있을 때 비로소 진정한 생산성 혁신이 일어납니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/07.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;에이전트 환경에 필수적으로 개방해야 하는 정보 자산&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;코드 및 프로젝트 명세 : 프로젝트 아키텍처 규칙과 작업 명세서 제공 (가장 기본적인 요구사항)&lt;/li&gt;
  &lt;li&gt;팀 협업 맥락(Team Context) : 메신저 대화방 연동을 통한 의사결정 배경 전달, 과거 의사결정 이력(ADR) 및 PR 리뷰 코멘트 열람 지원&lt;/li&gt;
  &lt;li&gt;실행 및 디버깅 도구 : 실기기 및 에뮬레이터 접근 권한 (기기 없이 안드로이드 개발을 할 수 없듯 에이전트에게도 필수), 성능 프로파일러, 앱이 사용하는 백엔드 서비스 연동 통로&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/08.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;android-cli의-역할&quot;&gt;Android CLI의 역할&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;안드로이드의 다양한 SDK 도구를 터미널에서 제어하기 위한 새로운 명령줄 인터페이스(CLI)&lt;/li&gt;
  &lt;li&gt;AI 제품 자체가 아닌 범용 CLI로 동작하여 SDK 매니저 제어, 에뮬레이터 구동, Crashlytics 백엔드 연결 지원&lt;/li&gt;
  &lt;li&gt;로컬 셸 환경에 상주하므로 개발자가 사용하는 모든 에이전트 하네스에서 호출 가능&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/09.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;공식 링크(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;goo.gle/android-cli&lt;/code&gt;)를 통해 설치할 수 있으며, 터미널에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android init&lt;/code&gt;을 실행하여 즉시 활성화할 수 있습니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;3-실전-사례-1--android-cli를-통한-크래시-및-anr-해결&quot;&gt;3. 실전 사례 1 : Android CLI를 통한 크래시 및 ANR 해결&lt;/h1&gt;

&lt;p&gt;환경 구축의 중요성을 증명하기 위해 자체 제작한 상용 프로덕션 앱 ‘Sideline’을 실증 예시로 소개합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/10.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Android CLI를 활용하여 실제 프로덕션 환경의 크래시를 해결하는 과정할 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/11.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Sideline은 테니스 선수를 위한 안드로이드 앱으로, 공과 선수의 위치를 실시간 분석하고 비디오 리플레이 기반 오프라인 코칭 피드백과 타구 속도, 이동 거리, 랠리 횟수 등의 운동 데이터를 제공합니다. 모든 분석은 기기 내에서 직접 실행되는 커스텀 TFLite 모델을 통해 온디바이스로 구동됩니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/12.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;crashlytics-연동과-anr-발견&quot;&gt;Crashlytics 연동과 ANR 발견&lt;/h3&gt;
&lt;blockquote&gt;
  &lt;p&gt;존재하는지조차 모르는 문제는 해결할 수 없습니다&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Android CLI를 사용하여 개발 환경에 Firebase Crashlytics 연동을 통해, 로컬 에뮬레이터에서는 전혀 재현되지 않던 Pixel 11 Pro Fold 단말 전용의 ANR(Application Not Responding) 문제들을 발견할 수 있었습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/13.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;결함 해결 및 검증 프로세스&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Android Device Streaming 연동 : 개발자가 해당 폴더블 기기를 보유하지 않은 상태에서, 에이전트가 클라우드의 원격 Pixel 11 Pro Fold 기기에 연결하여 49초 시점에 발생하는 ANR 재현&lt;/li&gt;
  &lt;li&gt;원인 분석 : Android 17 환경에서 CPU 친화도(Affinity) 호출 거부가 원인임을 확인&lt;/li&gt;
  &lt;li&gt;2줄 코드 수정 : OpenMP 및 스레드 친화도 환경 변수를 안전하게 재설정하여 해결&lt;/li&gt;
  &lt;li&gt;원격 검증 : 동일한 원격 단말에서 270초 무중단 실행 확인 후 PR 생성, 병합, Play Console 배포까지 자동 완결&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/14.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Crashlytics 콘솔을 통해 해당 결함이 완전히 해결되었음을 확인했습니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;4-컨텍스트context-관리와-150k-토큰의-법칙&quot;&gt;4. 컨텍스트(Context) 관리와 150k 토큰의 법칙&lt;/h1&gt;

&lt;p&gt;약 1년 반에서 2년 전 AI 업계에서는 더 큰 컨텍스트 윈도우를 확보하기 위한 경쟁이 치열했습니다. 모델에 최대한 많은 정보를 넣으면 더 좋은 결과가 나올 것이라는 기대로 &lt;a href=&quot;developer.android.com&quot;&gt;공식 개발자 문서&lt;/a&gt; 전체를 프롬프트에 넣는 시도를 했으나 효과가 없었습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/15.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;컨텍스트 윈도우 크기는 대략 100만(1M) 토큰 선에서 정체되었지만, 모델의 코딩 추론 능력은 계속해서 가파르게 상승하고 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/16.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Android Bench 1.0 벤치마크 결과, 100만 토큰 환경에서 모델의 코드 작성 성공률은 지속적으로 향상되었습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/17.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;컨텍스트-부패context-rot와-15만-토큰-한계선&quot;&gt;컨텍스트 부패(Context Rot)와 15만 토큰 한계선&lt;/h3&gt;
&lt;p&gt;컨텍스트는 여전히 엄격한 고정 예산입니다. 지금 문제와 직접 관련이 없는 정보를 넣으면 모델의 주의 집중력이 흐려집니다. 많은 에이전트 하네스들이 100만 토큰 전체를 사용자에게 노출하지 않는 이유도 무작정 토큰을 늘리면 결과가 나빠지기 때문입니다.&lt;/p&gt;

&lt;p&gt;모델에 따라 다르지만, 단일 대화 세션을 약 15만 토큰(150k) 이내로 유지할 때 컨텍스트 손실 없이 모델의 최고 성능을 온전히 활용할 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/18.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/19.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;컨텍스트의 내부 구성 요소&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;시스템 지침(System Instruction) : 에이전트의 동작 방식 및 기본 행동 수칙 규정&lt;/li&gt;
  &lt;li&gt;작업 공간 및 메타데이터 : 현재 작업 디렉토리, 설치된 SDK 정보&lt;/li&gt;
  &lt;li&gt;설치된 스킬 및 MCP 도구 스키마 : 모델이 호출 가능한 도구 목록 (상시 컨텍스트 소모)&lt;/li&gt;
  &lt;li&gt;전체 대화 및 도구 호출 이력 : 프롬프트 전송 시마다 누적되는 메시지 기록 (가장 큰 비중 차지)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/20.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;장황한-gradle-로그의-위험성&quot;&gt;장황한 Gradle 로그의 위험성&lt;/h3&gt;

&lt;p&gt;Gradle 빌드 로그는 매우 길고 상세하지만 대부분은 문제 해결에 불필요한 노이즈입니다. 따라서 Gradle 실행 시 quiet 모드(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./gradlew assembleDebug --quiet&lt;/code&gt;)를 활용하는 것을 추천합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/21.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;150k-세션-워크플로우&quot;&gt;150k 세션 워크플로우&lt;/h3&gt;

&lt;p&gt;15만 토큰이라는 마법의 창을 넘기지 않기 위해 Matt Pocock이 고안한 워크플로우 Skill&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;역질문 정렬(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/grill-me&lt;/code&gt;) : 프로젝트나 기능을 시작할 때 실행. 에이전트가 개발자에게 세부 구현 방식과 위치 등을 역으로 질문하여 머릿속의 모호성을 제거하고 이슈로 구체화&lt;/li&gt;
  &lt;li&gt;명세서 작성(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/write-a-prd&lt;/code&gt;) : 대형 스펙 문서를 작성하여 요구사항 영속화&lt;/li&gt;
  &lt;li&gt;이슈 슬라이싱 : 각 이슈가 약 15만 토큰 내에서 완료될 수 있는 크기로 이슈 분할 및 등록&lt;/li&gt;
  &lt;li&gt;이슈당 1세션 실행 후 초기화 : 터미널이나 IDE에서 1개 이슈 처리 → 빌드 및 검증 통과 → 세션 종료 및 컨텍스트 초기화(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/clear&lt;/code&gt;) 반복&lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;5-agentsmd-운영-규칙과-실제-저장소-구조&quot;&gt;5. AGENTS.md 운영 규칙과 실제 저장소 구조&lt;/h1&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt;는 프로젝트나 작업 공간 전체에서 에이전트가 수행하는 모든 프롬프트에 상시 포함되는 설정 파일입니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/22.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;agentsmd-운영-가이드라인&quot;&gt;AGENTS.md 운영 가이드라인&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;상시 적용되는 규칙만 수록 : 아키텍처 및 모듈 규칙(특히 비공개 소스 프로젝트의 경우 모델이 사전 학습할 수 없으므로 기능의 소속 위치를 지정하여 추론 비용 절감)&lt;/li&gt;
  &lt;li&gt;빈번한 코드 리뷰 실수 방지 : 팀에서 반복 지적되는 규칙 명시 (예: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kotlinx.datetime&lt;/code&gt; 선호)&lt;/li&gt;
  &lt;li&gt;모델 세대별 프롬프트 대응 : Opus 4.6 시절에는 대문자로 “NEVER DO THIS”를 썼으나, Opus 5에서는 소문자 평문이 더 효과적이라는 Anthropic의 발표처럼 모델 특성에 맞춰 지속 관리 필요&lt;/li&gt;
  &lt;li&gt;문서 길이 250줄 이내 제한 : 과도한 사전 주입으로 인한 토큰 낭비 방지&lt;/li&gt;
  &lt;li&gt;에이전트의 파일 자동 수정 금지(arxiv:2602.11988) : 에이전트에게 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt;를 스스로 수정하게 하면 작업 성능이 2~3% 하락하고 비용이 20% 증가한다는 2026년 2월 연구 결과 제시. 대신 PR 완료 후 회고(Retrospective) 문서만 작성하게 하고 팀이 검토 후 수동 반영 권장&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/23.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;실제-sideline-저장소의-agentsmd-구조&quot;&gt;실제 Sideline 저장소의 AGENTS.md 구조&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;명확한 아키텍처 정의 : 모듈 구조와 의존성 흐름을 명문화하면 에이전트가 코드베이스 전체를 불필요하게 뒤지는 동작을 방지하여 토큰과 컨텍스트 절약&lt;/li&gt;
  &lt;li&gt;비공개 소스(Closed-source) 앱 관리 : 외부 모델이 해당 코드를 학습한 적이 없으므로, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt;를 지속적으로 정제하고 개선하는 작업이 장기적인 생산성 향상의 핵심&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;6-도구-및-skilltools--levers-생태계&quot;&gt;6. 도구 및 Skill(Tools &amp;amp; Levers) 생태계&lt;/h1&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt;에 모든 지침을 넣을 수 없다면, 훅(Hooks)과 Skill을 통해 에이전트의 행동을 제어해야 합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/25.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;훅hooks&quot;&gt;훅(Hooks)&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt;에 “코드를 작성한 후 항상 Lint를 돌려라”라고 적는 대신, 세션 종료(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Stop&lt;/code&gt;) 훅에 셸 스크립트를 등록하면 AI의 확률적 무작위성을 제어하고 결정론적 검증을 강제할 수 있습니다.&lt;/p&gt;

&lt;p&gt;에이전트가 지원하는 주요 라이프사이클 이벤트&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;세션 시작(Start) 및 세션 종료(Stop) 이벤트&lt;/li&gt;
  &lt;li&gt;파일 읽기(Read) 및 파일 쓰기(Write) 차단 : 비밀키 파일이 서버로 전송되는 것을 원천 차단하거나 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt;의 무단 수정을 방지하는 용도로 활용&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/26.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;skills&quot;&gt;Skills&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt;가 모든 요청에 상시 적용된다면, Skill은 특정 상황에서만 필요한 대용량 문서나 도구를 제공합니다.&lt;/p&gt;

&lt;p&gt;Skills의 3요소&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Name  Skill 식별자&lt;/li&gt;
  &lt;li&gt;Description : 최대 1,024자 제한. 스킬이 필요한 시점을 모델이 판단할 수 있도록 컨텍스트에 상시 로드&lt;/li&gt;
  &lt;li&gt;Body : 대용량 문서, API 레퍼런스, 실행 스크립트 포함. 스킬이 실제로 호출될 때만 임시 로드&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/27.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Android CLI 스킬의 설명문(Description)에서는 해당 도구가 언제 필요한지 간결하게 기술되어 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/28.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Skills의 본문은 화면을 가득 채울 정도로 방대합니다. 이처럼 거대한 본문을 평소에는 제외하고, 필요한 순간에만 선택적으로 로드할 수 있게 해줍니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/29.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;무차별적인-스킬-설치의-위험성&quot;&gt;무차별적인 스킬 설치의 위험성&lt;/h3&gt;
&lt;p&gt;인터넷에서 공유되는 100여 개의 에이전틱 스킬 모음집을 무분별하게 설치하면 안 됩니다&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;보안 위험 : 스킬 내부에 악의적인 명령어가 숨겨져 있을 위험 (구글 공식 안드로이드 스킬은 검증을 거침)&lt;/li&gt;
  &lt;li&gt;컨텍스트 잠식 : 스킬 100개의 설명문(100 × 1,000자)만으로 작업을 시작하기도 전에 10만 자의 컨텍스트를 소모&lt;/li&gt;
  &lt;li&gt;권장 방식 : 기본 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android-cli&lt;/code&gt; 스킬만 설치하고 필요 시 탐색하여 추가하거나, Compose나 edge-to-edge처럼 보편적인 스킬만 선별 설치&lt;/li&gt;
  &lt;li&gt;스킬 감사 : Claude Code의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;skill-doctor&lt;/code&gt; 또는 하네스의 통계 화면을 활용하여 한 번도 활성화되지 않은 잉여 스킬 제거&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/30.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android skills list&lt;/code&gt; : 사용 가능한 스킬 목록을 확인&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android skills add navigation-3&lt;/code&gt; : 필요한 스킬만 명시적으로 추가&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/31.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;android-cli를-cli-형태로-구현한-이유&quot;&gt;Android CLI를 CLI 형태로 구현한 이유&lt;/h3&gt;
&lt;p&gt;CLI는 속도가 빠르고 결합성(Composable)이 뛰어나며 로컬 셸에서 실행되어 비용이 들지 않습니다. 또한 최신 LLM 제조사들이 소프트웨어 엔지니어링 벤치마크 중 가장 중요한 Terminal Bench 점수를 올리기 위해 집중적으로 학습시켰기 때문에, 최신 모델들은 셸 명령어 호출에 대단히 능숙합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/32.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;로컬-cli-vs-mcpmodel-context-protocol-역할-분담&quot;&gt;로컬 CLI vs MCP(Model Context Protocol) 역할 분담&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;MCP : GitHub, Figma, Slack 등 이미 원격에 배포된 외부 호스팅 서비스와의 연결에 최적 (별도 설치 없이 추가 컨텍스트 확보)&lt;/li&gt;
  &lt;li&gt;CLI + Skills : Android CLI, Perfetto, Gradle 등 개발 머신의 모든 리소스에 접근해야 하는 작업은 로컬 셸에서 실행하는 것이 가장 효율적&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;7-실전-사례-2--perfetto-트레이스와-performance-hint-api를-통한-성능-튜닝&quot;&gt;7. 실전 사례 2 : Perfetto 트레이스와 Performance Hint API를 통한 성능 튜닝&lt;/h1&gt;

&lt;p&gt;과거에는 성능 분석 도구인 Perfetto의 학습 곡선이 너무 가팔라 활용이 쉽지 않았으나, AI를 결합하면 이 과정을 대폭 단순화할 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/34.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Sideline 앱이 정상 동작하려면 실시간 30 FPS를 유지해야 하지만, Pixel 10 Pro Fold 기기에서 카메라 라이브 프리뷰 구동 시 20~22 FPS로 떨어지며 프레임 드롭이 발생했습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/35.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Claude Code에 30 FPS 요구사항을 부여했을 때 나타난 두 가지 핵심 동작&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android profiler&lt;/code&gt;를 통한 트레이스 수집 : 연결된 Pixel 10 Pro Fold에서 시스템 트레이스를 기록하고, AI 비전 스레드가 단말의 가장 느린 저전력 코어(Slowest cores)에서 실행 중임을 발견&lt;/li&gt;
  &lt;li&gt;공식 문서 자율 검색 및 해결 : 명시적으로 지시하지 않았음에도 에이전트가 안드로이드 공식 문서를 검색하여 &lt;strong&gt;Performance Hint API&lt;/strong&gt; 가이드라인을 참조하고 시스템 스케줄러 우선순위를 조정하는 코드 작성&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/36.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;수정 후 동일 기기에서 라이브 카메라 프리뷰가 안정적인 30 FPS를 달성함을 검증했습니다. 개발자가 도구의 사용법을 완벽히 숙지하지 못했더라도 Android CLI를 통해 적절한 도구를 찾아 문제를 해결할 수 있음을 증명했습니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;8-검증-루프loops와-완료done의-기준-정의&quot;&gt;8. 검증 루프(Loops)와 완료(Done)의 기준 정의&lt;/h1&gt;

&lt;p&gt;에이전트에게 큰 작업을 요청했을 때 &lt;strong&gt;완료했다&lt;/strong&gt;는 보고만 믿고, 개발자가 직접 폰을 조작하며 버그를 찾아 타이핑하는 행위는 &lt;strong&gt;개발자를 단순 QA 테스터로 전락시키는 일&lt;/strong&gt;이며 반드시 멈추어야 합니다.&lt;/p&gt;

&lt;p&gt;작업을 시작하기 전 무엇이 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;완료(Done)&lt;/code&gt;인지 사전에 명확히 정의해야 합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/38.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;수동 QA를 대신하는 악순환을 끊고 사전 완료 기준을 제시해야 합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/39.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;예를 들어 프로젝트 전체를 최신 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;androidx.navigation3&lt;/code&gt;로 마이그레이션하라는 작업을 부여할 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/40.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;수동-검증의-함정과-검증-루프의-필요성&quot;&gt;수동 검증의 함정과 검증 루프의 필요성&lt;/h3&gt;
&lt;p&gt;에이전트는 자신만만하게 “마이그레이션이 완료되었습니다”라고 보고하지만, 스마트폰을 회전하면 앱이 비정상 종료되고 화면 전환 애니메이션이 누락되며 기존 Gradle 의존성도 정리되지 않은 상태였습니다. 사전에 완료 기준을 제시하고 그 기준을 통과할 때까지 에이전트가 자체적으로 반복 실행하도록 만드는 체계가 바로 &lt;strong&gt;검증 루프(Verification loop)&lt;/strong&gt;입니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/41.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;android-bench-20-공식-데이터&quot;&gt;Android Bench 2.0 공식 데이터&lt;/h3&gt;
&lt;p&gt;새롭게 공개된 Android Bench 2.0의 현재 평균 통과율은 약 40% 수준이며, Navigation 2에서 3으로의 마이그레이션과 같은 실제적인 고난도 과제들이 포함되어 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/42.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Claude Fable 5.1 모델을 대상으로 동일한 Navigation 마이그레이션 과제를 수행한 결과&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;자연어 프롬프트만 제공 : 성공률 22%&lt;/li&gt;
  &lt;li&gt;사전에 실패하는 테스트 스위트(Failing Test Suite)만 제공 : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;성공률 90%&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;최신 모델들은 대부분의 안드로이드 구현 능력을 갖추고 있으나 “무엇이 완료인지”를 모를 뿐입니다. 실패하는 테스트 스위트를 제공하면 통과할 때까지 코드를 수정하며 성공률을 극대화합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/43.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;실무-적용-방안과-verify-스킬&quot;&gt;실무 적용 방안과 verify 스킬&lt;/h3&gt;
&lt;p&gt;사전에 전체 테스트 스위트를 작성하지 않더라도 검증 루프를 간단히 구축할 수 있습니다&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;UI 작업 : Compose 프리뷰를 렌더링하여 Figma 스펙과 일치하는지 시각적 결과를 직접 제시하도록 요구 (“완료했습니다”라는 텍스트 응답 대신 실제 결과물을 증명하게 하는 방식이 훨씬 효과적)&lt;/li&gt;
  &lt;li&gt;비즈니스 로직 : 단위 테스트 실행 및 통과 요구&lt;/li&gt;
  &lt;li&gt;크래시 결함 : 원격 테스트 랩을 통해 실제 단말에서 결함 해결 검증&lt;/li&gt;
  &lt;li&gt;Claude Code 내장 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verify&lt;/code&gt; 스킬을 활용하여 이러한 검증 루프를 즉시 구성 가능&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/44.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;android-studio-mcp-검증-도구&quot;&gt;Android Studio MCP 검증 도구&lt;/h3&gt;
&lt;p&gt;Android Studio는 에이전트가 검증 루프를 구축할 수 있도록 다양한 도구가 있습니다&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Lint : 모든 린트 오류가 0개가 될 때까지 세션을 멈추지 않도록 강제&lt;/li&gt;
  &lt;li&gt;Journeys : 프롬프트 형태로 작성된 기능 시나리오가 모두 통과할 때까지 완료 선언 방지&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/45.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;다층-검증-루프tiered-verification-전략&quot;&gt;다층 검증 루프(Tiered Verification) 전략&lt;/h3&gt;
&lt;p&gt;Journeys나 원격 테스트는 실행에 시간이 걸리므로 검증 단계를 계층화해야 합니다&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;1단계 : 단위 테스트 및 Compose 프리뷰 렌더링 (초 단위 빠른 피드백)&lt;/li&gt;
  &lt;li&gt;2단계 : 에뮬레이터 연결 테스트 및 Android Journeys 검증&lt;/li&gt;
  &lt;li&gt;3단계 : 수 시간이 소요되는 원격 디바이스 테스트 랩 전체 스위트 실행&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;모델은 지나치게 낙관적이어서 한 번에 모든 테스트를 통과할 것이라 착각하므로, 빠른 1단계를 통과한 후에만 다음 단계로 넘어가도록 루프를 계층화해야 합니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;9-실전-사례-3--xr-안경-확장-및-자가-치유self-healing-루프&quot;&gt;9. 실전 사례 3 : XR 안경 확장 및 자가 치유(Self-healing) 루프&lt;/h1&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/47.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;실제 Sideline 앱을 XR Glasses 폼팩터로 확장하는 작업에 다층 검증 루프를 적용했습니다.&lt;/p&gt;

&lt;p&gt;실제 하드웨어가 없으므로 XR 에뮬레이터를 사용하고, 에이전트에게 3단계 루프를 강제했습니다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;1단계 JVM 단위 테스트 : 초 단위로 반복 실행하여 6개 Compose 프리뷰 상태 정의&lt;/li&gt;
  &lt;li&gt;2단계 Compose 프리뷰 : UI 오버플로 문제를 에뮬레이터를 띄우기도 전에 조기 발견 및 수정&lt;/li&gt;
  &lt;li&gt;3단계 XR 에뮬레이터 : 단위 테스트와 프리뷰에서 잡지 못한 XR 디스플레이 전용 렌더링 버그 4건을 최종 발견 및 해결&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/48.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;그 결과 선수가 경기 중 공에서 시선을 떼지 않고도 스윙 종류와 타구 속도를 실시간 피드백 받을 수 있는 “SERVE 73 MPH” 형태의 헤드업 디스플레이를 구현했습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/49.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;스케줄러-기반-자가-치유self-healing-파이프라인&quot;&gt;스케줄러 기반 자가 치유(Self-healing) 파이프라인&lt;/h3&gt;
&lt;p&gt;Claude Code의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/schedule&lt;/code&gt; 명령어를 활용하여 주기적인 자가 치유 파이프라인을 구축할 수 있습니다&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Firebase Crashlytics에서 신규 결함 자동 수집&lt;/li&gt;
  &lt;li&gt;원격 실기기에서 버그 재현 및 수정 코드 작성&lt;/li&gt;
  &lt;li&gt;테스트 스위트 검증 완료 후 엔지니어가 검토 및 병합할 수 있는 Pull Request 자동 등록&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;10-결론-및-권고사항&quot;&gt;10. 결론 및 권고사항&lt;/h1&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/50.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;에이전틱 엔지니어링의 핵심은 에이전트가 성공할 수 있는 환경을 만들고, 일반 소프트웨어 개발 및 버그를 다루듯 체계적으로 접근하여 병렬 에이전트를 운용하는 데 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/51.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;온라인에는 상충되는 수많은 조언들이 넘쳐납니다. 이를 극복하는 최선의 방법은 &lt;strong&gt;프로젝트 자체의 평가 벤치마크(Evals)&lt;/strong&gt;를 직접 작성하는 것입니다. 새로운 조언이나 새 모델이 나왔을 때 실제 생산성에 도움이 되는지 자체 벤치마크로 측정해야 하며, Claude Code의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/claude-api build-eval&lt;/code&gt; 스킬을 활용할 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/agentic-engineering-with-claude-code-and-android-cli/52.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Android Dev Summit의 관련 세션으로 구글의 공식 벤치마크 구축 경험을 다룬 &lt;strong&gt;Android Bench 세션&lt;/strong&gt;과, 실무 현장의 안드로이드 개발자들이 참여하는 &lt;strong&gt;미국 및 런던 패널 토론 세션&lt;/strong&gt; 시청을 추천합니다.&lt;/p&gt;
</description>
        <pubDate>Thu, 05 Nov 2026 14:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/androiddevsummit/2026/11/05/ads26-agentic-engineering-with-claude-code-and-android-cli/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/androiddevsummit/2026/11/05/ads26-agentic-engineering-with-claude-code-and-android-cli/</guid>
        
        <category>Android</category>
        
        <category>AI</category>
        
        <category>Agent</category>
        
        <category>AndroidCLI</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
        <category>AndroidDevSummit</category>
        
      </item>
    
      <item>
        <title>Blog: [메모] adb install vs android install 차이점 분석 및 비교</title>
        <description>&lt;p&gt;Android CLI의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;은 단순한 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb install&lt;/code&gt;의 래퍼(Wrapper)가 아닙니다. 소스 빌드 연동 기능과 함께, 변경된 바이트만 전송하는 &lt;strong&gt;증분 설치(Delta Install)&lt;/strong&gt;를 기본값으로 사용합니다.&lt;/p&gt;

&lt;p&gt;두 도구의 내부 동작 차이를 분석하고, 로컬 에뮬레이터와 네트워크 대역폭 제한 환경에서 설치 속도를 비교했습니다.&lt;/p&gt;

&lt;!--more--&gt;

&lt;blockquote&gt;
  &lt;p&gt;본 글은 Gemini를 사용하여 초안을 작성한 후 검수하였습니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;본 글에서 사용된 도구 버전 및 환경(2026년 10월 31일 기준)은 다음과 같습니다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Android CLI: 1.1.16717390&lt;/li&gt;
  &lt;li&gt;Android Debug Bridge (adb): 1.0.41 (platform-tools 37.0.1-15733141)&lt;/li&gt;
  &lt;li&gt;Android Gradle Plugin (AGP): 9.5.0&lt;/li&gt;
  &lt;li&gt;Kotlin: 2.4.21&lt;/li&gt;
  &lt;li&gt;Target Device: Android Virtual Device (Pixel 9a, API 37, arm64-v8a)&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;1-핵심-차이점-한눈에-보기&quot;&gt;1. 핵심 차이점 한눈에 보기&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;비교 항목&lt;/th&gt;
      &lt;th&gt;adb install&lt;/th&gt;
      &lt;th&gt;android install&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;도구 성격&lt;/td&gt;
      &lt;td&gt;Low-level 범용 기기 통신 도구 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;platform-tools&lt;/code&gt;)&lt;/td&gt;
      &lt;td&gt;High-level Android 개발자/에이전트 워크플로 CLI&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;입력 형태&lt;/td&gt;
      &lt;td&gt;로컬 APK 파일 경로만 지원&lt;/td&gt;
      &lt;td&gt;로컬 APK 경로뿐만 아니라 빌드 참조 ([system://][path]?[target]) 지원&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;빌드 연동&lt;/td&gt;
      &lt;td&gt;불가 (사전에 빌드 완료된 APK 필요)&lt;/td&gt;
      &lt;td&gt;소스 빌드와 배포를 한 번에 연동 가능 (– &lt;build_args&gt;)&lt;/build_args&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;증분 설치 (Delta)&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fastdeploy&lt;/code&gt; 옵션 필요 (별도 agent)&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--use-delta-install&lt;/code&gt; 기본 활성화 (default: true)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;전송 최적화&lt;/td&gt;
      &lt;td&gt;Streaming Install 지원 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--streaming&lt;/code&gt;)&lt;/td&gt;
      &lt;td&gt;변경된 delta 패치 파일만 기기로 전송 (Zero-copy 활용)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;다중 APK 지원&lt;/td&gt;
      &lt;td&gt;install-multiple, install-multi-package 분리&lt;/td&gt;
      &lt;td&gt;–apks=a.apk,b.apk 로 단순화&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;실행 연계&lt;/td&gt;
      &lt;td&gt;설치만 수행&lt;/td&gt;
      &lt;td&gt;설치만 수행 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android run&lt;/code&gt; 시 설치 후 launch까지 연동)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;1-소스-빌드-참조build-reference-지원&quot;&gt;(1) 소스 빌드 참조(Build Reference) 지원&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb install&lt;/code&gt;은 오직 디스크에 존재하는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.apk&lt;/code&gt; 파일만을 대상으로 동작합니다.
반면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;은 Android CLI 1.1부터 &lt;strong&gt;빌드 참조 문법&lt;/strong&gt;을 직접 인식합니다.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# 로컬 APK 파일 설치&lt;/span&gt;
android &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--apks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;app/build/outputs/apk/debug/app-debug.apk

&lt;span class=&quot;c&quot;&gt;# Gradle 프로젝트 빌드 후 설치까지 한 번에 수행&lt;/span&gt;
android &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; :app
android &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; ~/MyProject?:app@debug &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--offline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;빌드 타깃을 지정하면 CLI가 프로젝트 구조를 분석해 빌드를 실행하고, 생성된 APK를 찾아 기기에 바로 설치합니다.&lt;/p&gt;

&lt;h3 id=&quot;2-기본-delta-install-증분-패치-지원&quot;&gt;(2) 기본 Delta Install (증분 패치) 지원&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;은 증분 설치 옵션(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--use-delta-install&lt;/code&gt;)을 기본값(true)으로 사용합니다.&lt;/p&gt;

&lt;p&gt;기기에 이전 버전의 앱이 이미 설치되어 있다면, APK 전체를 보내지 않고 로컬 APK와 기기 설치본의 차이(Delta)만 계산해 패치 파일(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.seq&lt;/code&gt;)을 전송합니다.&lt;/p&gt;

&lt;p&gt;기기의 임시 디렉터리(/data/local/tmp)에 배포 에이전트(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;installer.jar&lt;/code&gt;)를 올려 커널의 Zero-copy 시스템 콜로 패치를 적용한 뒤 Package Manager에 반영합니다.&lt;/p&gt;

&lt;h2 id=&quot;2-벤치마크-환경-구성&quot;&gt;2. 벤치마크 환경 구성&lt;/h2&gt;

&lt;p&gt;두 도구의 설치 소요 시간과 Delta Install의 데이터 전송 절감량을 확인하기 위해 아래 시나리오별로 테스트를 진행했습니다.&lt;/p&gt;

&lt;h3 id=&quot;테스트-시나리오&quot;&gt;테스트 시나리오&lt;/h3&gt;
&lt;p&gt;APK 내 특정 영역만 변경되는 상황을 시뮬레이션하기 위해 4종류의 APK 변형(Variant)을 생성했습니다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;fresh: 앱을 완전히 삭제(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;uninstall&lt;/code&gt;)한 상태에서 최초 설치&lt;/li&gt;
  &lt;li&gt;same: 동일한 APK를 덮어쓰기 재설치&lt;/li&gt;
  &lt;li&gt;code: Kotlin 코드 상수만 변경 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;classes*.dex&lt;/code&gt;만 변경)&lt;/li&gt;
  &lt;li&gt;res: 문자열 리소스만 변경 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;resources.arsc&lt;/code&gt;만 변경)&lt;/li&gt;
  &lt;li&gt;asset: 에셋 파일 1개만 변경 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;assets/marker.txt&lt;/code&gt;만 변경)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;또한 APK 크기에 따른 전송 대역폭 영향을 보기 위해 두 가지 크기로 측정했습니다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;기본 Compose 앱: 약 11~12MB&lt;/li&gt;
  &lt;li&gt;대용량 리소스 포함 앱: 약 52MB (비압축 40MB 더미 페이로드 포함)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;3-결과-비교&quot;&gt;3. 결과 비교&lt;/h2&gt;

&lt;h3 id=&quot;1-로컬-에뮬레이터-환경&quot;&gt;1) 로컬 에뮬레이터 환경&lt;/h3&gt;

&lt;p&gt;로컬 에뮬레이터는 호스트 메모리 버퍼를 통해 데이터를 전달하므로 네트워크 전송 병목이 없습니다. 5회 반복 측정 후 중앙값 기준입니다.&lt;/p&gt;

&lt;h4 id=&quot;-기본-compose-앱-약-1112mb&quot;&gt;① 기본 Compose 앱 (약 11~12MB)&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;시나리오&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;adb install -r&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;android install (기본 delta)&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;android install (delta OFF)&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;fresh&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.26s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.17s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.13s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;same&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.32s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.01s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.03s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;code&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.32s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.01s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.07s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;res&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.36s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.04s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.05s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;asset&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.33s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.06s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.03s&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h4 id=&quot;-52mb-앱-대용량-에셋-포함&quot;&gt;② 52MB 앱 (대용량 에셋 포함)&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;시나리오&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;adb install -r&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;android install (기본 delta)&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;android install (delta OFF)&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;fresh&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.46s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.50s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.22s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;same&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.57s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.54s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.30s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;code&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.52s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.47s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.24s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;res&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.48s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.42s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.28s&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;asset&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;0.52s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.38s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.28s&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;결과-분석&quot;&gt;결과 분석&lt;/h3&gt;
&lt;p&gt;로컬 에뮬레이터에서는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb install -r&lt;/code&gt;이 더 빠릅니다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Android CLI 자체를 기동하는 데 약 0.45초의 기본 오버헤드가 발생합니다.&lt;/li&gt;
  &lt;li&gt;전송 지연이 없는 환경에서는 50MB 전체를 전송하더라도 0.5초 안에 끝나므로, 차이점(Delta)을 계산하고 기기에서 패치 에이전트를 구동하는 시간이 전송 절약 시간보다 더 깁니다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;2-실기기--wi-fi-디버깅-환경-5-mbs-대역폭-제한&quot;&gt;2) 실기기 / Wi-Fi 디버깅 환경 (5 MB/s 대역폭 제한)&lt;/h3&gt;

&lt;p&gt;실제 개발 환경에서는 Wi-Fi 페어링 무선 디버깅이나 USB 2.0 케이블 연결처럼 &lt;strong&gt;전송 대역폭이 제한되는 환경&lt;/strong&gt;이 많습니다. 이를 재현하기 위해 에뮬레이터 포트 앞에 5 MB/s 전송 속도 제한 프록시를 두고 재측정했습니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;※ 배수 비교는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb install -r&lt;/code&gt; 대비 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;의 소요 시간 기준이며, 절감율은 전체 APK 크기 대비 실제 전송된 패치 크기 기준입니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4 id=&quot;-52mb-앱-대역폭-5-mbs&quot;&gt;① 52MB 앱 (대역폭 5 MB/s)&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;시나리오&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;adb install -r&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;android install (Delta ON)&lt;/th&gt;
      &lt;th&gt;절감율 / 전송량&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;fresh&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;10.41s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;11.63s&lt;/td&gt;
      &lt;td&gt;전체 전송 (51.80 MB)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;same&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;10.44s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.52s (adb 대비 약 6.8배 빠름)&lt;/td&gt;
      &lt;td&gt;554 KB 전송 (98.9% 절감)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;code&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;10.44s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.45s (adb 대비 약 7.2배 빠름)&lt;/td&gt;
      &lt;td&gt;584 KB 전송 (98.9% 절감)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;res&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;10.53s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.68s (adb 대비 약 6.3배 빠름)&lt;/td&gt;
      &lt;td&gt;1.46 MB 전송 (97.2% 절감)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;asset&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;10.52s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.63s (adb 대비 약 6.4배 빠름)&lt;/td&gt;
      &lt;td&gt;1.46 MB 전송 (97.2% 절감)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h4 id=&quot;-1112mb-기본-앱-대역폭-5-mbs&quot;&gt;② 11~12MB 기본 앱 (대역폭 5 MB/s)&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;시나리오&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;adb install -r&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt;android install (Delta ON)&lt;/th&gt;
      &lt;th&gt;절감율 / 전송량&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;fresh&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;2.30s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;3.48s&lt;/td&gt;
      &lt;td&gt;전체 전송 (11.33 MB)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;same&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;2.31s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.28s (adb 대비 약 1.8배 빠름)&lt;/td&gt;
      &lt;td&gt;89 KB 전송 (99.2% 절감)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;code&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;2.32s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.29s (adb 대비 약 1.8배 빠름)&lt;/td&gt;
      &lt;td&gt;140 KB 전송 (98.8% 절감)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;res&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;2.40s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.54s (adb 대비 약 1.6배 빠름)&lt;/td&gt;
      &lt;td&gt;1.02 MB 전송 (91.4% 절감)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;asset&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;2.40s&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;1.49s (adb 대비 약 1.6배 빠름)&lt;/td&gt;
      &lt;td&gt;1.02 MB 전송 (91.4% 절감)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;결과-분석-1&quot;&gt;결과 분석&lt;/h3&gt;
&lt;p&gt;전송 속도가 제한되는 네트워크나 USB 환경에서는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;이 훨씬 빠릅니다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb install -r&lt;/code&gt;은 변경된 내용이 적더라도 52MB 전체를 스트리밍 전송하므로 매번 &lt;strong&gt;10초 이상(10.44s~10.53s)&lt;/strong&gt; 걸립니다.&lt;/li&gt;
  &lt;li&gt;반면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;은 &lt;strong&gt;584KB 패치 파일만 전송(전송량 98.9% 절감)&lt;/strong&gt;하므로 전송 시간을 0.1초대로 줄여 전체 설치를 &lt;strong&gt;1.45초(약 7.2배 빠름)&lt;/strong&gt;에 마칩니다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;4-adb-fastdeploy와의-차이&quot;&gt;4. “adb –fastdeploy”와의 차이&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb install&lt;/code&gt;에도 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--fastdeploy&lt;/code&gt; 옵션이 있지만, 아래 경고를 출력하며 일반 전체 설치로 전환될 수도 있습니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Fast Deploy is only compatible with devices of API version 24 or higher, ignoring.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;반면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;의 Delta Install은 Android Studio 배포 시스템(Deployer)의 기술을 CLI에 적용해 최신 OS에서도 정상적으로 패치 설치를 수행합니다.&lt;/p&gt;

&lt;h2 id=&quot;5-요약-및-상황별-추천&quot;&gt;5. 요약 및 상황별 추천&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;을 써야 하는 경우
    &lt;ul&gt;
      &lt;li&gt;실기기 디버깅(특히 Wi-Fi 무선 디버깅): 코드나 리소스 일부만 수정하고 재설치할 때 전송 시간이 대폭 줄어듭니다.&lt;/li&gt;
      &lt;li&gt;대용량 프로젝트: APK 크기가 클수록 Delta 패치 전송의 절약 효과가 큽니다.&lt;/li&gt;
      &lt;li&gt;빌드와 배포 연동: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;:app&lt;/code&gt; 같은 타깃 참조를 넘겨 빌드와 설치를 명령어 하나로 실행할 때 적합합니다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb install&lt;/code&gt;을 써야 하는 경우
    &lt;ul&gt;
      &lt;li&gt;로컬 에뮬레이터 반복 테스트: 전송 병목이 없어 CLI 기동 오버헤드가 없는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb&lt;/code&gt;가 0.2초대로 가장 빠릅니다.&lt;/li&gt;
      &lt;li&gt;가벼운 CI/CD 파이프라인: 별도의 Android CLI 스택 없이 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;platform-tools&lt;/code&gt;만 설치된 환경에서 배포할 때 유리합니다.&lt;/li&gt;
      &lt;li&gt;세부 설치 옵션 제어: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--instant&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--abi&lt;/code&gt;, 다중 패키지 원자적 설치 등 저수준 Package Manager 옵션이 필요할 때 사용합니다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Sun, 01 Nov 2026 09:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/2026/11/01/adb-install-vs-android-install/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/2026/11/01/adb-install-vs-android-install/</guid>
        
        <category>Android</category>
        
        <category>AndroidCLI</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
      </item>
    
      <item>
        <title>Blog: [요약] The latest in Android dev tools (Android Dev Summit &apos;26)</title>
        <description>&lt;div class=&quot;youtube&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/w-auFZP5gJo&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;!--more--&gt;

&lt;p&gt;기존 안드로이드 CLI 도구는 사용자 대화형 입력(Interactive Prompt)을 요구해 AI 에이전트가 자동으로 처리하기 어려웠습니다.&lt;/p&gt;

&lt;p&gt;Android Dev Summit 2026의 “The latest in Android dev tools” 세션에서는 터미널, 데스크톱 에이전트 앱, Android Studio에서 AI 에이전트가 직접 제어할 수 있는 새로운 안드로이드 도구 체인을 발표했습니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;본 글은 Gemini를 사용하여 초안을 작성한 후 검수하였습니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;개요-ai-코딩-에이전트-시대의-안드로이드-개발-도구&quot;&gt;개요: AI 코딩 에이전트 시대의 안드로이드 개발 도구&lt;/h1&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/01.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;핵심-구성-요소&quot;&gt;핵심 구성 요소&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Android CLI: 터미널 스크립트, CI, 에이전트 앱, Android Studio 전체를 관통하는 단일 엔트리 포인트 도구&lt;/li&gt;
  &lt;li&gt;Agent Applications: Google Antigravity, Claude Code, OpenAI Codex 등과의 딥 인테그레이션(공식 플러그인 &amp;amp; Sidecar)&lt;/li&gt;
  &lt;li&gt;Android Studio Rabbit 2/3: ACP(Agent Client Protocol) 기반 BYOA(Bring Your Own Agent) 및 AI Change Review&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;데모 전반에는 40개 모듈로 구성된 대규모 오픈소스 오디오/비디오 팟캐스트 앱인 Pocket Casts가 사용되었습니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;1-android-cli&quot;&gt;1. Android CLI&lt;/h1&gt;

&lt;p&gt;Android CLI는 AI 에이전트가 안드로이드 도구를 실행할 때 생기는 파싱 오류와 불필요한 대기를 없애도록 만들었습니다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;예측 가능한 명령어 체계 (Predictable commands)&lt;/li&gt;
  &lt;li&gt;JSON 등 기계가 읽기 쉬운 구조화된 출력 (Structured outputs)&lt;/li&gt;
  &lt;li&gt;추가 입력 프롬프트 없이 즉시 끝나는 비대화형 실행 (Zero interactive prompts)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/02.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;주요-신규-명령어-android---ads&quot;&gt;주요 신규 명령어 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android --ads&lt;/code&gt;)&lt;/h3&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;명령어&lt;/th&gt;
      &lt;th&gt;주요 기능 및 특징&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;signals&lt;/td&gt;
      &lt;td&gt;Crashlytics의 크래시 목록 및 현장 텔레메트리 데이터를 조회&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;device&lt;/td&gt;
      &lt;td&gt;연결된 기기/에뮬레이터 미러링(device hub) 및 원격 물리 기기 대여(Reservation) 관리&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;profiler&lt;/td&gt;
      &lt;td&gt;앱, 게임, 디바이스의 시스템 트레이스(Perfetto) 및 힙 덤프 수집&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;build&lt;/td&gt;
      &lt;td&gt;Gradle 등의 빌드 아티팩트를 CLI에서 직접 빌드&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;preview&lt;/td&gt;
      &lt;td&gt;Android Studio나 실제 기기 없이 터미널에서 Jetpack Compose @Preview를 PNG 및 JSON 컴포넌트 트리로 렌더링&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;install&lt;/td&gt;
      &lt;td&gt;변경된 바이트만 전송하는 델타 푸시(Delta push) 배포 (기존 ADB 대비 대폭 시간 절약)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;input&lt;/td&gt;
      &lt;td&gt;복잡한 좌표 계산 대신 시맨틱 UI 요소를 대상으로 제스처 및 키 이벤트 전송&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;analyze&lt;/td&gt;
      &lt;td&gt;AAB/APK의 R8 설정, 난독화 비율, DEX 크기 및 리소스 분석&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;docs&lt;/td&gt;
      &lt;td&gt;공식 안드로이드 지식 베이스(KB)에서 최신 가이드 문서를 온디맨드로 로컬 검색 및 fetch&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;auth&lt;/td&gt;
      &lt;td&gt;안드로이드 CLI 도구용 Google 서비스 인증 로그인/로그아웃&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;2-터미널-환경의-에이전트-자동화-데모-claude-code&quot;&gt;2. 터미널 환경의 에이전트 자동화 데모 (Claude Code)&lt;/h1&gt;

&lt;h2 id=&quot;1-프로덕션-크래시-재현-및-핫픽스&quot;&gt;(1) 프로덕션 크래시 재현 및 핫픽스&lt;/h2&gt;

&lt;p&gt;Firebase Crashlytics에 보고된 실제 크래시를 에이전트가 탐색, 재현, 코드 수정, 배포 및 검증까지 단 1분 42초 만에 수정했습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/03.png&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;데모&quot;&gt;데모&lt;/h4&gt;

&lt;ol&gt;
  &lt;li&gt;크래시 탐색: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android signals&lt;/code&gt; 명령어로 지난 30일간 사용자 발생 수가 가장 높은 크래시를 조회
    &lt;ul&gt;
      &lt;li&gt;원인: 비밀번호 재설정(“I forgot my password”) 버튼을 연속 두 번 탭하면 네비게이션이 중복 실행되어 &lt;strong&gt;IllegalArgumentException&lt;/strong&gt;이 발생
        &lt;blockquote&gt;
          &lt;p&gt;IllegalArgumentException: Navigation action … cannot be found from the current destination&lt;/p&gt;
        &lt;/blockquote&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;기기에서 재현: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android layout&lt;/code&gt;으로 버튼 좌표를 확인한 뒤 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android input tap&lt;/code&gt;으로 버튼을 두 번 탭해 실제 기기에서 크래시 발생&lt;/li&gt;
  &lt;li&gt;코드 수정: 중복 화면 이동을 막도록 SignInFragment.kt와 PromoCodeFragment.kt의 네비게이션 로직에 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;currentDestination&lt;/code&gt; 확인 가드를 추가&lt;/li&gt;
  &lt;li&gt;고속 재배포: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android build&lt;/code&gt;로 빌드한 뒤 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install&lt;/code&gt;을 실행해 전체 84MB APK 대신 &lt;strong&gt;3.84MB 델타 패치&lt;/strong&gt;만 기기로 전송&lt;/li&gt;
  &lt;li&gt;검증: 기기에서 다시 더블 탭을 실행해 크래시 로그가 남지 않고(0 lines) 화면이 정상 유지됨을 확인&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;사용된-android-cli-commands&quot;&gt;사용된 Android CLI commands&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android signals crashes list --firebase-app ... --sort-by=users --timeframe=30d&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;최근 30일간 사용자 수 기준 상위 크래시 이슈 랭킹 조회&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android signals crashes describe &amp;lt;issue&amp;gt; --timeframe=30d&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;해당 크래시의 상세 스택 트레이스 및 디바이스/안드로이드 OS 버전별 분포 확인&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android layout --device=... --flat&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;수정 전/후 비밀번호 재설정 버튼의 좌표를 파악하기 위한 UI 레이아웃 트리 조회&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android input tap --device=... &quot;id:btnSignIn&quot;&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;구버전 로그인 화면으로 진입하기 위한 시맨틱 탭 전송 (2회 실행)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android build &quot;gradle://?:app:assembleDebugProd&quot;&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;수정된 코드의 빌드 산출물 생성&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android install --device=...&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;초기 수정 전 빌드 설치, 핫픽스 빌드 델타 패치 주입 (84MB 중 3.84MB만 전송)&lt;br /&gt;
&lt;em&gt;(참고: CLI가 지원하지 않는 화면 회전 고정, 딥링크 호출, 백키 입력, 더블탭 등 일부 작업에는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;adb&lt;/code&gt;를 보조로 사용)&lt;/em&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;2-apk-최적화-r8-configuration-analyzer&quot;&gt;(2) APK 최적화: R8 Configuration Analyzer&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Release Bundle이 너무 크다&lt;/code&gt;는 요청에 대해 에이전트가 ProGuard/R8 룰을 분석하고 불필요한 keep 룰을 제거했습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/04.png&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;데모-1&quot;&gt;데모&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;원인 파악: Protocol Buffers keep 룰이 지나치게 포괄적이어서 불필요한 클래스까지 난독화 대상에서 제외되고 있었습니다.&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;ul&gt;
        &lt;li&gt;수정 전 : -keep class * extends com.google.protobuf.GeneratedMessageLite { *; }&lt;/li&gt;
        &lt;li&gt;수정 후 : -keepclassmembers class * extends com.google.protobuf.GeneratedMessageLite { &lt;fields&gt;; }&lt;/fields&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;클래스 전체를 유지하지 않고, 실제 사용하는 필드 멤버와 Retrofit 반환 타입으로 호출되는 API 메시지만 유지(keep)하도록 수정&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;개선 결과:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;비압축 DEX 크기: 19,485,804 B → 18,957,388 B (-528 KB, -2.7%)&lt;/li&gt;
  &lt;li&gt;APK 압축 크기: 42,311,672 B → 42,147,832 B (-164 KB)&lt;/li&gt;
  &lt;li&gt;Keep된 메서드 수: 17,940개 → 11,757개 (-6,183개 제거, -34%)&lt;/li&gt;
  &lt;li&gt;Keep된 필드 수: 7,944개 → 7,209개 (-735개 감소)&lt;/li&gt;
  &lt;li&gt;Keep된 클래스 수: 2,342개 → 2,268개 (-74개 감소)&lt;/li&gt;
  &lt;li&gt;DEX 난독화 비율: 92.72% → 93.06% (+0.34%p)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;사용된-android-cli-commands-1&quot;&gt;사용된 Android CLI commands&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android analyze ./before/app-release.apk&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;수정 전 베이스라인 APK의 DEX 크기, R8 설정 및 난독화 비율(Obfuscation ratio) 측정&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android analyze ./after/app-release.apk&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;룰 수정 후 생성된 APK의 수치를 동일하게 추출하여 개선 지표 비교&lt;br /&gt;
&lt;em&gt;(참고: CLI에 Configuration Analyzer 출력 파싱 명령어가 없어 상위 룰 랭킹에는 보조 스크립트 활용)&lt;/em&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;3-앱-시작-시간startup-time-최적화-baseline-profile--profiler&quot;&gt;(3) 앱 시작 시간(Startup Time) 최적화: Baseline Profile &amp;amp; Profiler&lt;/h2&gt;

&lt;p&gt;앱 시작 성능 개선 요청 시 에이전트가 공식 문서를 읽고 프로파일러를 통한 측정을 수행했습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/05.png&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;데모-2&quot;&gt;데모&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;원인 분석: 출시 버전 프로토타입 APK의 &lt;strong&gt;baseline.prof&lt;/strong&gt;가 약 8KB에 불과하며, 포함된 6,690개 룰 중 Pocket Casts 자체 코드 룰이 0개(전체 프로필 로드 룰 중에서도 단 66개)여서 시작 코드가 JIT/인터프리터로 구동되고 있음을 확인&lt;/li&gt;
  &lt;li&gt;최적화 수행: 공식 문서를 읽어 무루팅 환경(Android 14+)에서 베이스라인 프로필을 수집 및 생성하는 절차를 확인하고, 콜드 스타트 프로필 룰(Pocket Casts 룰 2,621개 포함)을 갱신&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;사용된-android-cli-commands-2&quot;&gt;사용된 Android CLI commands&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android profiler systemtrace start --launch --duration=8&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;앱 콜드 런치(Cold start) 시점의 시스템 트레이스를 Perfetto 형식(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.pftrace&lt;/code&gt;)으로 수집 (수집된 트레이스는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ui.perfetto.dev&lt;/code&gt;에서 분석)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android docs fetch kb://android/topic/performance/baselineprofiles/manually-create-measure&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;Android 14+ 기기에서 루팅 없이 Baseline Profile을 수동 생성하고 측정하는 최신 공식 기술 가이드라인 로컬 fetch 및 학습&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;개선 수치 (Pixel 6 Pro 기준):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Main-thread CPU 시간: 297.7ms → 244.7ms (-17.8%)&lt;/li&gt;
  &lt;li&gt;Total app CPU 시간: 809.3ms → 600.4ms (-25.8%)&lt;/li&gt;
  &lt;li&gt;JIT thread CPU 시간: 56.3ms → 15.6ms (-72.2%)&lt;/li&gt;
  &lt;li&gt;Time to initial display (TTID): 463.2ms → 383.4ms (-17.2% 단축)&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;3-linux-데스크탑에서-android-앱-네이티브-실행-실험적-프로토타입&quot;&gt;3. Linux 데스크탑에서 Android 앱 네이티브 실행 (실험적 프로토타입)&lt;/h1&gt;

&lt;p&gt;별도의 무거운 에뮬레이터나 중첩 가상화(Nested Virtualization) 없이, &lt;strong&gt;Linux 데스크톱 상에서 Android x86 APK를 단일 네이티브 프로세스로 직접 실행&lt;/strong&gt;하는 새로운 기술이 공개되었습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/06.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;초경량 구조: 단일 프로세스로 실행되며 stdout/stdin으로 로그가 직접 출력됨&lt;/li&gt;
  &lt;li&gt;클라우드 에이전트 환경 최적화: 중첩 가상화를 지원하지 않는 클라우드 VM이나 CI 컨테이너에서도 에이전트가 앱을 직접 실행하고 테스트 가능&lt;/li&gt;
  &lt;li&gt;높은 완성도:
    &lt;ul&gt;
      &lt;li&gt;순수 Compose 앱 실행&lt;/li&gt;
      &lt;li&gt;네트워크 통신이 포함된 Google 레퍼런스 앱 실행&lt;/li&gt;
      &lt;li&gt;네이티브 .so 라이브러리 변환 계층을 통해 C++ 라이브러리와 오디오 출력이 포함된 실제 Pocket Casts 앱 구동&lt;/li&gt;
      &lt;li&gt;데스크톱 변환 계층을 통한 OpenGL ES 1 네이티브 게임 앱 렌더링&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;4-ai-에이전트를-위한-공식-android-플러그인&quot;&gt;4. AI 에이전트를 위한 공식 Android 플러그인&lt;/h1&gt;

&lt;p&gt;Google Antigravity, Claude Code, OpenAI Codex를 위한 공식 Android 플러그인이 배포되었습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/07.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;플러그인을 활성화하면 Android CLI 뿐만 아니라, 공식 최신 지식/가이드가 포함된 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Android Skills&lt;/code&gt;가 주입되어 모델의 오래된 학습 데이터 대신 항상 최신 아키텍처 표준을 따릅니다.&lt;/p&gt;

&lt;h3 id=&quot;google-antigravity&quot;&gt;Google Antigravity&lt;/h3&gt;

&lt;h4 id=&quot;1-android-compose-preview&quot;&gt;(1) Android Compose Preview&lt;/h4&gt;
&lt;p&gt;AI 에이전트에게 기존 View 코드를 Compose로 변환하고 대화면(폴더블·태블릿)에 맞게 최적화하도록 요청하면, 에이전트가 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@Preview&lt;/code&gt; 어노테이션을 작성하고 Sidecar 패널에 프리뷰 화면을 즉시 렌더링합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/08.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;전체 앱 컴파일 및 기기 배포를 반복하지 않고, Sidecar 창에서 프리뷰 렌더링을 즉시 갱신&lt;/li&gt;
  &lt;li&gt;대화면에서 1열 스크롤 대신 헤더와 에피소드 목록을 좌우로 나누는 듀얼 창(Dual-pane) 레이아웃을 제안&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;2-android-device-hub&quot;&gt;(2) Android Device Hub&lt;/h4&gt;
&lt;p&gt;Antigravity 내에서 가상 기기(AVD) 및 물리 기기를 통합 관리하고 화면을 직접 미러링할 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/09.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Pixel 10 Pro Fold 등 실제 연결된 기기 목록과 가상 기기(AI Glasses, Medium Phone, Small Phone 등)를 Sidecar 패널에서 통합 관리&lt;/li&gt;
  &lt;li&gt;미러링된 기기 화면을 보며 실시간 터치와 제스처로 상호작용 가능&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/09_split_screen.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;화면 분할(Split Screen) 전환 시 앱이 싱글 페인(Single-pane)과 듀얼 페인(Dual-pane) 사이를 적응형(Adaptive)으로 올바르게 전환하는지 실시간 검증&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;android-cli-연동에-따른-에이전트-효율성-벤치마크&quot;&gt;Android CLI 연동에 따른 에이전트 효율성 벤치마크&lt;/h3&gt;

&lt;p&gt;Claude Opus를 대상으로 6개 사용자 Journeys 및 6개 디바이스에서 메모리 누수를 찾고 수정하는 과제를 Android CLI 사용 여부에 따라 A/B 테스트한 결과입니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/10.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;작업 완료 속도: 1.9배 향상 (88분 → 46분, 42분 단축)&lt;/li&gt;
  &lt;li&gt;토큰 사용량: 1.3배 절감 (4.6M 토큰 → 3.5M 토큰)&lt;/li&gt;
  &lt;li&gt;Compose Preview: 전통적인 컴파일/실행 반복 대비 반복 시간 77% 단축&lt;/li&gt;
  &lt;li&gt;Analyze 명령어: 다중 왕복 검사를 단일 구조화 명령어로 대체하여 출력 토큰 5.5배 절감&lt;/li&gt;
  &lt;li&gt;Semantic Input: 화면 좌표 추정 환각(Hallucination)을 없애 작업 실행 속도 25% 향상&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;5-android-studio와-ai-에이전트의-진화&quot;&gt;5. Android Studio와 AI 에이전트의 진화&lt;/h1&gt;

&lt;h2 id=&quot;1-bring-your-own-agent-byoa-via-agent-client-protocol-acp&quot;&gt;(1) Bring Your Own Agent (BYOA) via Agent Client Protocol (ACP)&lt;/h2&gt;

&lt;p&gt;Android Studio는 내장 Gemini 외에도, 개발자와 팀이 이미 사용 및 구독 중인 외부 에이전트를 IDE로 가져올 수 있는 BYOA 기능을 도입했습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/11.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;경로: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Settings &amp;gt; Tools &amp;gt; AI &amp;gt; Agents&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Agent Client Protocol (ACP) 기반으로 다양한 에이전트 연결 지원:
    &lt;ul&gt;
      &lt;li&gt;Built-in Agent v2.0&lt;/li&gt;
      &lt;li&gt;Google Antigravity&lt;/li&gt;
      &lt;li&gt;Claude Agent (Claude Code / Anthropic API 연동)&lt;/li&gt;
      &lt;li&gt;OpenAI Codex&lt;/li&gt;
      &lt;li&gt;JetBrains Junie&lt;/li&gt;
      &lt;li&gt;ACP Agent Marketplace&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;기존 개인 구독이나 기업용 계정을 그대로 활용 가능&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/12.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;연결된 에이전트(예: Claude Opus 5.5)는 Android Studio의 모든 도구 체인(파일 수정, 정적 분석, 빌드, Gradle 싱크, Compose 프리뷰 렌더링, 기기 배포, 공식 문서 조회)에 직접 접근할 수 있습니다.&lt;/p&gt;

&lt;h2 id=&quot;2-ai-change-review&quot;&gt;(2) AI Change Review&lt;/h2&gt;

&lt;p&gt;대량의 코드를 검토할 때 버그를 사전에 잡을 수 있도록 지원하는 코드 리뷰 기능입니다. 로컬 변경점뿐만 아니라 PR도 분석합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/13.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;15개 파일, 800줄의 PR 변경점을 분석해 잠재적 버그를 사전에 감지&lt;/li&gt;
  &lt;li&gt;데모에서 발견된 실제 이슈:
    &lt;ul&gt;
      &lt;li&gt;북마크 스와이프 행 컴포저블(SwipeRow.kt)에서 LaunchedEffect 키가 람다 객체로 설정되어 있어, 행이 Recomposition될 때마다 풀 스와이프 동작이 중복 실행되는 버그&lt;/li&gt;
      &lt;li&gt;삭제 다이얼로그가 뜬 상태에서 북마크 삭제 확인 다이얼로그가 계속 중복 노출되는 문제&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;해결책 제시 및 일괄 반영: 원인을 설명하고 rememberUpdatedState를 적용한 코드 diff를 제공합니다. 체크박스로 선택한 이슈를 버튼 한 번으로 일괄 수정(Fix all selected issues) 가능&lt;/li&gt;
  &lt;li&gt;주제별 워크스루(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Walkthrough&lt;/code&gt;): PR 내 변경 사항을 기능 단위로 묶어 코드 변경 내역을 확인하고 승인 가능&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;3-android-studio-rabbit-릴리스-현황&quot;&gt;(3) Android Studio Rabbit 릴리스 현황&lt;/h2&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/14.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/ads26/whats-new-in-android-dev-tools/15.png&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;관련-링크&quot;&gt;관련 링크&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;Watch Tools &amp;amp; Performance sessions: &lt;a href=&quot;https://goo.gle/ADS26-Tools-and-Perf&quot;&gt;goo.gle/ADS26-Tools-and-Perf&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Watch all sessions from Android Dev Summit 2026: &lt;a href=&quot;https://goo.gle/ADS26-All-Sessions&quot;&gt;goo.gle/ADS26-All-Sessions&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Android CLI 피드백: &lt;a href=&quot;https://d.android.com/cli&quot;&gt;d.android.com/cli&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sat, 31 Oct 2026 12:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/androiddevsummit/2026/10/31/ads26-whats-new-in-android-dev-tools/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/androiddevsummit/2026/10/31/ads26-whats-new-in-android-dev-tools/</guid>
        
        <category>Android</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
        <category>AndroidDevSummit</category>
        
      </item>
    
      <item>
        <title>Blog: Jetpack Compose로 구현하는 포켓몬 카드 홀로그램 효과</title>
        <description>&lt;p&gt;포켓몬 카드를 손에 쥐고 기울이면, 빛의 각도에 따라 무지개 빛이 반사되고 캐릭터 뒤편에서 홀로그램 효과를 볼 수 있습니다.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;이와 같은 화려한 그래픽 효과는 AGSL, OpenGL 셰이더 같은 전문적인 그래픽 프로그래밍을 통해 구현할 수도 있지만, &lt;strong&gt;Jetpack Compose의 기본 그래픽 API&lt;/strong&gt;(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;graphicsLayer&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Brush&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DrawScope&lt;/code&gt;)만으로도 부드럽고 실감나게 구현할 수 있습니다. 당연히 100% 동일하다는 것은 아닙니다.&lt;/p&gt;

&lt;p&gt;이번 글에서는 Compose를 사용해 &lt;strong&gt;루기아 V(Lugia V) 카드&lt;/strong&gt;를 모델로 3D 틸트와 홀로그램 효과를 구현하는 방법을 소개합니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
  &lt;p&gt;본 글은 Gemini를 사용하여 초안을 작성한 후 검수하였습니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;이미지 출처&lt;/strong&gt;&lt;br /&gt;
본 글에서 사용된 홀로그램 효과 구현의 출처는 Simon Goellner님의 웹 프로젝트인 &lt;a href=&quot;https://poke-holo.simey.me/&quot;&gt;poke-holo (https://poke-holo.simey.me)&lt;/a&gt;입니다.&lt;br /&gt;
카드 일러스트 원본, 마스크 이미지(Mask), 메탈릭 그레인 노이즈 등 사용된 모든 이미지 리소스의 출처 역시 &lt;a href=&quot;https://poke-holo.simey.me/&quot;&gt;poke-holo&lt;/a&gt;에 기반합니다. 웹(CSS)의 놀라운 시각 효과를 안드로이드 &lt;strong&gt;Jetpack Compose&lt;/strong&gt; 캔버스 파이프라인으로 포팅 및 재해석한 과정을 다룹니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;본 글에서 사용된 코드는 아래 버전 기준입니다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;AndroidX Compose BOM 2026.10.00&lt;/li&gt;
  &lt;li&gt;Kotlin 2.4.21&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;동작-모습&quot;&gt;동작 모습&lt;/h2&gt;

&lt;div class=&quot;youtube&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/8V4rvGXGALc&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;카드를 드래그하거나 스마트폰을 기울이면 3D로 회전하며, 캐릭터 뒤편에서 서로 반대 방향으로 엇갈려 이동하는 두 줄기 대각선 광선과 무지개 스펙트럼이 자연스럽게 반응합니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;1-샘플-이미지-준비&quot;&gt;1. 샘플 이미지 준비&lt;/h2&gt;

&lt;p&gt;홀로그램 카드를 구현하려면 두 장의 기본 이미지가 필요합니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;이미지 출처: &lt;a href=&quot;https://poke-holo.simey.me/&quot;&gt;poke-holo&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;기본 카드 이미지&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;마스크 이미지&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/lugia_v_card.png&quot; /&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/lugia_v_mask.webp&quot; /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;카드 전체가 인쇄된 기본 일러스트&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;캐릭터 영역을 보호하기 위한 마스크&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;-기본-카드-이미지-base-card-image&quot;&gt;① 기본 카드 이미지 (Base Card Image)&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;카드 외형 및 정보 표시&lt;/strong&gt;: 카드의 고유 정보를 화면에 보이게 하는 기본 레이어입니다.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;빛 반사의 기반 제공&lt;/strong&gt;: 홀로그램 효과는 빈 캔버스가 아닌 기본 이미지의 명암 위에 빛을 추가하는 빛 합성(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.ColorDodge&lt;/code&gt;)으로 자연스럽게 반사광이 생기도록 합니다.
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.ColorDodge&lt;/code&gt; (최종 빛 합성): 이후 만들어진 홀로그램 포일 레이어를 원본 카드 위에 얹을 때 사용합니다. 원본의 어두운 영역은 유지하면서 밝은 광선 부분만 채도와 밝기를 높여서 실제 프리즘 호일의 강렬한 빛 반사 효과를 연출합니다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/blendmode_foil_comparison.png&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;BlendMode별 시각적 차이&lt;/strong&gt;:&lt;br /&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SrcOver&lt;/code&gt;는 배경 일러스트를 불투명하게 덮어버리고, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Screen&lt;/code&gt;은 빛이 하얗게 뜨며, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Overlay&lt;/code&gt;는 어두운 영역이 칙칙해집니다. 반면 &lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ColorDodge&lt;/code&gt;&lt;/strong&gt;는 원본 일러스트의 생생한 색감을 유지하면서 빛줄기만 환하게 강조해 가장 실감 나는 프리즘 호일을 완성합니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;-마스크-이미지-mask-image&quot;&gt;② 마스크 이미지 (Mask Image)&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;일러스트 보호 (빛 차단)&lt;/strong&gt;: 홀로그램 효과가 카드 전체를 덮어 캐릭터 일러스트가 묻히지 않도록, 캐릭터 영역의 빛을 차단하고 배경만 빛을 받을 수 있도록 영역을 분리합니다.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;3D 공간 깊이감(Depth) 구현&lt;/strong&gt;: 캐릭터가 Foreground에 있고, 빛 효과가 Background에 위치하도록 레이어를 구분하여, 2D 카드 평면에서도 입체적인 공간감을 표현합니다.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;사용하는 BlendMode (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.DstIn&lt;/code&gt;)&lt;/strong&gt;:
    &lt;ul&gt;
      &lt;li&gt;&lt;strong&gt;스텐실 마스킹(Stencil Cutout)&lt;/strong&gt;: 마스크 이미지의 불투명 영역(배경)에만 기존에 그려둔 홀로그램 포일 효과를 남기고, 투명한 영역(Alpha 0, 캐릭터)은 제외되도록 처리합니다. 결과적으로 캐릭터 영역은 홀로그램에서 제외되고 배경에만 홀로그램이 적용됩니다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/blendmode_mask_comparison.png&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;마스크 적용 유무에 따른 차이&lt;/strong&gt;:&lt;br /&gt;
마스크를 사용하지 않고 합성할 경우, 캐릭터 얼굴과 몸체까지 홀로그램 빛이 침범해 일러스트가 훼손되지만, &lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.DstIn&lt;/code&gt;&lt;/strong&gt;을 적용하면 캐릭터는 선명하게 전경에 남고, 빛 반사 효과는 캐릭터 뒤 배경에만 선명하게 표현됩니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;2-카드-효과-입체감-넘치는-3d-틸트-tilt&quot;&gt;2. 카드 효과: 입체감 넘치는 3D 틸트 (Tilt)&lt;/h2&gt;

&lt;p&gt;카드를 손에 들고 기울이는 느낌을 주는 &lt;strong&gt;3D 회전(Tilt)&lt;/strong&gt; 효과입니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/step1_tilt_animation.webp&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;손가락으로 드래그하거나 기기의 센서 움직임에 따라 카드가 3D 공간에서 부드럽게 기울어집니다. 손을 떼었을 때 자연스러운 탄성 효과와 함께 원래 위치로 되돌아오는 애니메이션입니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;tiltXAnim&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Animatable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;tiltYAnim&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Animatable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;coroutineScope&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;rememberCoroutineScope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 자연스러운 탄성을 위한 감쇠 스프링 설정&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;springSpec&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;spring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;(&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;dampingRatio&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.55f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// 바운스 감쇠 비율 (0.55: 자연스러운 흔들림)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;stiffness&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;300f&lt;/span&gt;      &lt;span class=&quot;c1&quot;&gt;// 스프링 탄성 강도&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pointerInput&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Unit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;detectDragGestures&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;onDrag&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;change&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;c1&quot;&gt;// 터치 좌표를 0.0 ~ 1.0 비율로 정규화&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;normX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;change&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;coerceIn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;normY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;change&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;coerceIn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;c1&quot;&gt;// -1.0 ~ +1.0 사이의 틸트 비율 즉각 반영&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;coroutineScope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;n&quot;&gt;tiltXAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;snapTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;normX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;n&quot;&gt;tiltYAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;snapTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;normY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;onDragEnd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;c1&quot;&gt;// 손을 떼면 스프링 물리 애니메이션으로 원점(0, 0) 복귀&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;coroutineScope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;nf&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tiltXAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;animateTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;springSpec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                    &lt;span class=&quot;nf&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tiltYAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;animateTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;springSpec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;graphicsLayer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// 손가락 위치나 센서 기울기에 맞춰 X축, Y축으로 3D 회전&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;rotationX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tiltYAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;maxTiltDegrees&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;rotationY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tiltXAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;maxTiltDegrees&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// 카메라 거리(원근감) 설정: 값이 적절해야 자연스러운 원근감이 연출됨&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;cameraDistance&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;16f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;density&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;3D 원근 회전 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;graphicsLayer&lt;/code&gt;)&lt;/strong&gt;: 정규화된 틸트 비율(-1.0 ~ 1.0)에 맞춰 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rotationX&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rotationY&lt;/code&gt;를 적용하고, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cameraDistance&lt;/code&gt;로 왜곡 없는 입체 원근감을 제공합니다.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;스프링 물리 복귀 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Animatable&lt;/code&gt;)&lt;/strong&gt;: 손을 떼면 감쇠 스프링으로 자연스러운 탄성 바운스와 함께 원래의 상태로 돌아갑니다.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;3-빛-홀로그램-효과-루기아-v의-시그니처-빛-반사-효과&quot;&gt;3. 빛 홀로그램 효과: 루기아 V의 시그니처 빛 반사 효과&lt;/h2&gt;

&lt;p&gt;카드를 기울일 때 나타나는 &lt;strong&gt;빛 반사 효과&lt;/strong&gt;는 &lt;strong&gt;4개의 빛 레이어&lt;/strong&gt;가 순서대로 겹쳐져 완성됩니다.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;최종 완성 카드
  └── 4. 캐릭터 보존 마스킹 (DstIn으로 캐릭터 뚫고, ColorDodge로 배경 빛 합성)
  └── 3. 메탈릭 호일 질감 (BlendMode.Screen 그레인 노이즈)
  └── 2. 무지개 스펙트럼 (BlendMode.Hue 색조 입히기)
  └── 1. 두 줄기 대각선 광선 (133° 교차 사선 빔)
  └── [카드 원본 일러스트]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;그래픽 이론이나 셰이더 프로그래밍에 대한 지식이 없어도 쉽게 이해할 수 있도록 하나씩 살펴보겠습니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;-서로-엇갈려-교차하는-두-대각선-광선-dual-diagonal-beams&quot;&gt;① 서로 엇갈려 교차하는 두 대각선 광선 (Dual Diagonal Beams)&lt;/h3&gt;

&lt;p&gt;루기아 V 카드의 가장 큰 특징은 카드를 좌우로 기울일 때 &lt;strong&gt;두 개의 대각선 빛줄기가 서로 반대 방향으로 엇갈려 이동&lt;/strong&gt;하는 것입니다.&lt;br /&gt;
어두운 밤하늘에 133° 사선 각도로 비추는 &lt;strong&gt;두 대의 탐조등(손전등)&lt;/strong&gt;처럼, 카드를 움직일 때마다 빛의 교차 무늬를 만들어냅니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 기울기(bgX)에 맞춰 한쪽은 왼쪽(-), 다른 쪽은 오른쪽(+)으로 역방향 이동&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;forwardShift&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bgX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2.0f&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;counterShift&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bgX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.95f&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 1. 순방향 메인 빔 (Base Beam)&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;forwardBeamBrush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Brush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;linearGradient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;V_DIAGONAL_BEAM_STOPS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;centerX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;halfCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;centerY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;halfCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;centerX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;halfCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;centerY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;halfCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;tileMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TileMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Repeated&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 2. 반대 방향 빔 (Counter Beam)&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;counterBeamBrush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Brush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;linearGradient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;V_DIAGONAL_BEAM_STOPS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;centerX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;halfCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;centerY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;halfCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;centerX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;halfCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;centerY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;halfCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;tileMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TileMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Repeated&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 순방향 빔 위에 역방향 빔을 Softlight 모드로 합성&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardBeamBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterBeamBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Softlight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.85f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.Softlight&lt;/code&gt;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;부드러운 조명&lt;/strong&gt; 효과를 통해 두 광선이 겹칠 때 어두운 곳은 깊어지고 밝은 곳은 부드럽게 중첩되어 자연스러운 교차 무늬를 만들어냅니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/step2_dual_beam.png&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;-은은하게-퍼지는-수직-무지개-스펙트럼&quot;&gt;② 은은하게 퍼지는 수직 무지개 스펙트럼&lt;/h3&gt;

&lt;p&gt;앞서 만든 두 광선의 흑백 명암 위에 각도에 따라 변하는 &lt;strong&gt;프리즘 무지개 스펙트럼&lt;/strong&gt;을 입혀줍니다.&lt;br /&gt;
흑백 스케치북 위에 &lt;strong&gt;투명한 무지개 셀로판지&lt;/strong&gt;를 올리는 듯한 느낌으로, 흑백 광선에 생동감 넘치는 화려한 색감을 더합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 세로 방향 순환 6색 무지개 그라디언트&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;rainbowBrush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Brush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;linearGradient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;SUNPILLAR_COLOR_STOPS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sunpillarShiftY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sunpillarShiftY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sunpillarCycle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;tileMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TileMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Repeated&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 광선 위에 무지개 색조(Hue)만 덧입히기&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rainbowBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Hue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.Hue&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;광선의 밝기와 형태(명암)는 그대로 유지하되, 오직 색상(Hue) 정보만 무지개색으로 교체하여 광선이 무지개빛으로 빛나게 합니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/step3_rainbow_spectrum.png&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;-실물-카드의-메탈릭-호일-질감-그레인-노이즈&quot;&gt;③ 실물 카드의 메탈릭 호일 질감 (그레인 노이즈)&lt;/h3&gt;

&lt;p&gt;매끄러운 디지털 그라디언트는 모니터 화면처럼 보이기 쉽습니다. 실제 카드는 메탈릭 호일 위에 인쇄되므로, 빛 위에 미세한 &lt;strong&gt;메탈릭 입자(노이즈)&lt;/strong&gt;를 더하는 과정이 필요합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 미세한 메탈릭 노이즈 텍스처를 25% 투명도로 얹어줌&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;drawImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;image&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grainBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;IntSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;toInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;toInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Screen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.25f&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.Screen&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;검은색 배경을 투명하게 처리하고 밝은 노이즈 입자를 추가하여, 은은한 금속 호일의 입자 질감을 만듭니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/step4_metallic_grain.png&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;-캐릭터-보존-마스킹과-최종-홀로그램-완성&quot;&gt;④ 캐릭터 보존 마스킹과 최종 홀로그램 완성&lt;/h3&gt;

&lt;p&gt;카드 전체에 홀로그램 빛을 뿌리면 캐릭터 얼굴과 몸까지 번쩍여 일러스트가 가려질 수 있습니다. 미술 시간에 캐릭터 모양대로 오려둔 &lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;스텐실(Stencil) 마스크&lt;/code&gt;&lt;/strong&gt;처럼, 캐릭터 몸체는 보호하고 &lt;strong&gt;오직 캐릭터 뒤편 배경에만&lt;/strong&gt; 홀로그램 빛이 투과되도록 합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 1. 임시 레이어(오프스크린 버퍼) 생성&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;drawIntoCanvas&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;canvas&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;canvas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;saveLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;layerRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;layerPaint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// layerPaint blendMode = ColorDodge&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// ① 두 줄기 광선 + 무지개(Hue) + 그레인(Screen) 그리기&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardBeamBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rainbowBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Hue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterBeamBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Softlight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.85f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;drawImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;grainBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Screen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.25f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// ② 마스크로 캐릭터 영역 뚫어내기&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;drawImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;maskBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;DstIn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// 2. 임시 레이어를 닫고 원본 카드 위에 ColorDodge로 빛 합성&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;canvas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;restore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.DstIn&lt;/code&gt; (스텐실 마스킹)&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;마스크의 불투명 영역(배경)에만 홀로그램 효과를 추가하고, 캐릭터 영역은 깨끗하게 지워냅니다.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BlendMode.ColorDodge&lt;/code&gt; (프리즘 빛 합성)&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;어두운 배경은 유지하면서 밝은 광선 부분의 채도/밝기를 극대화하여 실제 프리즘에서 나타나는 빛 반사 효과를 구현합니다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/1017/step5_masked_foil.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;캐릭터의 원래 색상은 유지되면서 뒤쪽에서만 홀로그램 빔의 빛 반사 효과가 빛나면서 깊이 있는 3D 입체감을 제공합니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;4-전체-구현-코드&quot;&gt;4. 전체 구현 코드&lt;/h2&gt;

&lt;p&gt;이 모든 효과를 하나로 묶은 Composable 코드입니다. 별도의 외부 그래픽 라이브러리 없이 순수 Compose 코드만으로 동작합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 1. 수직 6색 무지개 그라디언트 색상 구간&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;SUNPILLAR_COLOR_STOPS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;arrayOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.0000f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFFFF7575&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.1667f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFFF2E86E&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.3333f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFFA8ED6E&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.5000f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFF85F7F0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.6667f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFF7A9EFF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.8333f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFFE275FF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;1.0000f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFFFF7575&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 2. 루기아 V 대각선 광선 그라디언트 색상 구간&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;V_DIAGONAL_BEAM_STOPS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;arrayOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.000f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFF0E152E&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.316f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFF90A3A3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.375f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFF90BFBF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.433f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFF90A3A3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;0.833f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFF0E152E&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;mf&quot;&gt;1.000f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFF0E152E&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;PokemonVCard&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cardImageRes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;maskResId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;maxTiltDegrees&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Float&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;14.3f&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;cardBitmap&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ImageBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;imageResource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cardImageRes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;maskBitmap&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ImageBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;imageResource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;maskResId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;grainBitmap&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ImageBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;imageResource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;drawable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v_grain&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;coroutineScope&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;rememberCoroutineScope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;tiltXAnim&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Animatable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;tiltYAnim&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Animatable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;springSpec&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;spring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;(&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;dampingRatio&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.55f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// 바운스 감쇠 비율&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;stiffness&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;300f&lt;/span&gt;      &lt;span class=&quot;c1&quot;&gt;// 스프링 탄성 강도&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// 대각선 133도 방향 벡터&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;beamRad&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;133.0&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;PI&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;180.0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;toFloat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kotlin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;beamRad&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;kotlin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;beamRad&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// 마스킹된 포일을 카드 원본에 빛 합성할 페인트&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;layerPaint&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;Paint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;apply&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;ColorDodge&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nc&quot;&gt;Box&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;aspectRatio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.718f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// 공식 포켓몬 카드 종횡비&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;clip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;RoundedCornerShape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pointerInput&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Unit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;nf&quot;&gt;detectDragGestures&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
                    &lt;span class=&quot;n&quot;&gt;onDrag&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;change&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;normX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;change&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;coerceIn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;normY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;change&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;coerceIn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;coroutineScope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                            &lt;span class=&quot;n&quot;&gt;tiltXAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;snapTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;normX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                            &lt;span class=&quot;n&quot;&gt;tiltYAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;snapTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;normY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
                    &lt;span class=&quot;n&quot;&gt;onDragEnd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;coroutineScope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                            &lt;span class=&quot;nf&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tiltXAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;animateTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;springSpec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                            &lt;span class=&quot;nf&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tiltYAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;animateTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;springSpec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;graphicsLayer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;c1&quot;&gt;// Drawing 단계에서 상태를 읽어 불필요한 Recomposition 방지&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;rotationX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tiltYAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;maxTiltDegrees&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;rotationY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tiltXAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;maxTiltDegrees&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;cameraDistance&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;16f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;density&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;drawWithCache&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;height&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;diagonal&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kotlin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;hypot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;layerRect&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Rect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;dstSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;IntSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;toInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;toInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;

                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;beamCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;diagonal&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.2712f&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;beamCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;diagonal&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.2049f&lt;/span&gt;
                &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;sunpillarCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2.10f&lt;/span&gt;

                &lt;span class=&quot;nf&quot;&gt;onDrawWithContent&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;normX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tiltXAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;normY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tiltYAnim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;

                    &lt;span class=&quot;c1&quot;&gt;// 1. 카드 기본 일러스트 그리기&lt;/span&gt;
                    &lt;span class=&quot;nf&quot;&gt;drawImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cardBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                    &lt;span class=&quot;c1&quot;&gt;// 2. 캐릭터 뒤편 배경에만 홀로그램 포일 합성&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;bgX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.37f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.26f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;normX&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;bgY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.33f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.34f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;normY&lt;/span&gt;

                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;forwardShift&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bgX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2.0f&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;counterShift&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bgX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.95f&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;sunpillarShiftY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;7.0f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;6.0f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bgY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt;

                    &lt;span class=&quot;c1&quot;&gt;// ① 순방향 &amp;amp; 반대 방향 두 광선 브러시&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;forwardBeamBrush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Brush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;linearGradient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
                        &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;V_DIAGONAL_BEAM_STOPS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;tileMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TileMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Repeated&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;counterBeamBrush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Brush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;linearGradient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
                        &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;V_DIAGONAL_BEAM_STOPS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;beamCycleAfter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.5f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dirY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterShift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;tileMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TileMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Repeated&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;c1&quot;&gt;// ② 수직 무지개 브러시&lt;/span&gt;
                    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;rainbowBrush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Brush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;linearGradient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
                        &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;SUNPILLAR_COLOR_STOPS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sunpillarShiftY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sunpillarShiftY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sunpillarCycle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;tileMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;TileMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Repeated&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                    &lt;span class=&quot;c1&quot;&gt;// ③ 오프스크린 레이어에서 포일 합성 후 마스킹&lt;/span&gt;
                    &lt;span class=&quot;nf&quot;&gt;drawIntoCanvas&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;canvas&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;n&quot;&gt;canvas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;saveLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;layerRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;layerPaint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                        &lt;span class=&quot;c1&quot;&gt;// 두 줄기 광선 + 무지개 색조(Hue)&lt;/span&gt;
                        &lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;forwardBeamBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rainbowBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Hue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;nf&quot;&gt;drawRect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brush&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counterBeamBrush&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Softlight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.85f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                        &lt;span class=&quot;c1&quot;&gt;// 금속 호일 노이즈(Screen)&lt;/span&gt;
                        &lt;span class=&quot;nf&quot;&gt;drawImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;grainBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Screen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.25f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                        &lt;span class=&quot;c1&quot;&gt;// 캐릭터 실루엣 마스킹(DstIn: 캐릭터를 뚫고 배경 포일만 남김)&lt;/span&gt;
                        &lt;span class=&quot;nf&quot;&gt;drawImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;maskBitmap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dstSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blendMode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BlendMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;DstIn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                        &lt;span class=&quot;n&quot;&gt;canvas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;restore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;5-주의할-점-성능-최적화&quot;&gt;5. 주의할 점 (성능 최적화)&lt;/h2&gt;

&lt;p&gt;Compose에서 부드러운 렌더링 성능을 유지하기 위한 최적화하가 중요합니다&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;리컴포지션 방지 (람다 기반 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;graphicsLayer&lt;/code&gt;)&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;틸트 각도는 초당 수십 번 변경됩니다. 상태를 Composable 상단에서 읽지 않고 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;graphicsLayer { ... }&lt;/code&gt; 및 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;onDrawWithContent { ... }&lt;/code&gt; 람다 블록 내부에서 읽어야 Composition 단계를 건너뛰고 GPU Drawing 단계에서만 빠르게 렌더링되어 프레임 드랍을 원천적으로 차단합니다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;비트맵 디코딩 중복 방지&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;카드, 마스크, 그레인 등의 비트맵 리소스는 매 프레임 호출되는 드로잉 루프 내부가 아닌 컴포저블 본문에서 로드(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ImageBitmap.imageResource&lt;/code&gt;)하여 불필요한 I/O와 GC 부하를 방지합니다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;오프스크린 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;saveLayer&lt;/code&gt; 호출 최소화&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;saveLayer&lt;/code&gt;는 임시 버퍼를 생성하므로 GPU 메모리 대역폭을 소모합니다. 포일 합성 및 마스킹 작업을 단일 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;saveLayer&lt;/code&gt; 블록 내에서 블렌드 모드 체인으로 처리하여 오프스크린 패스를 1회로 최소화해야 합니다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;6-렌더링-방식별-비교-compose-vs-agsl-vs-opengl&quot;&gt;6. 렌더링 방식별 비교 (Compose vs AGSL vs OpenGL)&lt;/h2&gt;

&lt;p&gt;본 글에서는 &lt;strong&gt;Compose의 기본 그래픽 API&lt;/strong&gt;(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;graphicsLayer&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Brush&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DrawScope&lt;/code&gt;)를 활용해 카드 홀로그램 효과를 구현했습니다. 하지만 안드로이드 플랫폼에서는 프로젝트 타깃 환경, 최소 지원 SDK, 성능 요구 사항에 따라 &lt;strong&gt;AGSL (Android Graphics Shading Language)&lt;/strong&gt;이나 &lt;strong&gt;OpenGL ES&lt;/strong&gt;를 선택할 수도 있습니다.&lt;/p&gt;

&lt;p&gt;루기아 V 카드를 기준으로 세 가지 렌더링 엔진의 결과물과 기술적 특징을 비교하면 다음과 같습니다.&lt;/p&gt;

&lt;h3 id=&quot;-렌더링-결과물-비교&quot;&gt;① 렌더링 결과물 비교&lt;/h3&gt;

&lt;div class=&quot;video-compare-grid&quot;&gt;
  &lt;div style=&quot;flex: 1; min-width: 0;&quot;&gt;
    &lt;p style=&quot;font-weight: bold; margin-bottom: 6px;&quot;&gt;Compose&lt;/p&gt;
    &lt;div class=&quot;youtube&quot; style=&quot;padding-top: 124.4%;&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/8V4rvGXGALc&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;flex: 1; min-width: 0;&quot;&gt;
    &lt;p style=&quot;font-weight: bold; margin-bottom: 6px;&quot;&gt;AGSL&lt;/p&gt;
    &lt;div class=&quot;youtube&quot; style=&quot;padding-top: 124.4%;&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/NkA1gGg5MqA&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;flex: 1; min-width: 0;&quot;&gt;
    &lt;p style=&quot;font-weight: bold; margin-bottom: 6px;&quot;&gt;OpenGL ES&lt;/p&gt;
    &lt;div class=&quot;youtube&quot; style=&quot;padding-top: 124.4%;&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/RiyjKHSLRtE&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;-기술적-특징-및-장단점-비교&quot;&gt;② 기술적 특징 및 장단점 비교&lt;/h3&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;비교 항목&lt;/th&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Jetpack Compose (DrawScope)&lt;/th&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;AGSL (RuntimeShader)&lt;/th&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;OpenGL ES (GLSurfaceView)&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;최소 지원 OS&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;Android 5.0 (API 21+)&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;Android 13 (API 33+)&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;Android 4.3+ (ES 3.0)&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;작성 언어&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Kotlin (100% 순수 코드)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Kotlin + AGSL (SkSL)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Kotlin + GLSL 3.0&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;렌더링 파이프라인&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Compose Canvas (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;drawWithCache&lt;/code&gt;)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Compose Canvas (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShaderBrush&lt;/code&gt;)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GLSurfaceView&lt;/code&gt; 전용 렌더 스레드&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;GPU 패스 방식&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;캔버스 다중 레이어 블렌딩 (Multi-pass)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;단일 프래그먼트 셰이더 (Single-pass)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;단일/멀티 패스 프래그먼트 셰이더&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;구현 난이도&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;낮음&lt;/strong&gt; (기존 Compose 지식 활용)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;보통&lt;/strong&gt; (셰이더 문법 학습 필요)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;높음&lt;/strong&gt; (EGL 수명주기, VBO/VAO 관리)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;Compose UI 통합성&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;완벽&lt;/strong&gt; (Modifier, 애니메이션, 클리핑 자연 연동)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;우수&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShaderBrush&lt;/code&gt;로 인라인 결합)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;보통&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AndroidView&lt;/code&gt; 브릿징 필요)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;수학적 픽셀 연산 자유도&lt;/strong&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;보통 (Compose Brush / Filter 조합)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;높음&lt;/strong&gt; (픽셀 단위 알고리즘 자유 구현)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;최상&lt;/strong&gt; (완전한 하드웨어 파이프라인 제어)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;7-결론&quot;&gt;7. 결론&lt;/h2&gt;

&lt;p&gt;카드 홀로그램의 핵심은 복잡한 수학 공식이 아니라, &lt;strong&gt;반응하는 3D 틸트&lt;/strong&gt;와 &lt;strong&gt;캐릭터를 돋보이게 하는 마스킹&lt;/strong&gt;, 그리고 &lt;strong&gt;빛줄기가 교차하며 만들어내는 연출&lt;/strong&gt;에 있습니다.&lt;/p&gt;

&lt;p&gt;Compose의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;graphicsLayer&lt;/code&gt;와 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DrawScope&lt;/code&gt; 블렌딩 API를 활용하면 셰이더 없이도 간단하면서도 인터랙티브 카드를 만들 수 있습니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;참고-자료&quot;&gt;참고 자료&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://developer.android.com/develop/ui/compose/graphics/draw/modifiers&quot;&gt;Android Developers — Compose Graphics &amp;amp; Modifiers&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/GraphicsLayerScope&quot;&gt;Android Developers — GraphicsLayer Documentation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://poke-holo.simey.me/&quot;&gt;poke-holo by simeydotme&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sat, 17 Oct 2026 09:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/2026/10/17/compose-card-hologram/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/2026/10/17/compose-card-hologram/</guid>
        
        <category>Android</category>
        
        <category>Compose</category>
        
        <category>UI</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
      </item>
    
      <item>
        <title>Blog: Jetpack Compose에서 PinnableContainer로 아이템 유지하기</title>
        <description>&lt;p&gt;LazyColumn에서 UI 상태를 변경(예 : 아이템을 펼치거나 포커스)한 후 스크롤하면, 화면 밖으로 이동한 아이템의 composition이 제거될 수 있습니다. 추가 처리가 없다면 다시 아이템이 노출되었을 때 UI가 초기화되는 문제가 발생합니다.&lt;/p&gt;

&lt;p&gt;재생 중인 미디어·포커스를 가진 입력창·펼쳐진 상세 영역처럼 화면 밖으로 이동해도 composition을 유지해야 하는 아이템인 경우 더욱 처리가 필요합니다.&lt;/p&gt;

&lt;p&gt;이 글에서는 이런 상황을 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;로 처리하는 방법을 소개합니다.&lt;/p&gt;

&lt;!--more--&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/0816/pinnable-container-overview.svg&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;1-pinnablecontainer란&quot;&gt;1. PinnableContainer란?&lt;/h2&gt;

&lt;p&gt;Lazy 아이템의 UI를 유지해야 하는 상황이 생기면 보통 다음 방법부터 생각합니다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;입력값이나 펼침 상태를 rememberSaveable 또는 ViewModel로 올립니다.&lt;/li&gt;
  &lt;li&gt;아이템을 LazyList 밖으로 옮기거나 별도 overlay로 구성합니다.&lt;/li&gt;
  &lt;li&gt;key를 지정해 데이터가 바뀌어도 같은 아이템의 상태를 유지합니다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;각 방법은 목적이 다릅니다. rememberSaveable과 ViewModel은 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;상태를 보존&lt;/code&gt;하는 방법이고, LazyList 밖으로 UI를 옮기는 방식은 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;화면에 계속 노출&lt;/code&gt;하는 방법입니다. key는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;아이템 identity를 유지&lt;/code&gt;하지만 화면 밖으로 이동한 아이템의 composition dispose를 막지는 않습니다.&lt;/p&gt;

&lt;p&gt;하지만 현재 포커스, 실행 중인 effect, 재생 중인 미디어처럼 &lt;strong&gt;UI의 composition 자체를 유지해야 하는 경우&lt;/strong&gt;에는 위 방법만으로 해결되지 않을 수 있습니다. 이때 Lazy layout에 해당 아이템을 당분간 유지해야 한다고 알려주는 방법이 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;입니다. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;는 콘텐츠를 유지해야 하는 동안 컨테이너를 pin할 수 있도록 정의한 API입니다. LazyList에서 &lt;strong&gt;PinnableContainer를 사용하면 아이템이 viewport 밖으로 이동해도 dispose되지 않습니다.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;예를 들어 다음과 같은 아이템에 사용할 수 있습니다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;재생 중인 오디오나 비디오를 가지는 Row&lt;/li&gt;
  &lt;li&gt;키보드 포커스를 가진 TextField&lt;/li&gt;
  &lt;li&gt;펼쳐진 상세 패널이나 메뉴&lt;/li&gt;
  &lt;li&gt;드래그 중인 Row&lt;/li&gt;
  &lt;li&gt;접근성 포커스 또는 화면 밖에서도 유지해야 하는 일시적 UI를 처리하는 Row&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PinnableContainer는 아이템을 화면에 계속 표시하거나 목록 위치를 고정하는 API가 아닙니다. 현재 composition을 유지해야 한다는 사실을 전달하는 역할을 합니다.&lt;/p&gt;

&lt;h3 id=&quot;lazylist에서만-사용할-수-있는가&quot;&gt;LazyList에서만 사용할 수 있는가?&lt;/h3&gt;

&lt;p&gt;API 이름에는 Container가 들어가지만, 일반적인 Column이나 Row를 위한 API는 아닙니다. AndroidX API 문서에서는 LazyList의 각 아이템을 하나의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;로 설명합니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;For example, each item of lazy list represents one PinnableContainer, and if this container is pinned, this item will not be disposed when scrolled out of the viewport.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;따라서 LazyColumn이나 LazyRow처럼 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LocalPinnableContainer&lt;/code&gt;를 제공하는 LazyLayout의 아이템 안에서 사용하는 것이 간단한 사례입니다. 일반적인 &lt;strong&gt;Column&lt;/strong&gt; 바깥에서는 같은 컨테이너가 제공되지 않으므로 직접 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;를 만들어 CompositionLocal에 주입하는 방식도 가능해 보입니다.&lt;/p&gt;

&lt;h2 id=&quot;2-pinnablecontainer의-기본-사용-방법&quot;&gt;2. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;의 기본 사용 방법&lt;/h2&gt;

&lt;p&gt;API 기준으로 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;는 다음과 같습니다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;PinnableContainer: 콘텐츠를 유지해야 하는 동안 pin할 수 있는 컨테이너입니다.&lt;/li&gt;
  &lt;li&gt;pin(): 컨테이너를 pin하고 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnedHandle&lt;/code&gt;을 반환&lt;/li&gt;
  &lt;li&gt;PinnedHandle: pin을 해제할 때 사용하는 핸들&lt;/li&gt;
  &lt;li&gt;release(): pin을 해제한 이후 LazyLayout은 화면 밖으로 벗어난 아이템을 dispose할 수 있습니다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;대표적인 사용 사례는 현재 포커스를 가진 LazyList 아이템을 pin하는 것입니다. 아이템이 화면 밖으로 이동해도 포커스를 잃지 않도록 composition 수명을 유지할 수 있습니다. 포커스가 해제되거나 콘텐츠를 더 이상 유지할 필요가 없어지면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnedHandle.release()&lt;/code&gt;를 호출해야 합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/0816/pin-lifecycle.svg&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;기본-코드&quot;&gt;기본 코드&lt;/h3&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;PinWhileNeeded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shouldKeep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Boolean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;container&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;LocalPinnableContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;

   &lt;span class=&quot;nc&quot;&gt;DisposableEffect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;container&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shouldKeep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;handle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shouldKeep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;container&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;

      &lt;span class=&quot;nf&quot;&gt;onDispose&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;handle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;release&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Composable에서 pin과 release를 나누어 작성하면 해제 시점을 놓치기 쉽습니다. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pin()&lt;/code&gt;이 반환하는 핸들의 수명을 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DisposableEffect&lt;/code&gt;에 맞춰 관리하는 방식이 적합합니다.&lt;/p&gt;

&lt;h2 id=&quot;3-localpinnablecontainer-상세-설명&quot;&gt;3. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LocalPinnableContainer&lt;/code&gt; 상세 설명&lt;/h2&gt;

&lt;h3 id=&quot;1-local은-전역-싱글톤이-아닙니다&quot;&gt;1) Local은 전역 싱글톤이 아닙니다&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LocalPinnableContainer&lt;/code&gt;의 타입은 다음과 같은 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CompositionLocal&lt;/code&gt;입니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;LocalPinnableContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
   &lt;span class=&quot;nc&quot;&gt;ProvidableCompositionLocal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;PinnableContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;앱 전체에 하나만 존재하는 전역 컨테이너를 가져오는 API가 아닙니다. 현재 Composable이 속한 Composition 트리에서 가장 가까운 provider가 제공하는 값을 읽습니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SimplePinnableItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;container&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;LocalPinnableContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;2-lazylayout과-같이-아이템-재활용에-적합&quot;&gt;2) LazyLayout과 같이 아이템 재활용에 적합&lt;/h3&gt;

&lt;p&gt;LazyList의 각 item이 하나의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;에 해당합니다. 따라서 다음 코드처럼 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;items { ... }&lt;/code&gt; 내부에서 SimplePinnableItem을 호출하면 SimplePinnableItem 하위 트리의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LocalPinnableContainer.current&lt;/code&gt;가 해당 item 컨테이너를 가리킵니다. 이 컨테이너를 pin하면 item이 viewport 밖으로 나가도 dispose되지 않습니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;LazyColumn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;nf&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;items&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;demoItems&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;contentType&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;simple&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;// item slot 하위에서 호출&lt;/span&gt;
      &lt;span class=&quot;nc&quot;&gt;SimplePinnableItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expandedId&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;onToggleExpanded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;LazyColumn 바깥의 화면 공통 헤더에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LocalPinnableContainer.current&lt;/code&gt;를 읽으면 컨테이너가 제공되지 않습니다. 특정 Lazy item의 하위 Composition이 아니기 때문입니다. 판단 기준은 함수 이름이 아니라 Composition 트리의 위치입니다.&lt;/p&gt;

&lt;h3 id=&quot;3-current와-pin의-차이&quot;&gt;3) &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;current&lt;/code&gt;와 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pin()&lt;/code&gt;의 차이&lt;/h3&gt;

&lt;p&gt;두 API를 분리해서 이해하면 수명 관리 흐름을 쉽게 파악할 수 있습니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 현재 하위 트리의 컨테이너를 조회&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;container&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;LocalPinnableContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 해당 컨테이너를 유지 필요 상태로 표시하고 PinnedHandle 반환&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;handle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;container&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 상태 종료를 알림&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;handle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;release&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;current&lt;/code&gt;를 읽는 것만으로 item이 유지되는 것은 아닙니다. 반드시 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pin()&lt;/code&gt;을 호출해 handle을 만들고, 이후 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;release()&lt;/code&gt;해야 합니다. AndroidX API 문서도 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pin()&lt;/code&gt;이 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnedHandle&lt;/code&gt;을 반환하며, 유지할 필요가 없어지면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;release()&lt;/code&gt;를 호출해야 한다고 명시되어 있습니다.&lt;/p&gt;

&lt;h2 id=&quot;4-단순-예제-펼쳐진-lazy-아이템-유지하기&quot;&gt;4. 단순 예제: 펼쳐진 Lazy 아이템 유지하기&lt;/h2&gt;

&lt;p&gt;단순 예제에서는 한 번에 하나의 아이템만 펼치는 목록을 사용합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SimplePinDemo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;expandedId&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;by&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;rememberSaveable&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mutableStateOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&amp;gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

   &lt;span class=&quot;nc&quot;&gt;LazyColumn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nf&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;items&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;demoItems&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;contentType&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;simple&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;isExpanded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expandedId&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;
         &lt;span class=&quot;nc&quot;&gt;SimplePinnableItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;onToggleExpanded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;n&quot;&gt;expandedId&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;아이템 UI와 pin 수명은 별도 Composable로 분리합니다. Lambda는 상태 연결만 담당합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SimplePinnableItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;DemoItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Boolean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;onToggleExpanded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Unit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;nc&quot;&gt;PinWhileNeeded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;itemId&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;shouldKeep&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

   &lt;span class=&quot;nc&quot;&gt;Card&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;animateContentSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nc&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;nc&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;상세 내용&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;nc&quot;&gt;TextButton&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;onClick&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;onToggleExpanded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;접기&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;펼치기&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;pin 수명을 관리하는 Helper 함수는 다음과 같습니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;PinWhileNeeded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;itemId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;shouldKeep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Boolean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;container&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;LocalPinnableContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;

   &lt;span class=&quot;nc&quot;&gt;DisposableEffect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;container&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;itemId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shouldKeep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;handle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shouldKeep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;container&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;also&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;PinnableDemo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;PIN key=$itemId&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

      &lt;span class=&quot;nf&quot;&gt;onDispose&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;handle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;release&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;handle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;PinnableDemo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;RELEASE key=$itemId&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shouldKeep&lt;/code&gt;이 false → true가 되면 &lt;strong&gt;PIN&lt;/strong&gt; 로그와 함께 handle을 만들고, true → false가 되면 기존 effect가 dispose되면서 &lt;strong&gt;RELEASE&lt;/strong&gt; 로그를 출력합니다. 아이템 자체가 dispose되는 경우에도 onDispose가 실행되므로 해제 경로가 한 곳에 모입니다.&lt;/p&gt;

&lt;h3 id=&quot;왜-disposableeffect인가&quot;&gt;왜 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DisposableEffect&lt;/code&gt;인가?&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pin()&lt;/code&gt;을 호출하면 아이템을 유지하는 동안 사용할 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnedHandle&lt;/code&gt;이 반환됩니다. 이 핸들을 보관하고 있다가 더 이상 아이템을 유지할 필요가 없어지는 시점에 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;release()&lt;/code&gt;를 호출하면 pin이 해제됩니다.&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;유지 필요  →  handle 생성  →  아이템 수명 연장
유지 불필요/Composition 종료  →  handle.release()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;아이템을 더 이상 유지할 필요가 없어져 effect가 다시 실행될 때도, 아이템이 composition에서 사라질 때도 onDispose에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;release()&lt;/code&gt;가 호출됩니다.&lt;/p&gt;

&lt;h2 id=&quot;5-동작-확인&quot;&gt;5. 동작 확인&lt;/h2&gt;

&lt;p&gt;앱을 실행한 뒤 다음 순서로 확인합니다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;목록에서 아이템 하나를 펼칩니다.&lt;/li&gt;
  &lt;li&gt;아이템이 viewport 밖으로 나가도록 빠르게 스크롤합니다.&lt;/li&gt;
  &lt;li&gt;다시 돌아와 상세 영역이 유지되는지 확인합니다.&lt;/li&gt;
  &lt;li&gt;Android Studio Logcat에서 PinnableDemo 태그를 필터링합니다.&lt;/li&gt;
  &lt;li&gt;다시 빠르게 스크롤해 PIN/RELEASE와 ENTER/DISPOSE 로그를 비교합니다.&lt;/li&gt;
  &lt;li&gt;펼친 아이템을 화면 밖으로 보낸 뒤 DISPOSE가 지연되는지 확인합니다.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;유지-필요-상태&quot;&gt;유지 필요 상태&lt;/h3&gt;

&lt;p&gt;key=0을 펼치면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shouldKeep&lt;/code&gt;이 true가 되면서 먼저 PIN 로그가 출력됩니다. 이후 화면 밖으로 스크롤해도 key=0의 DISPOSE 로그가 바로 출력되지 않습니다. 화면에 보이지 않는 다른 아이템은 먼저 dispose될 수 있습니다.&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PinnableDemo: ENTER key=0
PinnableDemo: PIN key=0
PinnableDemo: ENTER key=1
PinnableDemo: DISPOSE key=1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;다시 아이템으로 돌아와 펼침을 해제하면 RELEASE 로그가 출력됩니다. 아이템이 화면 밖에 남아 있다면 이후 DISPOSE가 출력될 수 있습니다.&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PinnableDemo: RELEASE key=0
PinnableDemo: DISPOSE key=0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;유지-불필요-상태&quot;&gt;유지 불필요 상태&lt;/h3&gt;

&lt;p&gt;아이템을 펼치지 않은 상태에서는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shouldKeep&lt;/code&gt;이 false이므로 PIN 로그가 출력되지 않습니다. 이 아이템을 화면 밖으로 스크롤하면 다음처럼 DISPOSE가 출력될 수 있습니다.&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PinnableDemo: ENTER key=2
PinnableDemo: DISPOSE key=2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;실제 출력 순서와 key 값은 스크롤 속도와 viewport에 따라 달라질 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/0816/pin-log-comparison.svg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;개발 중에는 &lt;strong&gt;PIN&lt;/strong&gt;과 &lt;strong&gt;RELEASE&lt;/strong&gt; 로그를 함께 확인합니다. 기대하는 결과는 “유지 필요 상태로 전환될 때마다 &lt;strong&gt;PIN&lt;/strong&gt; 하나, 유지할 필요가 없어질 때마다 &lt;strong&gt;RELEASE&lt;/strong&gt; 하나”입니다. &lt;strong&gt;PIN&lt;/strong&gt;만 계속 증가하고 &lt;strong&gt;RELEASE&lt;/strong&gt;가 따라오지 않는다면 handle 수명이 잘못 관리되고 있을 가능성이 있습니다.&lt;/p&gt;

&lt;h2 id=&quot;6-재활용되는지-확인하는-방법&quot;&gt;6. 재활용되는지 확인하는 방법&lt;/h2&gt;

&lt;p&gt;Compose의 LazyList에는 RecyclerView의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;onViewRecycled()&lt;/code&gt;와 같은 콜백이 없습니다. Compose에서 확인해야 하는 대상은 View의 재활용이 아니라 다음 세 가지입니다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;key&lt;/code&gt;: 같은 논리 아이템인지 식별&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;contentType&lt;/code&gt;: 같은 구조의 아이템끼리 composition을 재사용 가능&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DisposableEffect&lt;/code&gt;: 아이템 composition이 생성되고 dispose되는 시점을 관찰&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;따라서 ENTER가 출력됐다고 바로 재활용이 발생했다고 판단하면 안 됩니다. 이전 composition이 dispose된 뒤 같은 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;key&lt;/code&gt;의 아이템이 다시 ENTER되는지, 또는 기존 composition이 유지되는지를 함께 봐야 합니다.&lt;/p&gt;

&lt;p&gt;모든 item의 구조가 같으므로 stable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;key&lt;/code&gt;와 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;contentType&lt;/code&gt;을 함께 지정합니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nf&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;items&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;demoItems&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;contentType&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;simple&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;nc&quot;&gt;SimplePinnableItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;isExpanded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expandedId&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;onToggleExpanded&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;SimplePinnableItem에는 composition 수명을 확인하는 로그를 넣었습니다. PinWhileNeeded에는 pin 상태를 확인하는 로그를 추가했습니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;DisposableEffect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;nc&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;PinnableDemo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;ENTER key=${item.id}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;nf&quot;&gt;onDispose&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nc&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;PinnableDemo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;DISPOSE key=${item.id}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PIN key=0
RELEASE key=0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Android Studio의 Logcat에서 PinnableDemo 태그를 필터링한 다음 목록을 빠르게 스크롤합니다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ENTER key=…: 해당 item composition이 생성된 시점&lt;/li&gt;
  &lt;li&gt;PIN key=…: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pin()&lt;/code&gt;이 호출된 시점&lt;/li&gt;
  &lt;li&gt;RELEASE key=…: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnedHandle.release()&lt;/code&gt;가 호출된 시점&lt;/li&gt;
  &lt;li&gt;DISPOSE key=…: 해당 item composition이 종료된 시점&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;펼친 item을 화면 밖으로 스크롤했는데 &lt;strong&gt;DISPOSE&lt;/strong&gt;가 나오지 않으면 pin이 살아 있는 동안 composition이 유지된 것입니다.&lt;/p&gt;

&lt;p&gt;펼침을 해제한 뒤 &lt;strong&gt;RELEASE&lt;/strong&gt;가 출력되고, 아이템이 화면 밖에 있다면 이후 &lt;strong&gt;DISPOSE&lt;/strong&gt;가 출력될 수 있습니다.&lt;/p&gt;

&lt;p&gt;이 로그는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;재구성(recomposition)&lt;/code&gt;과 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;composition 종료(dispose)&lt;/code&gt;를 구분하는 데 사용합니다. 단순히 화면이 다시 그려졌다고 item이 재활용되거나 dispose되는 것은 아닙니다. 또한 &lt;strong&gt;key&lt;/strong&gt;는 데이터 상태가 다른 item으로 잘못 이동하지 않게 하는 기준이고, &lt;strong&gt;contentType&lt;/strong&gt;은 동일한 구조의 item끼리 composition 재사용을 최적화하는 힌트입니다.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LazyList&lt;/strong&gt;는 화면에 다시 들어올 가능성이 있는 아이템을 잠시 유지할 수 있으므로, &lt;strong&gt;RELEASE&lt;/strong&gt; 직후 &lt;strong&gt;DISPOSE&lt;/strong&gt;가 항상 즉시 출력되는 것은 아닙니다. 이 로그는 재활용 횟수를 세는 지표가 아니라, 특정 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;key&lt;/code&gt;의 composition과 pin 핸들 수명을 확인하는 용도로 사용하는 것이 정확합니다.&lt;/p&gt;

&lt;p&gt;재활용 여부는 하나의 카운터보다 &lt;strong&gt;key&lt;/strong&gt;, &lt;strong&gt;contentType&lt;/strong&gt;, &lt;strong&gt;PIN/RELEASE&lt;/strong&gt;, &lt;strong&gt;ENTER/DISPOSE&lt;/strong&gt; 로그를 함께 확인하는 편이 정확합니다.&lt;/p&gt;

&lt;h2 id=&quot;7-pin의-경계선&quot;&gt;7. pin의 경계선&lt;/h2&gt;

&lt;h3 id=&quot;pin이-보장하는-것&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pin&lt;/code&gt;이 보장하는 것&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;가 연결된 lazy 아이템이라면 pin이 살아 있는 동안 viewport 밖으로 나간 아이템을 즉시 dispose하지 않도록 lazy layout에 신호를 보냅니다. 따라서 재생 중인 row의 composition이나 포커스가 남아 있어야 하는 입력 row처럼 현재 UI 작업이 끝나지 않은 내용을 보호할 수 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;pin이-보장하지-않는-것&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pin&lt;/code&gt;이 보장하지 않는 것&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;화면에 아이템을 계속 표시하지 않습니다.&lt;/li&gt;
  &lt;li&gt;목록 위치를 저장하지 않습니다.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;remember&lt;/code&gt; 상태를 프로세스 종료 후 복원하지 않습니다.&lt;/li&gt;
  &lt;li&gt;네트워크 캐시나 데이터베이스를 대체하지 않습니다.&lt;/li&gt;
  &lt;li&gt;무제한으로 많은 아이템을 유지해도 안전하다는 뜻이 아닙니다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;프로세스 복원이나 화면 회전 후에도 값을 보존해야 한다면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rememberSaveable&lt;/code&gt;, ViewModel, 저장소 등을 별도로 사용해야 합니다. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;는 현재 composition 수명에 관한 힌트입니다.&lt;/p&gt;

&lt;h2 id=&quot;8-pinnablecontainer와-retain의-차이&quot;&gt;8. PinnableContainer와 retain의 차이&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;retain&lt;/code&gt;은 Composable이 Composition에서 잠시 제거됐다가 다시 추가될 때, 특정 객체나 값을 다시 사용할 수 있도록 보관하는 API입니다. 화면에 아이템을 계속 남겨 두거나 아이템의 composition 자체를 유지하는 기능은 아닙니다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;와 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;retain&lt;/code&gt;은 둘 다 Composable의 수명과 관련된 기능처럼 보이지만, 유지하는 대상과 목적이 다릅니다.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;구분&lt;/th&gt;
      &lt;th&gt;PinnableContainer&lt;/th&gt;
      &lt;th&gt;retain&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;목적&lt;/td&gt;
      &lt;td&gt;Lazy 아이템의 composition 유지&lt;/td&gt;
      &lt;td&gt;composition에서 잠시 제거된 값 유지&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;대상&lt;/td&gt;
      &lt;td&gt;Lazy layout의 아이템&lt;/td&gt;
      &lt;td&gt;객체, 상태, 리소스&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;사용 위치&lt;/td&gt;
      &lt;td&gt;LocalPinnableContainer.current&lt;/td&gt;
      &lt;td&gt;retain { … }&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;동작&lt;/td&gt;
      &lt;td&gt;viewport 밖으로 나가도 아이템을 dispose하지 않음&lt;/td&gt;
      &lt;td&gt;Composable이 제거됐다가 다시 생성될 때 기존 값을 재사용&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;수명 종료&lt;/td&gt;
      &lt;td&gt;PinnedHandle.release()&lt;/td&gt;
      &lt;td&gt;RetainedValuesStore가 값을 retire할 때&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;대표 사례&lt;/td&gt;
      &lt;td&gt;포커스, 펼침, 드래그, 재생 중인 아이템&lt;/td&gt;
      &lt;td&gt;Navigation back stack, configuration change, 일시적으로 제거되는 UI&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;사용-방법-비교&quot;&gt;사용 방법 비교&lt;/h3&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Lazy 아이템 자체를 화면 밖에서도 유지&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;handle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;LocalPinnableContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 유지할 필요가 없어지면 해제&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;handle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;release&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Composable이 일시적으로 제거됐다가 다시 생성될 때 값 재사용&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;player&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;retain&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;nc&quot;&gt;MediaPlayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mediaUri&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;어떤-api를-선택할까&quot;&gt;어떤 API를 선택할까?&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;화면 밖으로 이동해도 아이템의 UI와 composition이 살아 있어야 한다면 =&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Composable은 제거될 수 있지만, 다시 생성될 때 특정 객체나 값을 재사용해야 한다면 =&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;retain&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;프로세스 종료 후에도 상태를 복원해야 한다면 =&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rememberSaveable&lt;/code&gt; 또는 ViewModel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;retain&lt;/code&gt;은 UI를 화면에 계속 표시하지 않으며, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;처럼 Lazy 아이템의 dispose를 막는 API도 아닙니다. 반대로 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;는 값을 configuration change나 Composition 재생성 이후까지 보존하는 API가 아닙니다.&lt;/p&gt;

&lt;p&gt;또한 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;retain&lt;/code&gt;으로 보관한 값은 Composable보다 오래 유지될 수 있습니다. Context, View, 또는 이를 간접적으로 참조하는 객체를 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;retain&lt;/code&gt;하면 메모리 누수가 발생할 수 있으므로 보관 대상에 주의해야 합니다.&lt;/p&gt;

&lt;h2 id=&quot;9-주의할-점&quot;&gt;9. 주의할 점&lt;/h2&gt;

&lt;h3 id=&quot;1-release를-빼먹는-경우&quot;&gt;1) &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;release()&lt;/code&gt;를 빼먹는 경우&lt;/h3&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 좋지 않은 예: pin은 만들지만 해제하지 않음&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;handle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;LocalPinnableContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;이 코드는 아이템을 계속 유지해야 한다고 잘못 알려 줄 수 있습니다. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DisposableEffect&lt;/code&gt;의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;onDispose&lt;/code&gt; 또는 명확한 lifecycle callback에서 반드시 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;release()&lt;/code&gt;해야 합니다.&lt;/p&gt;

&lt;h3 id=&quot;2-모든-아이템을-pin하는-경우&quot;&gt;2) 모든 아이템을 pin하는 경우&lt;/h3&gt;

&lt;p&gt;pin은 유지해야 할 이유가 있을 때만 사용해야 합니다. 모든 행을 pin하면 lazy layout의 메모리 절약 효과를 스스로 없애게 됩니다. 특히 이미지, 플레이어, 애니메이션, 큰 입력 UI가 들어간 행은 비용이 빠르게 커질 수 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;3-보이고-싶다와-살아-있어야-한다를-혼동하는-경우&quot;&gt;3) “보이고 싶다”와 “살아 있어야 한다”를 혼동하는 경우&lt;/h3&gt;

&lt;p&gt;사용자가 스크롤해도 아이템이 화면에 남아 있어야 한다면 sticky header, 별도 overlay, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LazyListState&lt;/code&gt; 기반의 UI 이동 등 다른 방법을 사용해야 합니다. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;는 보이지 않는 순간에도 composition을 유지할 필요가 있는 경우에 적합합니다.&lt;/p&gt;

&lt;h3 id=&quot;4-composition-유지와-데이터-상태를-같은-것으로-생각하는-경우&quot;&gt;4) composition 유지와 데이터 상태를 같은 것으로 생각하는 경우&lt;/h3&gt;

&lt;p&gt;pin은 composition dispose를 늦춥니다. 앱의 핵심 상태를 item composition 안의 일반 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;remember&lt;/code&gt;에만 맡기지 말고, 오래 보존해야 하는 상태는 ViewModel이나 적절한 state holder로 끌어올려야 합니다.&lt;/p&gt;

&lt;h2 id=&quot;10-결론&quot;&gt;10. 결론&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PinnableContainer&lt;/code&gt;는 작은 수명 관리 도구입니다. 판단 기준은 하나입니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“이 lazy 아이템이 지금 화면 밖으로 나가도 composition을 잃으면 안 되는가?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;그렇다면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LocalPinnableContainer.current?.pin()&lt;/code&gt;으로 유지 필요 상태를 표시하고, 더 이상 유지할 필요가 없어지는 순간 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;release()&lt;/code&gt;해야 합니다. key, contentType, DisposableEffect 로그를 함께 사용하면 LazyList의 item identity와 composition 수명을 직접 확인할 수 있습니다.&lt;/p&gt;

&lt;h2 id=&quot;참고-자료&quot;&gt;참고 자료&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/PinnableContainer&quot;&gt;PinnableContainer API reference&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/PinnableContainer.PinnedHandle&quot;&gt;PinnableContainer.PinnedHandle API reference&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/runtime/retain/retain.composable&quot;&gt;retain API reference&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/package-summary&quot;&gt;Compose UI layout API — LocalPinnableContainer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sun, 16 Aug 2026 09:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/2026/08/16/pinnable-container/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/2026/08/16/pinnable-container/</guid>
        
        <category>Android</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
      </item>
    
      <item>
        <title>Blog: [요약] What&apos;s new in Android (Google I/O &apos;26)</title>
        <description>&lt;div class=&quot;youtube&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/8PxuWdjESfg&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;!--more--&gt;

&lt;hr /&gt;

&lt;h1 id=&quot;compose-first&quot;&gt;Compose First&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;https://developer.android.com/static/develop/ui/compose/images/compose-first.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Compose는 Android UI 개발의 표준으로 성숙&lt;/li&gt;
  &lt;li&gt;모든 안드로이드 UI를 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Jetpack Compose&lt;/code&gt;로 구축하는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Compose First&lt;/code&gt; 원칙을 발표&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;goo.gle/compose-first&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;이후 모든 API, 라이브러리, Tool, 가이드는 Compose로 제공된다. 기존 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;View 컴포넌트(Fragment, RecyclerView, Material View 컴포넌트 등)는 유지 보수 모드로 전환&lt;/code&gt;되며, 앞으로 새로운 기능 추가 없이 버그 수정만 제공된다고 한다.
    &lt;ul&gt;
      &lt;li&gt;당장 View 컴포넌트를 지원 중단(Deprecated)하거나 제거할 계획은 없음&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;compose로-마이그레이션&quot;&gt;Compose로 마이그레이션&lt;/h2&gt;

&lt;p&gt;XML을 Compose로 변환을 돕는 Skill외에도 Android Studio에 기능을 준비 중이다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;프로젝트 정보를 기반으로 AI 에이전트로 UI 변화가 이루어짐&lt;/li&gt;
  &lt;li&gt;레이아웃이 참조하는 스타일, 리소스를 확인한 후 마이그레이션 전후를 비교할 수 있는 스크린샷 데스트를 생성해 줌&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;compose-111&quot;&gt;Compose 1.11&lt;/h2&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/01.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Compose 1.10 및 1.11에서 Retain, 테스트 API, SharedTransitionLayout, 새로운 TextField 기능이 추가되었다.&lt;/p&gt;

&lt;h2 id=&quot;new-styles-api&quot;&gt;New Styles API&lt;/h2&gt;

&lt;p&gt;컴포넌트의 스타일 특성을 표준화된 세트로 정의해 컴포넌트의 동작과 외관을 분리되었다. 컴포넌트 스타일을 쉽게 커스텀 할 수 있을 것이다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/02.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;상태 지원&lt;/li&gt;
  &lt;li&gt;상태 변경 애니메이션&lt;/li&gt;
  &lt;li&gt;성능 최적화가 적용되어 Recomposition을 최소화&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;향후 Material 컴포넌트에도 Style 지원 계획이다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Styles in Compose : https://developer.android.com/develop/ui/compose/styles&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/03.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;hero-benchmarks&quot;&gt;Hero benchmarks&lt;/h3&gt;

&lt;p&gt;최신 Compose 1.11에서는 스크롤 버벅임(Jank), Startup, View와 Compose가 공존하는 하이브리드 UI 성능이 향상되었다.&lt;/p&gt;

&lt;p&gt;실제 앱 성능을 비교하는 새로운 벤치마크 제품을 오픈소스로 출시&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Hero benchmarks: http://goo.gle/hero-benchmark&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;성능-최적화-및-디버깅-도구&quot;&gt;성능 최적화 및 디버깅 도구&lt;/h1&gt;

&lt;h2 id=&quot;r8-configuration-analyzer&quot;&gt;R8 configuration analyzer&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;새로운 R8 인사이트 도구를 Play console에 순차적으로 출시 예정&lt;/li&gt;
  &lt;li&gt;Android Studio에서도 확인할 수 있는 R8 configuration analyzer를 출시함. 최적화, 난독화, 리소스 축소의 효율성을 점수로 노출&lt;/li&gt;
  &lt;li&gt;AI Agent가 R8과 연동할 수 있는 새로운 Skill도 출시할 계획&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/04.png&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Use R8 Configuration Analyzer : http://goo.gle/r8-analyzer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;안드로이드-17의-메모리-관리-강화&quot;&gt;안드로이드 17의 메모리 관리 강화&lt;/h1&gt;

&lt;h2 id=&quot;메모리-제한memory-limits&quot;&gt;메모리 제한(Memory limits)&lt;/h2&gt;

&lt;p&gt;안드로이드 17은 메모리 누수 등으로 리소스를 과도하게 사용하는 앱에 영향을 주는 메모리 제한(Memory limits)을 도입합니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/05.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;실제로 앱이 메모리 제한에 영향을 받은 경우, 애플리케이션 종료 정보(exitinfo)에 메모리 제한에 대한 문자열이 포함된다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/06.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;ProfilingManager API에 &lt;a href=&quot;https://developer.android.com/reference/kotlin/android/os/ProfilingTrigger#trigger_type_anomaly&quot;&gt;TRIGGER_TYPE_ANOMALY&lt;/a&gt;또는 &lt;a href=&quot;https://developer.android.com/reference/kotlin/android/os/ProfilingTrigger#trigger_type_oom&quot;&gt;TRIGGER_TYPE_OOM&lt;/a&gt; 타입의 프로파일링 트리거가 있다. Heapdump를 얻어 메모리 문제를 진단하고 해결할 수 있다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Trigger-based profiling : https://developer.android.com/topic/performance/tracing/profiling-manager/trigger-based-capture&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;android-studio&quot;&gt;Android Studio&lt;/h2&gt;

&lt;p&gt;안드로이드 스튜디오의 프로파일러에 LeakCanary가 통합되어 Gemini AI를 통해 메모리 누수 원인과 수정 제안을 받을 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://developer.android.com/static/studio/preview/features/images/leakcanary-task.png&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;이미지 출처 : https://developer.android.com/studio/preview/features#leakcanary&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;android-17&quot;&gt;Android 17&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;CustomView가 포함된 알림의 이미지 크기를 제한하여, 특정 크기를 초과하면 이미지를 제거한다.&lt;/li&gt;
  &lt;li&gt;ART에서 Young Generation GC를 더 자주 도입한다&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/07.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Target Android 17로 지정 시 Reflection을 이용한 Static final field 수정은 불가능해진다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/08.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;고성능과 전력 효율을 위해 Vulkan이 자체 GPU API로 지원하고 있으며, 기존 OpenGL/WebGPU API는 Vulkan 위에 계층적으로 추가된다. 앱/게임에서 OpenGL을 사용 중이라면 ANGLE이 Vulkan으로 변환해준다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/09.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;앱이 GPU 성능을 활용할 수 있도록&lt;/li&gt;
  &lt;li&gt;Jetpack WebGPU 종속성을 추가하면 된다&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;AndroidX webgpu : https://developer.android.com/jetpack/androidx/releases/webgpu&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/10.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;새로운 Performance Analyzer는 하나의 툴체인으로 통합하여 디버깅을 획기적으로 간소화한다. 트레이스를 로드 및 렌더링하는 속도가 기존 대비 최대 26배 빨라졌다. 독립적인 실행하거나 Studio Profiler 내에서 실행될 수 있다.&lt;/p&gt;

&lt;h1 id=&quot;intelligence&quot;&gt;Intelligence&lt;/h1&gt;

&lt;p&gt;Gemini와 같은 Agnet는 여러 앱에 걸쳐 오케스트레이터(Orchestrator) 역할을 할 수 있다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Gemini는 앱 화면을 분석/탐색&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;appfunctions&quot;&gt;AppFunctions&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/11.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;AppFunctions은 Android MCP 통합 구축을 간소화하는 Jetpack 라이브러리의 Android 플랫폼 API이다. 이를 통해 앱은 기기 내 MCP 서버처럼 작동할 수 있으며, Gemini와 같은 Client Agent 및 어시스턴트가 사용할 수 있는 도구 역할을 하는 기능을 제공한다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Gemini를 통해서 AppFunctions 구현을 쉽게 할 수 있다.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@AppFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isDescribedByKDoc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;suspend&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;searchEmails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;AppFunctionContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;EmailSummary&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;코드 출처 : https://developer.android.com/ai/appfunctions&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;on-device&quot;&gt;On device&lt;/h3&gt;

&lt;p&gt;Gemini Nano와 같은 On Device 모델을 사용하면, 사용자 데이터를 로컬에 보관하고 인터넷 연결 없이 작동하면 거래당 비용도 발생하지 않는다.&lt;/p&gt;

&lt;p&gt;올해 말 Gemma 4를 탐재한 Gemini Nano 4를 사용할 수 있다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;ML Kit GenAI Prompt API : https://developers.google.com/ml-kit/genai/prompt/android&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/12.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Gemini Cloud 모델은 고급 기능을 갖추고 있으며, &lt;a href=&quot;https://firebase.google.com/docs/ai-logic&quot;&gt;Firebase AI Logic&lt;/a&gt;을 통해 Android 앱에서 사용할 수 있다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/13.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Cloud 기반 에이전트를 구축하려는 경우, A2UI 프로토콜을 사용하면 클라이언트에 UI를 표시할 수 있다.&lt;/p&gt;

&lt;p&gt;안드로이드용 A2UI를 표시하는 Jetpack Compose Renderer가 곧 출시 예정&lt;/p&gt;

&lt;h1 id=&quot;accessibility&quot;&gt;Accessibility&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Compose에서 제스처를 사용해 앱 콘텐츠 크기를 조절하는 가이드가 새로 배포 (Pinch to zoom)&lt;/li&gt;
  &lt;li&gt;사용자가 생성한 콘텐츠 등에서 설명이 누락된 경우, AI를 활용해 이미지 설명을 자동으로 생성&lt;/li&gt;
  &lt;li&gt;새로운 Accessibility Scanner는 명암비가 낮거나 터치 타겟이 너무 작은 일반적인 문제들을 더욱 잘 잡아낸다&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;개인정보-보호-및-보안&quot;&gt;개인정보 보호 및 보안&lt;/h1&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/14.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;앱에서 네이티브 라이브러리를 동적으로 로드할 때 읽기 전용으로 처리&lt;/li&gt;
  &lt;li&gt;OTP가 포함된 메시지에 접근하는 것을 방지하기 위해 3시간 동안 읽기 접근을 지연&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;credential-manager&quot;&gt;Credential Manager&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/15.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;이메일과 전화번호 인증을 제공하며, 기존 비밀번호 사용자를 위해 패스키(Passkeys)를 자동으로 생성해 주어 보안성을 높인다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;access_local_network&quot;&gt;ACCESS_LOCAL_NETWORK&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/16.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Android 17을 Target으로하는 앱은 스마트 홈 장치 등 로컬 네트워크 장치를 찾으려면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ACCESS_LOCAL_NETWORK&lt;/code&gt; 권한이 runtime으로 요구됩니다.&lt;/p&gt;

&lt;h3 id=&quot;privacy-preserving-pickers&quot;&gt;Privacy Preserving Pickers&lt;/h3&gt;

&lt;p&gt;앱이 광범위한 전체 권한을 요청하지 않아도 되도록 Picker를 제공합니다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Output Switcher : 특정 장치에 연결&lt;/li&gt;
  &lt;li&gt;EyeDropper API : 화면의 특정 색상을 선택&lt;/li&gt;
  &lt;li&gt;Contacts Picker : 연락처 내 특정 필드와 특정 연락처에 접근&lt;/li&gt;
  &lt;li&gt;Photo Picker : 그리드 뷰를 지원&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;os-experiences&quot;&gt;OS Experiences&lt;/h1&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/17.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Live Update Notification&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;건강 및 피트니스, 앱, 타이머, 여행 앱에서 사용할 수 있는 미터법 스타일 템플릿을 추가&lt;/li&gt;
  &lt;li&gt;Sementic color API를 사용하여 실시간으로 상태를 전달할 수 있다&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/18.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;올해 말 다양한 이모티콘을 업데이트할 예정이다.&lt;/p&gt;

&lt;h1 id=&quot;camera--media&quot;&gt;Camera &amp;amp; Media&lt;/h1&gt;

&lt;h3 id=&quot;on-device-이미지비디오-강화&quot;&gt;On device 이미지/비디오 강화&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/19.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;기기 내부에서 실행되는 AI를 사용해 오프라인 상태에서도 서버 비용 없이 사진의 화질 개선, 초점 보정(Deblur), 노이즈 제거(Denoise), 업스케일링 등을 처리할 수 있는 라이브러리가 제공됩니다.&lt;/p&gt;

&lt;h3 id=&quot;백그라운드-오디오-제한&quot;&gt;백그라운드 오디오 제한&lt;/h3&gt;

&lt;p&gt;사용자가 의도하지 않은 배경 음악이나 소음이 갑자기 재생되는 것을 막기 위해 Android 17은 백그라운드 앱의 오디오 API 사용을 엄격히 제한합니다. (정확한 알람 제외)&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/20.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;새로운 이미지 포맷 지원&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;RAW14&lt;/li&gt;
  &lt;li&gt;H.266 VVC&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;스트리밍 개선&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;HE-AAC&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;카메라 강화&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;제조사별 확장 기능 등&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;차세대 Eclipsa 비디오 포맷이 공식 출시&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;고품질 HDR 재생을 지원&lt;/li&gt;
  &lt;li&gt;ExoPlayer는 추가 설정 없이 바로 사용 가능&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;adaptive&quot;&gt;Adaptive&lt;/h1&gt;

&lt;h3 id=&quot;ignored-api&quot;&gt;Ignored API&lt;/h3&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/21.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;안드로이드 17부터는 기기의 전체 화면 비율이나 가로/세로 방향을 앱이 임의로 제한(opt-out)할 수 없습니다.&lt;/p&gt;

&lt;p&gt;무시되는 옵션&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;screenOrientation&lt;/li&gt;
  &lt;li&gt;﻿﻿resizableActivity&lt;/li&gt;
  &lt;li&gt;﻿﻿minAspectRatio&lt;/li&gt;
  &lt;li&gt;﻿﻿maxAspectRatio&lt;/li&gt;
  &lt;li&gt;﻿﻿setRequestedOrientation&lt;/li&gt;
  &lt;li&gt;﻿﻿getRequestedOrientation&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;mediaquery-flexbox-grid&quot;&gt;MediaQuery, FlexBox, Grid&lt;/h3&gt;

&lt;p&gt;Compose 1.11에서는 기기 상태를 쿼리하는 MediaQuery와 유연한 요소 배치를 위한 FlexBox, Grid 레이아웃 API가 실험적으로 제공&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;MediaQuery : https://developer.android.com/develop/adaptive-apps/guides/mediaquery&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;FlexBox : https://developer.android.com/develop/ui/compose/layouts/adaptive/flexbox&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;Grid : https://developer.android.com/develop/ui/compose/layouts/adaptive/grid&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/22.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/23.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;continue-on&quot;&gt;Continue On&lt;/h3&gt;

&lt;p&gt;한 기기에서 시작한 작업을 다른 기기로 전환하여 작업을 계속할 수 있다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Continue On : goo.gle/continue-on&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;bubbles&quot;&gt;Bubbles&lt;/h3&gt;

&lt;p&gt;모든 앱에서 화면을 띄울 수 있는 Bubbles 기능이 확대되었으며, 대화면 전용 Bubble bar가 도입되었습니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Bubbles : https://developer.android.com/develop/ui/compose/layouts/adaptive/support-bubbles&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;widget&quot;&gt;Widget&lt;/h3&gt;

&lt;p&gt;Jetpack Glance를 활용해 위젯을 여러 생태계로 손쉽게 확장할 수 있습니다. 특히 올해는 자동차에 위젯을 제공할 준비를 하고 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/24.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Snap scroll API를 사용하여 위젯 애니메이션을 구현할 수 있다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;SnapScrollMatchHeight : https://developer.android.com/reference/kotlin/androidx/glance/appwidget/lazy/VerticalScrollMode.SnapScrollMatchHeight&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;wear-os-7&quot;&gt;Wear OS 7&lt;/h1&gt;

&lt;p&gt;시스템 플랫폼 개선으로 배터리 수명이 최대 10% 길어집니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/25.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;사용자가 스마트폰에서 미디어를 재생하면 워치에 자동으로 제어 컨트롤이 나타나며, 휴대폰의 실시간 알림이 시계로 브리지 연동됩니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/26.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;스마트 워치는 연결된 스마트폰의 미디어 출력을 제어하여 스피커에서 헤드폰으로 전환 등을 할 수 있습니다.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/27.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;시계 제조 업체는 스마트폰에서 시계로 실시간 업데이트 알림을 전송하는 기능을 제공할 수 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;wear-os-appfunctions&quot;&gt;Wear OS AppFunctions&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;Wear OS 6.1 이상&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;제미나이(Gemini)와 같은 AI 에이전트와 연동되는 AppFunctions를 생성할 수 있습니다. 이를 활용하면 에이전트가 사용자를 대신하여 앱 내의 특정 작업 흐름(in-app flows)을 직접 호출하고 실행할 수 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;추가-업데이트&quot;&gt;추가 업데이트&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;올해 말 Wear Workout Tracker 앱을 출시 예정&lt;/li&gt;
  &lt;li&gt;Wear OS 1.6용 Compose는 Navigation 3를 지원하며, LocalAmbientModeManager를 통해 기기가 절전모드일 때 컨텐츠를 관리할 수 있다&lt;/li&gt;
  &lt;li&gt;Wear OS 7 Canary Emulator가 Android Studio에서 제공&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;andorid-xr&quot;&gt;Andorid XR&lt;/h1&gt;

&lt;p&gt;몰입형 가상현실과 증강현실(AR) 안경을 지원하는 Android XR SDK Developer Preview 4가 출시됩니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Updates to the Android XR SDK: Introducing Developer Preview 4 : https://developer.android.com/blog/posts/updates-to-the-android-xr-sdk-introducing-developer-preview-4&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Jetpack XR SDK 라이브러리가 베타 버전으로 출시될 예정&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/io/io26/whats-new-in-android/28.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;개선 사항&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;대용량 3D 모델을 앱에 포함하는 대신 실시간으로 지오메트리를 생성해 앱 크기를 줄임&lt;/li&gt;
  &lt;li&gt;XR Glasses에 Geospatial API를 도입해 공간 길 찾기를 돕는다&lt;/li&gt;
  &lt;li&gt;GODOT 및 언리얼 엔진에 대한 지원을 확장&lt;/li&gt;
  &lt;li&gt;시각적 및 상호 작용 제약 조건에 맞춰 디자인하는데 사용할 수 있는 컴포넌트 Jetpack Compose Glimmer 개선
    &lt;ul&gt;
      &lt;li&gt;Jetpack Compose Glimmer는 디스플레이 글라스에 최적화된 증강 Android XR 환경을 빌드하기 위한 Compose UI 툴킷&lt;/li&gt;
      &lt;li&gt;Glimmer를 쉽게 추가할 수 있는 Skill도 제공&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Build UI for display glasses with Jetpack Compose Glimmer : https://developer.android.com/develop/xr/jetpack-xr-sdk/jetpack-compose-glimmer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;cars&quot;&gt;Cars&lt;/h1&gt;

&lt;p&gt;Android Auto와 구글이 내장된 차량용 앱간의 호환성을 높여 차량용 앱 개발을 간소화했다.&lt;/p&gt;

&lt;p&gt;단일 코드로 양쪽 플랫폼에 Media Apps Templates를 모두 사용할 수 있으며, 두 플랫폼 모두에서 콘텐츠가 포함된 지도 템플릿과 함께 Google Maps SDK를 사용할 수 있다.&lt;/p&gt;

&lt;p&gt;Car App Library 1.9에서는 두 플랫폼에서 사용할 수 있는 새로운 컴포넌트와 레이아웃을 추가한다.&lt;/p&gt;
</description>
        <pubDate>Mon, 08 Jun 2026 14:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/io26/2026/06/08/io26-What's_new_in_Android/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/io26/2026/06/08/io26-What's_new_in_Android/</guid>
        
        <category>Android</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
        <category>io26</category>
        
      </item>
    
      <item>
        <title>Blog: 화면 캡처 및 녹화 방지를 위한 커스텀 Modifier.secureOn 구현하기</title>
        <description>&lt;p&gt;Jetpack Compose에서 특정 화면의 보안을 강화하기 위해 화면 캡처 및 녹화를 방지하는 secureOn 커스텀 Modifier를 만드는 방법을 소개합니다.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h2 id=&quot;동작-모습&quot;&gt;동작 모습&lt;/h2&gt;

&lt;p&gt;Modifier.secureOn 적용&lt;/p&gt;

&lt;div class=&quot;youtube&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/y2h7ZRGOkrk&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;p&gt;미적용&lt;/p&gt;

&lt;div class=&quot;youtube&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/75fLQ4donuQ&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;h2 id=&quot;jetpack-compose에서-화면-캡처-방지하기-modifiersecureon&quot;&gt;Jetpack Compose에서 화면 캡처 방지하기: Modifier.secureOn&lt;/h2&gt;

&lt;p&gt;Android 앱을 개발하다 보면 결제 화면, 개인정보 입력창 등 보안이 중요한 페이지에서 사용자의 화면 캡처나 녹화를 제한해야 하는 경우가 있습니다. 기본적으로 Android에서는 Window에 WindowManager.LayoutParams.FLAG_SECURE 플래그를 설정하여 이를 구현합니다.&lt;/p&gt;

&lt;p&gt;이번 글에서는 Compose의 Modifier.Node를 사용하여, 선언적으로 화면 보안을 활성화할 수 있는 secureOn Modifier를 구현해 보겠습니다.&lt;/p&gt;

&lt;p&gt;구현 코드&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;secureOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;then&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SecureOnElement&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SecureOnElement&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ModifierNodeElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;SecureOnNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SecureOnNode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SecureOnNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

   &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SecureOnNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;

   &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;InspectorInfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;inspectableProperties&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;secureOn&quot;&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SecureOnNode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Node&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;CompositionLocalConsumerModifierNode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

   &lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;findWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;currentValueOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;LocalContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;findWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

   &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;onAttach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nf&quot;&gt;findWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;addFlags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;WindowManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;LayoutParams&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;FLAG_SECURE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

   &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;onDetach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nf&quot;&gt;findWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;clearFlags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;WindowManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;LayoutParams&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;FLAG_SECURE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

   &lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;tailrec&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;findWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Activity&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;window&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ContextWrapper&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;baseContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;findWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nd&quot;&gt;@Preview&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;showBackground&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SecureOnPreview&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;nc&quot;&gt;ComposeSamplesTheme&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nc&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;SecureOn&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;secureOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;fillMaxSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mh&quot;&gt;0xFFC8E6C9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;wrapContentSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Alignment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;fontSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sp&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;주요-내용-설명&quot;&gt;주요 내용 설명&lt;/h2&gt;

&lt;h3 id=&quot;modifiernode와-modifiernodeelement&quot;&gt;Modifier.Node와 ModifierNodeElement&lt;/h3&gt;

&lt;p&gt;Modifier.compose 방식보다 성능 면에서 유리한 Modifier.Node를 사용했습니다. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SecureOnElement&lt;/code&gt;는 Modifier의 데이터를 정의하고, 실제 로직이 담긴 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SecureOnNode&lt;/code&gt;를 생성하는 역할을 합니다&lt;/p&gt;

&lt;h3 id=&quot;compositionlocalconsumermodifiernode&quot;&gt;CompositionLocalConsumerModifierNode&lt;/h3&gt;

&lt;p&gt;Modifier 노드 내부에서 LocalContext와 같은 CompositionLocal 데이터에 접근하기 위해 CompositionLocalConsumerModifierNode 인터페이스를 구현합니다. 이를 통해 currentValueOf(LocalContext)로 현재 Context를 안전하게 가져올 수 있습니다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;a href=&quot;https://developer.android.com/develop/ui/compose/custom-modifiers&quot;&gt;커스터 Modifier 만들기&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/androidx/compose/ui/node/CompositionLocalConsumerModifierNode&quot;&gt;CompositionLocalConsumerModifierNode&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;생명-주기-관리-onattach--ondetach&quot;&gt;생명 주기 관리 (onAttach &amp;amp; onDetach)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;onAttach : Modifier가 적용된 Composable Tree에 붙을 때 호출됩니다. 이때 FLAG_SECURE를 추가하여 화면 캡처를 차단합니다.&lt;/li&gt;
  &lt;li&gt;onDetach : Composable이 제거될 때 호출됩니다. 설정했던 Flag를 제거하여 다른 화면으로 이동했을 때 영향을 줄지 않도록 합니다.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;사용-시-주의사항&quot;&gt;사용 시 주의사항&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FLAG_SECURE&lt;/code&gt;는 Window 단위로 동작합니다. 따라서 특정 Composable에만 Modifier를 적용하더라도, 해당 Composable이 속한 화면 전체가 캡처 방지 대상이 됩니다.&lt;/p&gt;
</description>
        <pubDate>Sun, 19 Apr 2026 14:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/2026/04/19/Compose-SecureOn/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/2026/04/19/Compose-SecureOn/</guid>
        
        <category>Android</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
      </item>
    
      <item>
        <title>Blog: Jetpack Compose에서 BringIntoViewRequester를 활용한 스마트한 스크롤 제어</title>
        <description>&lt;p&gt;모바일 앱에서 회원가입이나 정보 입력 폼(Form)을 구현할 때, 소프트 키보드가 올라오면서 사용자가 입력 중인 텍스트 필드를 가려버리는 이슈는 안드로이드 개발자라면 누구나 겪어본 흔한 문제입니다.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;본 글에서는 Jetpack Compose에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester&lt;/code&gt;를 사용해 이 문제를 해결하는 방법 중 하나를 소개합니다. 아래와 같은 회원가입 화면에서 사용한 일부분을 예제로 만들어보면서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester&lt;/code&gt;를 어떻게 실전에 적용하는지 소개하겠습니다.&lt;/p&gt;

&lt;div class=&quot;youtube&quot;&gt;
    &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/ZiliLq9ZxuU&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;1-bringintoviewrequester란&quot;&gt;1. BringIntoViewRequester란?&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester&lt;/code&gt;는 Compose에서 특정 Composable 영역이 스크롤 가능한 부모(Viewport) 화면 내에 들어오도록(Bring into view) 스크롤을 요청하는 기능을 제공하는 객체입니다.&lt;/p&gt;

&lt;p&gt;사용자가 텍스트 필드를 터치하여 포커스를 얻었을 때, 혹은 키보드가 올라오는 시점에 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bringIntoView()&lt;/code&gt; 함수를 호출하게 되면, Compose가 알아서 해당 Composable이 화면에 잘 보이도록 스크롤 위치를 조정해 줍니다.&lt;/p&gt;

&lt;h2 id=&quot;2-화면-전체-구성과-기본-세팅&quot;&gt;2. 화면 전체 구성과 기본 세팅&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester&lt;/code&gt;가 올바르게 동작하려면, 상위 부모가 스크롤 가능하고 키보드 높이에 반응해야 합니다. 예제의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Sample&lt;/code&gt; Composable은 이를 위한 기본 정의입니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Sample&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;scrollState&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;rememberScrollState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    
    &lt;span class=&quot;nc&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;fillMaxSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// 필수 1. 시스템 바(상태 바 등) 영역을 피하기 위한 패딩&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;systemBarsPadding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// 필수 2. 키보드가 올라올 때 하단에 키보드 높이만큼 패딩 확보&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;imePadding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; 
            &lt;span class=&quot;c1&quot;&gt;// 필수 3. 뷰포트 내에서 스크롤 가능하도록 설정&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;verticalScroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scrollState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;verticalArrangement&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Arrangement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;spacedBy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// ... (아이디, 비밀번호, 주소 등 폼 입력 Composable 배치)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;imePadding()&lt;/code&gt;&lt;/strong&gt;: 키보드가 차지하는 공간만큼 화면 하단에 패딩을 밀어 넣어 화면 콘텐츠 영역을 조정합니다.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verticalScroll()&lt;/code&gt;&lt;/strong&gt;: 스크롤 상태를 부여하여 좁아진 영역 안에서 스크롤이 가능하도록 만들어줍니다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;이 두 가지가 전제되어야 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester&lt;/code&gt;가 위치를 계산하여 올바르게 스크롤할 수 있습니다.&lt;/p&gt;

&lt;h2 id=&quot;3-핵심-로직-textfield와-bringintoviewrequester-직접-연결&quot;&gt;3. 핵심 로직: TextField와 BringIntoViewRequester 직접 연결&lt;/h2&gt;

&lt;p&gt;여기에서는 복잡한 구조대신, 단일 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextField&lt;/code&gt;에 직접 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester&lt;/code&gt;를 통해서 동작 원리를 확인해 보겠습니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SimpleInput&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// 1. 상태 및 객체 초기화&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;by&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;mutableStateOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;isFocused&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;by&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;mutableStateOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;bringIntoViewRequester&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BringIntoViewRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
    &lt;span class=&quot;c1&quot;&gt;// 키보드 노출 여부&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;isImeVisible&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;WindowInsets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isImeVisible&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// 2. 포커스 상태와 키보드 노출 여부에 따라 스크롤 요청&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;LaunchedEffect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isImeVisible&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;isFocused&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isImeVisible&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;isFocused&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// 키보드가 올라오는 애니메이션 시간을 고려한 짧은 지연&lt;/span&gt;
            &lt;span class=&quot;nf&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 
            &lt;span class=&quot;n&quot;&gt;bringIntoViewRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;bringIntoView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nc&quot;&gt;TextField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;onValueChange&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;간단한 입력&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;fillMaxWidth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// 3. Modifier에 bringIntoViewRequester 등록&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;bringIntoViewRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bringIntoViewRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// 4. 포커스 상태 변경 감지&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;onFocusChanged&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;focusState&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;isFocused&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;focusState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hasFocus&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;위의 예제는 가장 기본적인 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester&lt;/code&gt;의 사용 패턴입니다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;객체 생성&lt;/strong&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester()&lt;/code&gt;를 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;remember&lt;/code&gt;로 생성하고 타깃이 되는 UI 요소(여기서는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextField&lt;/code&gt;)의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Modifier&lt;/code&gt;에 연결합니다.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;이벤트 트리거&lt;/strong&gt;: 상태(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;text&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;isFocused&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;isImeVisible&lt;/code&gt;) 변화를 감지하여 CoroutineScope 안에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bringIntoView()&lt;/code&gt;를 호출합니다.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;4-심화-예제-휴대폰-번호-입력-필드-상세-구현-focusgroup의-활용&quot;&gt;4. 심화 예제: 휴대폰 번호 입력 필드 상세 구현 (focusGroup의 활용)&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BringIntoViewRequester&lt;/code&gt;는 여러 개의 입력 필드가 하나의 그룹으로 묶일 때도 사용할 수 있습니다. 예제로 휴대폰 번호를 입력받는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CellularPhone&lt;/code&gt; Composable을 통해 여러 입력 필드 사이에서 어떻게 처리하는지 확인해 보겠습니다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Composable&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;CellularPhone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// 1. 여러 TextField의 포커스를 제어하기 위한 FocusRequester &lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;focus1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;focus2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;focus3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FocusRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;createRefs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;input1&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;by&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;mutableStateOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// ... input2, input3 생략 ...&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;isFocused&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;by&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;mutableStateOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;bringIntoViewRequester&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;remember&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BringIntoViewRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;isImeVisible&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;WindowInsets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isImeVisible&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// 스크롤 요청 로직&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;LaunchedEffect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isImeVisible&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;isFocused&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;isImeVisible&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;isFocused&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
             &lt;span class=&quot;nf&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;bringIntoViewRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;bringIntoView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// 2. 입력 필드들을 감싸는 부모 Column에 Modifier 적용&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;bringIntoViewRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bringIntoViewRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;onFocusChanged&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;focusState&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;isFocused&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;focusState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hasFocus&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// ✨ 3. 자식들의 포커스를 그룹화&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;focusGroup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; 
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;휴대폰번호&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;verticalAlignment&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Alignment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;CenterVertically&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// 첫 번째 입력 필드&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;TextField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;c1&quot;&gt;// ...&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;modifier&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Modifier&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;1f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;focusRequester&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;focus1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;focusProperties&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;next&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;focus2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// 다음 포커스 지정&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;Dash&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// 두 번째, 세 번째 입력 필드 생략 ...&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;단계별-상세-설명&quot;&gt;단계별 상세 설명&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;포커스 이동 설정 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focusProperties&lt;/code&gt;)&lt;/strong&gt;: 각 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextField&lt;/code&gt;의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Modifier.focusProperties&lt;/code&gt;를 통해 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;next&lt;/code&gt; 호긍ㄴ &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;previous&lt;/code&gt;를 지정할 수 있습니다. 이렇게 하면 하드웨어 키보드의 Tab 키나 접근성 서비스(TalkBack 등)를 통한 포커스 이동이 자연스럽게 동작합니다.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focusGroup()&lt;/code&gt;의 역할&lt;/strong&gt;: 부모 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Column&lt;/code&gt;에 적용된 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Modifier.focusGroup()&lt;/code&gt;은 여기서 결정적인 역할을 합니다. 만약 이 Modifier가 없다면, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus1&lt;/code&gt;을 가진 첫 번째 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextField&lt;/code&gt;에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus2&lt;/code&gt;를 가진 두 번째 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TextField&lt;/code&gt;로 포커스가 이동할 때, 부모 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Column&lt;/code&gt;은 찰나의 순간에 “포커스를 잃었다”고 판단(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;isFocused = false&lt;/code&gt; -&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;true&lt;/code&gt;)하게 됩니다. 이는 상태 변화를 일으켜 불필요한 재구성을 유발하거나, 스크롤 로직이 꼬이는 원인이 될 수 있습니다. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focusGroup()&lt;/code&gt;은 내부 자식들 간의 포커스 이동은 그룹 외부로 포커스가 벗어난 것으로 간주하지 않도록 하여 부모의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;isFocused&lt;/code&gt; 상태를 안정적으로 유지시켜 줍니다.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;5-결론&quot;&gt;5. 결론&lt;/h2&gt;

&lt;p&gt;Jetpack Compose에서 복잡한 입력 폼을 다룰 때, 키보드가 UI를 가리는 현상을 효과적으로 제어하는 것은 사용자 경험(UX) 측면에서 매우 중요합니다. 다음 3가지만 기억하시면 됩니다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;화면 최상위에 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;imePadding()&lt;/code&gt;과 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verticalScroll()&lt;/code&gt;을 적용하여 기본적인 스크롤 캔버스를 확보&lt;/li&gt;
  &lt;li&gt;단일 입력 컴포넌트 또는 입력 필드 그룹에 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Modifier.bringIntoViewRequester()&lt;/code&gt;를 적용하고, 여러 개의 필드가 묶여있다면 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focusGroup()&lt;/code&gt;으로 감싸 포커스를 안정적으로 관리&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WindowInsets.isImeVisible&lt;/code&gt;과 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hasFocus&lt;/code&gt;를 조합하여, 포커스를 가진 상태로 키보드가 나타날 때 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bringIntoView()&lt;/code&gt;를 호출&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;위 패턴을 도입한다면, 어떠한 긴 가입 폼 화면이라도 사용자가 입력 중인 부분이 키보드에 가려지는 답답한 일을 겪지 않게 될 것입니다.&lt;/p&gt;
</description>
        <pubDate>Sun, 15 Mar 2026 14:00:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/2026/03/15/BringIntoViewRequester/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/2026/03/15/BringIntoViewRequester/</guid>
        
        <category>Android</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
      </item>
    
      <item>
        <title>Blog: [메모] Android Studio plugin 개발 시 빌드 오류</title>
        <description>&lt;p&gt;Android Studio 플러그인 개발 시 버전 업데이트하면서 발생한 내용을 메모로 남긴다.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h2 id=&quot;plugin-빌드-오류&quot;&gt;Plugin 빌드 오류&lt;/h2&gt;

&lt;p&gt;매번 호환되는 Android Studio 버전에 맞춰서 버전 업데이트를 진행했다. 이상하게도 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Panda&lt;/code&gt; 버전부터 Android Studio 이미지를 가져오는 것이 실패했다.&lt;/p&gt;

&lt;h3 id=&quot;빌드-환경-확인&quot;&gt;빌드 환경 확인&lt;/h3&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// root build.gralde.kts&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;plugins&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
   &lt;span class=&quot;nf&quot;&gt;alias&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;libs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plugins&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;intelliJPlatform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// org.jetbrains.intellij.platform 2.11.0 버전 사용&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// 모듈 build.gradle.kts&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;dependencies&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;nf&quot;&gt;intellijPlatform&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nf&quot;&gt;androidStudio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;2025.3.2.6&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;빌드-실패-로그&quot;&gt;빌드 실패 로그&lt;/h3&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Could not determine the dependencies of task &lt;span class=&quot;s1&quot;&gt;&apos;:compileJava&apos;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Could not resolve all files &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;configuration &lt;span class=&quot;s1&quot;&gt;&apos;:intellijPlatformDependency&apos;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Could not find com.google.android.studio:android-studio:2025.3.2.6.
     Searched &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the following locations:
       - https://repo.maven.apache.org/maven2/com/google/android/studio/android-studio/2025.3.2.6/android-studio-2025.3.2.6.pom
       - https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2025.3.2.6/android-studio-2025.3.2.6-https:/edgedl.me.gvt1.com/android/studio/install/2025.3.2.6/android-studio-panda2-mac_arm.dmg
       - https://redirector.gvt1.com/edgedl/android/studio/install/2025.3.2.6/android-studio-2025.3.2.6-https:/edgedl.me.gvt1.com/android/studio/install/2025.3.2.6/android-studio-panda2-mac_arm.dmg
       - https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/google/android/studio/android-studio/2025.3.2.6/android-studio-2025.3.2.6.pom
       - https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/snapshots/com/google/android/studio/android-studio/2025.3.2.6/android-studio-2025.3.2.6.pom
       - https://cache-redirector.jetbrains.com/intellij-dependencies/com/google/android/studio/android-studio/2025.3.2.6/android-studio-2025.3.2.6.pom
       - https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven/com/google/android/studio/android-studio/2025.3.2.6/android-studio-2025.3.2.6.pom
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;원인&quot;&gt;원인&lt;/h2&gt;

&lt;p&gt;IntelliJ 기반 플러그인에 필요한 &lt;a href=&quot;https://github.com/JetBrains/intellij-platform-gradle-plugin&quot;&gt;intellij-platform-gradle-plugin&lt;/a&gt; Github에서 해당 이유를 찾을 수 있었다.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/JetBrains/intellij-platform-gradle-plugin/issues/2087&quot;&gt;verifyPlugin failed for Android Studio&lt;/a&gt; 이슈의 내용으로 최근 Android Studio의 아카이브 형식이 변경되었다고 한다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;변경 전 : 버전 번호를 사용&lt;/li&gt;
  &lt;li&gt;변경 후 : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;panda&lt;/code&gt;와 같은 코드명을 URL 문자열에 포함&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://developer.android.com/studio/archive&quot;&gt;https://developer.android.com/studio/archive&lt;/a&gt; 에서도 동일한 모습을 확인할 수 있다&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/0310/Otter3.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;img-responsive&quot; src=&quot;/assets/img/blog/2026/0310/Panda2.png&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;해결법&quot;&gt;해결법&lt;/h2&gt;

&lt;p&gt;해결법은 너무나도 간단하게 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;org.jetbrains.intellij.platform&lt;/code&gt; plugin을 &lt;a href=&quot;https://github.com/JetBrains/intellij-platform-gradle-plugin/releases/tag/2.12.0&quot;&gt;2.12.0&lt;/a&gt; 버전으로 업데이트하면 된다.&lt;/p&gt;

&lt;p&gt;기반 플러그인 측에서 수정되어서 해결되었다.&lt;/p&gt;

&lt;div class=&quot;language-kotlin highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// root build.gralde.kts&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;plugins&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
   &lt;span class=&quot;nf&quot;&gt;alias&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;libs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plugins&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;intelliJPlatform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// org.jetbrains.intellij.platform 2.12.0 버전 사용&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Tue, 10 Mar 2026 14:30:00 +0000</pubDate>
        <link>http://pluu.github.io/blog/android/2026/03/10/AS-plugin-build/</link>
        <guid isPermaLink="true">http://pluu.github.io/blog/android/2026/03/10/AS-plugin-build/</guid>
        
        <category>Android</category>
        
        
        <category>blog</category>
        
        <category>Android</category>
        
      </item>
    
  </channel>
</rss>
