원클릭으로
android-rotation-anti-flicker
Eliminate black flash and visual glitches during screen rotation in Android apps
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Eliminate black flash and visual glitches during screen rotation in Android apps
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | Android Rotation Anti-Flicker |
| description | Eliminate black flash and visual glitches during screen rotation in Android apps |
| last_verified | "2026-01-23T00:00:00.000Z" |
| applicable_sdk | Android 8+ (API 26+) |
Last Verified: 2026-01-23 Applicable SDK: Android 8+ (API 26+), tested through Android 15 (API 35) Project Context: OpenFlip (Target SDK 35, Min SDK 26)
This skill provides a proven protocol to eliminate black screen flashes and visual glitches during screen rotation in Android applications.
Required Skills:
Related Skills:
New Behaviors:
Compatibility: All techniques in this skill remain valid for Android 15.
Add configChanges to prevent Activity recreation:
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:screenOrientation="fullSensor" />
Why: Prevents Activity destruction/recreation cycle that causes black screen.
values/themes.xml)<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
<item name="android:windowBackground">@color/white</item>
</style>
values-night/themes.xml)<style name="AppTheme" parent="Theme.Material3.Dark.NoActionBar">
<item name="android:windowBackground">@color/black</item>
</style>
[!CAUTION] NEVER use
?attr/colorSurfaceor any dynamic attribute forwindowBackground. Dynamic attributes are resolved during rotation, causing a brief flash.
Apply to animation-heavy custom views:
class MyCustomView(context: Context, attrs: AttributeSet?) : View(context, attrs) {
init {
setLayerType(LAYER_TYPE_HARDWARE, null)
}
}
Why: Prevents GPU resource deallocation after idle periods. Without this, rotating after 10+ seconds of inactivity causes black flash as GPU re-rasterizes.
Override onConfigurationChanged instead of relying on Activity recreation:
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
// Recalculate dimensions, refresh layouts
myCustomView.requestLayout()
}
| Symptom | Cause | Fix |
|---|---|---|
| Black flash on first rotation | Missing windowBackground | Add hardcoded color in themes.xml |
| Flash after idle | GPU layer reclaimed | Add LAYER_TYPE_HARDWARE |
| Delayed rotation response | Activity recreating | Add configChanges in manifest |
Guidance for creating effective modular skills for Claude. Use when creating or refining skills to ensure they are concise, follow progressive disclosure patterns, and provide appropriate degrees of freedom.
Guidelines for ensuring smooth and race-condition-free theme transitions in Android, specifically regarding icon tinting and state management.
Best practices for effective human-AI pair programming and communication
Clarify touch-target vs visual size when users ask to resize buttons without changing icons.
Choose whether the outer container acts as the touch proxy or remains a layout placeholder to control hit targets.
Best practices for 60fps custom View rendering with zero allocation in onDraw