탐색
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Compose 사용해 보기
Wear OS용 Jetpack Compose는 Wear OS에 권장되는 UI 도구 키트입니다.
각 사용자 여정에 맞게 개별 화면을 디자인한 후 세로 화면이 몇 개 있거나 단일 화면이 있을 수 있습니다.
다음으로 이러한 화면이 함께 작동하도록 설계하는 방법과 탐색을 구현하는 방법을 결정해야 합니다.
디자인
앱 디자인 가이드라인에 설명된 대로 앱의 계층 구조를 얕고 선형적으로 유지합니다.
시작하려면 앱의 런처가 가장 일반적인 사용자 여정을 열어야 합니다. 가장 중요한 콘텐츠를 상단에 배치하여 각 사용자 여정을 디자인합니다. 세로 컨테이너의 경우 하단을 사용하여 덜 일반적인 다른 사용자 여정 및 설정으로 연결합니다.
그림 1. 가장 중요한 콘텐츠를 세로 컨테이너 상단에 배치합니다.
사용자가 화면 중 하나에 진입하면 스와이프하여 닫기 동작을 사용하여 백 스택 아래로 이동할 수 있는지 확인합니다.
탐색 구현
탐색을 구현할 때는 다음 섹션에 설명된 세 가지 옵션이 있습니다.
- 활동만 사용(권장)
- 활동 및 프래그먼트
- Jetpack Navigation
활동만
세로 화면은 일반적으로 깊이가 1단계이므로 활동을 사용하고 프래그먼트를 사용하지 않고 모든 화면을 구현할 수 있습니다.
이 방법을 사용하는 것이 좋습니다. 코드가 간소화되고 활동이 스와이프하여 닫기를 자동으로 지원합니다. 또한 대기 모드를 더 간단하게 구현할 수 있습니다.
참고: 프래그먼트를 사용하지 않는 경우 활동이 ComponentActivity
에서 상속받도록 합니다. 다른 활동 유형은 Wear OS에 필요하지 않은 모바일 전용 UI 요소를 사용합니다.
활동 및 프래그먼트
Wear OS 앱의 활동과 함께 프래그먼트를 사용할 수 있습니다. 하지만 프래그먼트를 사용하여 얕고 평면적인 아키텍처를 만드는 데는 명확한 이점이 없으므로 권장하지 않습니다.
참고: 프래그먼트를 사용하는 경우 FragmentActivity
에서 상속받습니다. 다른 활동 유형은 Wear OS에 필요하지 않은 모바일 전용 UI 요소를 사용합니다.
Wear OS 앱에서 프래그먼트를 사용하는 데는 다음과 같은 어려움이 있습니다.
-
스와이프하여 닫기를 직접 구현해야 합니다. 그렇지 않으면 사용자가 스와이프하면 전체 앱이 종료됩니다.
-
AmbientMode
를 사용하는 경우 올바르게 작동하도록 맞춤설정해야 합니다. AmbientMode
는 활동에 설정되므로 프래그먼트를 구현할 때 이를 고려해야 합니다.
프래그먼트에서 스와이프하여 닫기를 지원하려면 프래그먼트 포함 뷰를 SwipeDismissFrameLayout
클래스로 래핑해야 합니다. 자세한 내용은 스와이프하여 닫기 동작을 참고하세요. 이렇게 하면 사용자에게 일관된 앱 환경을 제공할 수 있습니다.
참고: 프래그먼트를 사용할 때는 스와이프하여 닫기 동작을 지원하기 위해 FragmentManager.replace
대신 FragmentManager.add
를 사용하세요.
이렇게 하면 이전 프래그먼트가 스와이프되는 동안 상단 프래그먼트 아래에 렌더링됩니다.
Jetpack Navigation
Jetpack Navigation은 Wear OS에서 작동할 수 있지만 프래그먼트와 동일한 단점이 있습니다. 이렇게 하면 개발 작업이 추가되며 Wear OS 앱의 계층 구조는 일반적으로 얕고 선형적이므로 많은 이점을 제공하지 않습니다. 활동 전용 접근 방식이 가장 좋습니다.
Jetpack 탐색을 최대한 활용하려면 다음 단계를 따르세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# Navigation\n\nTry the Compose way \nJetpack Compose on Wear OS is the recommended UI toolkit for Wear OS. \n[Handle navigation using Compose on Wear OS →](/training/wearables/compose/navigation) \n\n\nAfter designing individual screens for each user journey, you might have a few vertical or single\nscreens.\nNext, you have to decide how to design these screens to work together and how to implement the\nnavigation.\n\nDesign\n------\n\n\nKeep your app's hierarchy shallow and linear, as called out in the [app design guidelines](/training/wearables/design/apps).\n\n\nTo start, your app's launcher should open the most common user journey. Design each user journey\nwith the most important content at the top. For vertical containers, use the bottom to link to\nother, less-common user journeys and the settings.\n\n\n**Figure 1.** Keep the most important content at the top of vertical containers.\n\nWhen users enter one of your screens, make sure they can use the swipe-to-dismiss gesture\nto navigate down the [back stack](/guide/components/tasks-and-back-stack).\n\nImplement the navigation\n------------------------\n\n\nWhen you implement your navigation, you have three options, described in the following sections:\n\n- Activities only, which is the recommended approach\n- Activities and fragments\n- Jetpack Navigation\n\n### Activities only\n\n\nSince vertical screens are typically one level deep, you can implement all your screens\nusing activities and without using fragments.\n\n\nWe strongly recommend this approach. It simplifies your code, and\nactivities automatically support\n[swipe-to-dismiss](/training/wearables/apps/exit#swipe-to-dismiss). This also makes\nimplementing [ambient mode](/training/wearables/apps/always-on) simpler.\n\n\n**Note:** Make your activities inherit from a\n[`ComponentActivity`](/reference/androidx/activity/ComponentActivity) if\nyou are not using fragments. The other activity types use mobile-specific UI elements you don't\nneed for Wear OS.\n\n### Activities and fragments\n\n\nYou can use [fragments](/guide/fragments) with activities in your Wear OS app. However,\nwe don't recommend this, as there isn't a clear advantage to using fragments to create a shallow and flat\narchitecture.\n\n\n**Note:** If you are using fragments, make them inherit from\n[`FragmentActivity`](/reference/androidx/fragment/app/FragmentActivity). The\nother activity types use mobile-specific UI elements you don't need for Wear OS.\n\n\nSome of the difficulties with using fragments in your Wear OS app include the following:\n\n- You must implement the swipe-to-dismiss yourself. Otherwise, when the user performs a swipe, they exit the entire app.\n- If you are using [`AmbientMode`](/reference/androidx/wear/ambient/AmbientMode), you must customize it to work properly. `AmbientMode` is set on the activity, so you have to take that into account when implementing fragments.\n\n\nTo support swipe-to-dismiss with fragments, you must wrap the fragment-containing\nview in the\n[`SwipeDismissFrameLayout`](/reference/androidx/wear/widget/SwipeDismissFrameLayout)\nclass. See\n[The swipe-to-dismiss gesture](/training/wearables/apps/exit#swipe-to-dismiss)\nfor more information. Doing this provides users a consistent experience with your app.\n\n\n**Note:** When using fragments, use\n[`FragmentManager.add`](/reference/androidx/fragment/app/FragmentTransaction#add(int,%20java.lang.Class\u003c?%20extends%20androidx.fragment.app.Fragment\u003e,%20android.os.Bundle))\nrather than\n[`FragmentManager.replace`](/reference/androidx/fragment/app/FragmentTransaction#replace(int,%20java.lang.Class\u003c?%20extends%20androidx.fragment.app.Fragment\u003e,%20android.os.Bundle))\nto support the swipe-to-dismiss gesture.\nThis helps ensure that your previous fragment renders under the top fragment while it is being\nswiped away.\n\n### Jetpack Navigation\n\n\nJetpack Navigation can work on Wear OS, but it has the same drawbacks as fragments. It adds\ndevelopment work and, because a Wear OS app's hierarchy is generally shallow and linear, it doesn't\noffer many advantages. An activity-only approach is best.\n\n\nTo fully leverage Jetpack Navigation, do the following:\n\n- Make sure every fragment uses a [`SwipeDismissFrameLayout`](/reference/kotlin/androidx/wear/widget/SwipeDismissFrameLayout) as its root, and manually use the dismiss action to go back in the navigation graph.\n- Implement a custom [`FragmentNavigator`](/reference/androidx/navigation/fragment/FragmentNavigator) that renders fragments on top of each other."]]