# OnboardingFragment

Artifact: [androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback) [View Source](https://cs.android.com/search?q=file:androidx/leanback/app/OnboardingFragment.java+class:androidx.leanback.app.OnboardingFragment) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***


```
public abstract class OnboardingFragment extends Fragment
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [android.app.Fragment](https://developer.android.com/reference/android/app/Fragment.html) ||
|   | ↳ | [androidx.leanback.app.OnboardingFragment](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment) |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> use `https://developer.android.com/reference/androidx/leanback/app/OnboardingSupportFragment`

An OnboardingFragment provides a common and simple way to build onboarding screen for applications.

### Building the screen

The view structure of onboarding screen is composed of the common parts and custom parts. The common parts are composed of icon, title, description and page navigator and the custom parts are composed of background, contents and foreground.

To build the screen views, the inherited class should override:

- `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateBackgroundView(android.view.LayoutInflater,android.view.ViewGroup)` to provide the background view. Background view has the same size as the screen and the lowest z-order.
- `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateContentView(android.view.LayoutInflater,android.view.ViewGroup)` to provide the contents view. The content view is located in the content area at the center of the screen.
- `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateForegroundView(android.view.LayoutInflater,android.view.ViewGroup)` to provide the foreground view. Foreground view has the same size as the screen and the highest z-order

Each of these methods can return `null` if the application doesn't want to provide it.

### Page information

The onboarding screen may have several pages which explain the functionality of the application. The inherited class should provide the page information by overriding the methods:

- `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageCount()` to provide the number of pages.
- `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageTitle(int)` to provide the title of the page.
- `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageDescription(int)` to provide the description of the page.

Note that the information is used in `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`, so should be initialized before calling `super.onCreateView`.

### Animation

Onboarding screen has three kinds of animations:

#### Logo Splash Animation

When onboarding screen appears, the logo splash animation is played by default. The animation fades in the logo image, pauses in a few seconds and fades it out.

In most cases, the logo animation needs to be customized because the logo images of applications are different from each other, or some applications may want to show their own animations.

The logo animation can be customized in two ways:

- The simplest way is to provide the logo image by calling `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setLogoResourceId(int)` to show the default logo animation. This method should be called in `https://developer.android.com/reference/android/app/Fragment.html#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)`.
- If the logo animation is complex, then override `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateLogoAnimation()` and return the `https://developer.android.com/reference/android/animation/Animator.html` object to run.

If the inherited class provides neither the logo image nor the animation, the logo animation will be omitted.

#### Page enter animation

After logo animation finishes, page enter animation starts, which causes the header section - title and description views to fade and slide in. Users can override the default fade + slide animation by overriding `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateTitleAnimator()`\&`https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateDescriptionAnimator()`. By default we don't animate the custom views but users can provide animation by overriding `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateEnterAnimation()`.

#### Page change animation

When the page changes, the default animations of the title and description are played. The inherited class can override `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onPageChanged(int,int)` to start the custom animations.

### Finishing the screen

If the user finishes the onboarding screen after navigating all the pages, `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onFinishFragment()` is called. The inherited class can override this method to show another fragment or activity, or just remove this fragment.

### Theming

OnboardingFragment must have access to an appropriate theme. Specifically, the fragment must receive , or a theme whose parent is set to that theme. Themes can be provided in one of three ways:

- The simplest way is to set the theme for the host Activity to the Onboarding theme or a theme that derives from it.
- If the Activity already has a theme and setting its parent theme is inconvenient, the existing Activity theme can have an entry added for the attribute . If present, this theme will be used by OnboardingFragment as an overlay to the Activity's theme.
- Finally, custom subclasses of OnboardingFragment may provide a theme through the `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onProvideTheme()` method. This can be useful if a subclass is used across multiple Activities.

If the theme is provided in multiple ways, the onProvideTheme override has priority, followed by the Activity's theme. (Themes whose parent theme is already set to the onboarding theme do not need to set the onboardingTheme attribute; if set, it will be ignored.)

## Summary

| ### Public constructors |
|---|
| `[OnboardingFragment](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#OnboardingFragment())()` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getArrowBackgroundColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getArrowBackgroundColor())()` **This method is deprecated.** Deprecated in Java |
| `final @https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getArrowColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getArrowColor())()` **This method is deprecated.** Deprecated in Java |
| `final @https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getDescriptionViewTextColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getDescriptionViewTextColor())()` **This method is deprecated.** Deprecated in Java |
| `final @https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getDotBackgroundColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getDotBackgroundColor())()` **This method is deprecated.** Deprecated in Java |
| `final int` | `[getIconResourceId](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getIconResourceId())()` **This method is deprecated.** Deprecated in Java |
| `final int` | `[getLogoResourceId](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getLogoResourceId())()` **This method is deprecated.** Deprecated in Java |
| `final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html` | `[getStartButtonText](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getStartButtonText())()` **This method is deprecated.** Deprecated in Java |
| `final @https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getTitleViewTextColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getTitleViewTextColor())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | `[onCreateView](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle))( https://developer.android.com/reference/android/view/LayoutInflater.html inflater, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/ViewGroup.html container, https://developer.android.com/reference/android/os/Bundle.html savedInstanceState )` **This method is deprecated.** |
| `int` | `[onProvideTheme](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onProvideTheme())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[onSaveInstanceState](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onSaveInstanceState(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html outState)` **This method is deprecated.** |
| `void` | `[onViewCreated](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onViewCreated(android.view.View,android.os.Bundle))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/View.html view, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)` **This method is deprecated.** |
| `void` | `[setArrowBackgroundColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setArrowBackgroundColor(int))(@https://developer.android.com/reference/androidx/annotation/ColorInt int color)` **This method is deprecated.** Deprecated in Java |
| `void` | `[setArrowColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setArrowColor(int))(@https://developer.android.com/reference/androidx/annotation/ColorInt int color)` **This method is deprecated.** Deprecated in Java |
| `void` | `[setDescriptionViewTextColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setDescriptionViewTextColor(int))(@https://developer.android.com/reference/androidx/annotation/ColorInt int color)` **This method is deprecated.** Deprecated in Java |
| `void` | `[setDotBackgroundColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setDotBackgroundColor(int))(@https://developer.android.com/reference/androidx/annotation/ColorInt int color)` **This method is deprecated.** Deprecated in Java |
| `final void` | `[setIconResouceId](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setIconResouceId(int))(int resourceId)` **This method is deprecated.** Deprecated in Java |
| `final void` | `[setLogoResourceId](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setLogoResourceId(int))(int id)` **This method is deprecated.** Deprecated in Java |
| `void` | `[setStartButtonText](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setStartButtonText(java.lang.CharSequence))(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html text)` **This method is deprecated.** Deprecated in Java |
| `void` | `[setTitleViewTextColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setTitleViewTextColor(int))(@https://developer.android.com/reference/androidx/annotation/ColorInt int color)` **This method is deprecated.** Deprecated in Java |

| ### Protected methods |
|---|---|
| `final int` | `[getCurrentPageIndex](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getCurrentPageIndex())()` **This method is deprecated.** Deprecated in Java |
| `abstract int` | `[getPageCount](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageCount())()` **This method is deprecated.** Deprecated in Java |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html` | `[getPageDescription](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageDescription(int))(int pageIndex)` **This method is deprecated.** Deprecated in Java |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html` | `[getPageTitle](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageTitle(int))(int pageIndex)` **This method is deprecated.** Deprecated in Java |
| `final boolean` | `[isLogoAnimationFinished](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#isLogoAnimationFinished())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[moveToNextPage](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#moveToNextPage())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[moveToPreviousPage](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#moveToPreviousPage())()` **This method is deprecated.** Deprecated in Java |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | `[onCreateBackgroundView](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateBackgroundView(android.view.LayoutInflater,android.view.ViewGroup))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html inflater, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/ViewGroup.html container )` **This method is deprecated.** Deprecated in Java |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | `[onCreateContentView](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateContentView(android.view.LayoutInflater,android.view.ViewGroup))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html inflater, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/ViewGroup.html container )` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/animation/Animator.html` | `[onCreateDescriptionAnimator](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateDescriptionAnimator())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/animation/Animator.html` | `[onCreateEnterAnimation](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateEnterAnimation())()` **This method is deprecated.** Deprecated in Java |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | `[onCreateForegroundView](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateForegroundView(android.view.LayoutInflater,android.view.ViewGroup))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html inflater, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/ViewGroup.html container )` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/animation/Animator.html` | `[onCreateLogoAnimation](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateLogoAnimation())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/animation/Animator.html` | `[onCreateTitleAnimator](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateTitleAnimator())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[onFinishFragment](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onFinishFragment())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[onLogoAnimationFinished](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onLogoAnimationFinished())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[onPageChanged](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onPageChanged(int,int))(int newPage, int previousPage)` **This method is deprecated.** Deprecated in Java |
| `final void` | `[startEnterAnimation](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#startEnterAnimation(boolean))(boolean force)` **This method is deprecated.** Deprecated in Java |

### Inherited Constants

From [android.content.ComponentCallbacks2](https://developer.android.com/reference/android/content/ComponentCallbacks2.html) `static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_BACKGROUND = 40`

**This field is deprecated.** Deprecated in Java
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_COMPLETE = 80`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_MODERATE = 60`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_CRITICAL = 15`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_LOW = 10`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_MODERATE = 5`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_UI_HIDDEN = 20`

**This field is deprecated.** Deprecated in Java

### Inherited methods

From [android.app.Fragment](https://developer.android.com/reference/android/app/Fragment.html) `void` `[dump](https://developer.android.com/reference/android/app/Fragment.html#dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]))(https://developer.android.com/reference/java/lang/String.html prefix, https://developer.android.com/reference/java/io/FileDescriptor.html fd, https://developer.android.com/reference/java/io/PrintWriter.html writer, String[] args)`

**This method is deprecated.**
`final boolean` `[equals](https://developer.android.com/reference/android/app/Fragment.html#equals(java.lang.Object))(https://developer.android.com/reference/java/lang/Object.html o)`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/Activity.html` `[getActivity](https://developer.android.com/reference/android/app/Fragment.html#getActivity())()`

**This method is deprecated.**
`boolean` `[getAllowEnterTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#getAllowEnterTransitionOverlap())()`

**This method is deprecated.**
`boolean` `[getAllowReturnTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#getAllowReturnTransitionOverlap())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/os/Bundle.html` `[getArguments](https://developer.android.com/reference/android/app/Fragment.html#getArguments())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/FragmentManager.html` `[getChildFragmentManager](https://developer.android.com/reference/android/app/Fragment.html#getChildFragmentManager())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/content/Context.html` `[getContext](https://developer.android.com/reference/android/app/Fragment.html#getContext())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#getEnterTransition())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getExitTransition](https://developer.android.com/reference/android/app/Fragment.html#getExitTransition())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/FragmentManager.html` `[getFragmentManager](https://developer.android.com/reference/android/app/Fragment.html#getFragmentManager())()`

**This method is deprecated.**
`final https://developer.android.com/reference/java/lang/Object.html` `[getHost](https://developer.android.com/reference/android/app/Fragment.html#getHost())()`

**This method is deprecated.**
`final int` `[getId](https://developer.android.com/reference/android/app/Fragment.html#getId())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/view/LayoutInflater.html` `[getLayoutInflater](https://developer.android.com/reference/android/app/Fragment.html#getLayoutInflater())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/app/LoaderManager.html` `[getLoaderManager](https://developer.android.com/reference/android/app/Fragment.html#getLoaderManager())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/Fragment.html` `[getParentFragment](https://developer.android.com/reference/android/app/Fragment.html#getParentFragment())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getReenterTransition](https://developer.android.com/reference/android/app/Fragment.html#getReenterTransition())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/content/res/Resources.html` `[getResources](https://developer.android.com/reference/android/app/Fragment.html#getResources())()`

**This method is deprecated.**
`final boolean` `[getRetainInstance](https://developer.android.com/reference/android/app/Fragment.html#getRetainInstance())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#getReturnTransition())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getSharedElementEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#getSharedElementEnterTransition())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getSharedElementReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#getSharedElementReturnTransition())()`

**This method is deprecated.**
`final https://developer.android.com/reference/java/lang/String.html` `[getString](https://developer.android.com/reference/android/app/Fragment.html#getString(int))(int resId)`

**This method is deprecated.**
`final https://developer.android.com/reference/java/lang/String.html` `[getTag](https://developer.android.com/reference/android/app/Fragment.html#getTag())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/Fragment.html` `[getTargetFragment](https://developer.android.com/reference/android/app/Fragment.html#getTargetFragment())()`

**This method is deprecated.**
`final int` `[getTargetRequestCode](https://developer.android.com/reference/android/app/Fragment.html#getTargetRequestCode())()`

**This method is deprecated.**
`final https://developer.android.com/reference/java/lang/CharSequence.html` `[getText](https://developer.android.com/reference/android/app/Fragment.html#getText(int))(int resId)`

**This method is deprecated.**
`boolean` `[getUserVisibleHint](https://developer.android.com/reference/android/app/Fragment.html#getUserVisibleHint())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/view/View.html` `[getView](https://developer.android.com/reference/android/app/Fragment.html#getView())()`

**This method is deprecated.**
`final int` `[hashCode](https://developer.android.com/reference/android/app/Fragment.html#hashCode())()`

**This method is deprecated.**
`static https://developer.android.com/reference/android/app/Fragment.html` `[instantiate](https://developer.android.com/reference/android/app/Fragment.html#instantiate(android.content.Context, java.lang.String))(https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/java/lang/String.html fname)`

**This method is deprecated.**
`final boolean` `[isAdded](https://developer.android.com/reference/android/app/Fragment.html#isAdded())()`

**This method is deprecated.**
`final boolean` `[isDetached](https://developer.android.com/reference/android/app/Fragment.html#isDetached())()`

**This method is deprecated.**
`final boolean` `[isHidden](https://developer.android.com/reference/android/app/Fragment.html#isHidden())()`

**This method is deprecated.**
`final boolean` `[isInLayout](https://developer.android.com/reference/android/app/Fragment.html#isInLayout())()`

**This method is deprecated.**
`final boolean` `[isRemoving](https://developer.android.com/reference/android/app/Fragment.html#isRemoving())()`

**This method is deprecated.**
`final boolean` `[isResumed](https://developer.android.com/reference/android/app/Fragment.html#isResumed())()`

**This method is deprecated.**
`final boolean` `[isStateSaved](https://developer.android.com/reference/android/app/Fragment.html#isStateSaved())()`

**This method is deprecated.**
`final boolean` `[isVisible](https://developer.android.com/reference/android/app/Fragment.html#isVisible())()`

**This method is deprecated.**
`void` `[onActivityCreated](https://developer.android.com/reference/android/app/Fragment.html#onActivityCreated(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**
`void` `[onActivityResult](https://developer.android.com/reference/android/app/Fragment.html#onActivityResult(int, int, android.content.Intent))(int requestCode, int resultCode, https://developer.android.com/reference/android/content/Intent.html data)`

**This method is deprecated.**
`void` `[onAttach](https://developer.android.com/reference/android/app/Fragment.html#onAttach(android.app.Activity))(https://developer.android.com/reference/android/app/Activity.html activity)`

**This method is deprecated.**
`void` `[onAttachFragment](https://developer.android.com/reference/android/app/Fragment.html#onAttachFragment(android.app.Fragment))(https://developer.android.com/reference/android/app/Fragment.html childFragment)`

**This method is deprecated.**
`void` `[onConfigurationChanged](https://developer.android.com/reference/android/app/Fragment.html#onConfigurationChanged(android.content.res.Configuration))(https://developer.android.com/reference/android/content/res/Configuration.html newConfig)`

**This method is deprecated.**
`boolean` `[onContextItemSelected](https://developer.android.com/reference/android/app/Fragment.html#onContextItemSelected(android.view.MenuItem))(https://developer.android.com/reference/android/view/MenuItem.html item)`

**This method is deprecated.**
`void` `[onCreate](https://developer.android.com/reference/android/app/Fragment.html#onCreate(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**
`https://developer.android.com/reference/android/animation/Animator.html` `[onCreateAnimator](https://developer.android.com/reference/android/app/Fragment.html#onCreateAnimator(int, boolean, int))(int transit, boolean enter, int nextAnim)`

**This method is deprecated.**
`void` `[onCreateContextMenu](https://developer.android.com/reference/android/app/Fragment.html#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo))(
https://developer.android.com/reference/android/view/ContextMenu.html menu,
https://developer.android.com/reference/android/view/View.html v,
https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html menuInfo
)`

**This method is deprecated.**
`void` `[onCreateOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater))(https://developer.android.com/reference/android/view/Menu.html menu, https://developer.android.com/reference/android/view/MenuInflater.html inflater)`

**This method is deprecated.**
`void` `[onDestroy](https://developer.android.com/reference/android/app/Fragment.html#onDestroy())()`

**This method is deprecated.**
`void` `[onDestroyOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onDestroyOptionsMenu())()`

**This method is deprecated.**
`void` `[onDestroyView](https://developer.android.com/reference/android/app/Fragment.html#onDestroyView())()`

**This method is deprecated.**
`void` `[onDetach](https://developer.android.com/reference/android/app/Fragment.html#onDetach())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/view/LayoutInflater.html` `[onGetLayoutInflater](https://developer.android.com/reference/android/app/Fragment.html#onGetLayoutInflater(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**
`void` `[onHiddenChanged](https://developer.android.com/reference/android/app/Fragment.html#onHiddenChanged(boolean))(boolean hidden)`

**This method is deprecated.**
`void` `[onInflate](https://developer.android.com/reference/android/app/Fragment.html#onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle))(
https://developer.android.com/reference/android/app/Activity.html activity,
https://developer.android.com/reference/android/util/AttributeSet.html attrs,
https://developer.android.com/reference/android/os/Bundle.html savedInstanceState
)`

**This method is deprecated.**
`void` `[onLowMemory](https://developer.android.com/reference/android/app/Fragment.html#onLowMemory())()`

**This method is deprecated.**
`void` `[onMultiWindowModeChanged](https://developer.android.com/reference/android/app/Fragment.html#onMultiWindowModeChanged(boolean))(boolean isInMultiWindowMode)`

**This method is deprecated.**
`boolean` `[onOptionsItemSelected](https://developer.android.com/reference/android/app/Fragment.html#onOptionsItemSelected(android.view.MenuItem))(https://developer.android.com/reference/android/view/MenuItem.html item)`

**This method is deprecated.**
`void` `[onOptionsMenuClosed](https://developer.android.com/reference/android/app/Fragment.html#onOptionsMenuClosed(android.view.Menu))(https://developer.android.com/reference/android/view/Menu.html menu)`

**This method is deprecated.**
`void` `[onPause](https://developer.android.com/reference/android/app/Fragment.html#onPause())()`

**This method is deprecated.**
`void` `[onPictureInPictureModeChanged](https://developer.android.com/reference/android/app/Fragment.html#onPictureInPictureModeChanged(boolean))(boolean isInPictureInPictureMode)`

**This method is deprecated.**
`void` `[onPrepareOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onPrepareOptionsMenu(android.view.Menu))(https://developer.android.com/reference/android/view/Menu.html menu)`

**This method is deprecated.**
`void` `[onRequestPermissionsResult](https://developer.android.com/reference/android/app/Fragment.html#onRequestPermissionsResult(int, java.lang.String[], int[]))(
int requestCode,
String[] permissions,
int[] grantResults
)`

**This method is deprecated.**
`void` `[onResume](https://developer.android.com/reference/android/app/Fragment.html#onResume())()`

**This method is deprecated.**
`void` `[onStart](https://developer.android.com/reference/android/app/Fragment.html#onStart())()`

**This method is deprecated.**
`void` `[onStop](https://developer.android.com/reference/android/app/Fragment.html#onStop())()`

**This method is deprecated.**
`void` `[onTrimMemory](https://developer.android.com/reference/android/app/Fragment.html#onTrimMemory(int))(int level)`

**This method is deprecated.**
`void` `[onViewStateRestored](https://developer.android.com/reference/android/app/Fragment.html#onViewStateRestored(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**
`void` `[postponeEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#postponeEnterTransition())()`

**This method is deprecated.**
`void` `[registerForContextMenu](https://developer.android.com/reference/android/app/Fragment.html#registerForContextMenu(android.view.View))(https://developer.android.com/reference/android/view/View.html view)`

**This method is deprecated.**
`final void` `[requestPermissions](https://developer.android.com/reference/android/app/Fragment.html#requestPermissions(java.lang.String[], int))(String[] permissions, int requestCode)`

**This method is deprecated.**
`void` `[setAllowEnterTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#setAllowEnterTransitionOverlap(boolean))(boolean allow)`

**This method is deprecated.**
`void` `[setAllowReturnTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#setAllowReturnTransitionOverlap(boolean))(boolean allow)`

**This method is deprecated.**
`void` `[setArguments](https://developer.android.com/reference/android/app/Fragment.html#setArguments(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html args)`

**This method is deprecated.**
`void` `[setEnterSharedElementCallback](https://developer.android.com/reference/android/app/Fragment.html#setEnterSharedElementCallback(android.app.SharedElementCallback))(https://developer.android.com/reference/android/app/SharedElementCallback.html callback)`

**This method is deprecated.**
`void` `[setEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#setEnterTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setExitSharedElementCallback](https://developer.android.com/reference/android/app/Fragment.html#setExitSharedElementCallback(android.app.SharedElementCallback))(https://developer.android.com/reference/android/app/SharedElementCallback.html callback)`

**This method is deprecated.**
`void` `[setExitTransition](https://developer.android.com/reference/android/app/Fragment.html#setExitTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setHasOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#setHasOptionsMenu(boolean))(boolean hasMenu)`

**This method is deprecated.**
`void` `[setInitialSavedState](https://developer.android.com/reference/android/app/Fragment.html#setInitialSavedState(android.app.Fragment.SavedState))(https://developer.android.com/reference/android/app/Fragment.SavedState.html state)`

**This method is deprecated.**
`void` `[setMenuVisibility](https://developer.android.com/reference/android/app/Fragment.html#setMenuVisibility(boolean))(boolean menuVisible)`

**This method is deprecated.**
`void` `[setReenterTransition](https://developer.android.com/reference/android/app/Fragment.html#setReenterTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setRetainInstance](https://developer.android.com/reference/android/app/Fragment.html#setRetainInstance(boolean))(boolean retain)`

**This method is deprecated.**
`void` `[setReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#setReturnTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setSharedElementEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#setSharedElementEnterTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setSharedElementReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#setSharedElementReturnTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setTargetFragment](https://developer.android.com/reference/android/app/Fragment.html#setTargetFragment(android.app.Fragment, int))(https://developer.android.com/reference/android/app/Fragment.html fragment, int requestCode)`

**This method is deprecated.**
`void` `[setUserVisibleHint](https://developer.android.com/reference/android/app/Fragment.html#setUserVisibleHint(boolean))(boolean isVisibleToUser)`

**This method is deprecated.**
`boolean` `[shouldShowRequestPermissionRationale](https://developer.android.com/reference/android/app/Fragment.html#shouldShowRequestPermissionRationale(java.lang.String))(https://developer.android.com/reference/java/lang/String.html permission)`

**This method is deprecated.**
`void` `[startActivity](https://developer.android.com/reference/android/app/Fragment.html#startActivity(android.content.Intent))(https://developer.android.com/reference/android/content/Intent.html intent)`

**This method is deprecated.**
`void` `[startActivityForResult](https://developer.android.com/reference/android/app/Fragment.html#startActivityForResult(android.content.Intent, int))(https://developer.android.com/reference/android/content/Intent.html intent, int requestCode)`

**This method is deprecated.**
`void` `[startIntentSenderForResult](https://developer.android.com/reference/android/app/Fragment.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle))(
https://developer.android.com/reference/android/content/IntentSender.html intent,
int requestCode,
https://developer.android.com/reference/android/content/Intent.html fillInIntent,
int flagsMask,
int flagsValues,
int extraFlags,
https://developer.android.com/reference/android/os/Bundle.html options
)`

**This method is deprecated.**
`void` `[startPostponedEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#startPostponedEnterTransition())()`

**This method is deprecated.**
`https://developer.android.com/reference/java/lang/String.html` `[toString](https://developer.android.com/reference/android/app/Fragment.html#toString())()`

**This method is deprecated.**
`void` `[unregisterForContextMenu](https://developer.android.com/reference/android/app/Fragment.html#unregisterForContextMenu(android.view.View))(https://developer.android.com/reference/android/view/View.html view)`

**This method is deprecated.**

## Public constructors

### OnboardingFragment

Added in 1.1.0 Deprecated in 1.1.0

```
public [OnboardingFragment](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#OnboardingFragment())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

## Public methods

### getArrowBackgroundColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final @ColorInt int [getArrowBackgroundColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getArrowBackgroundColor())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the background color of the arrow if it's set through `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setArrowBackgroundColor(int)`. If no color was set, transparent is returned.

### getArrowColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final @ColorInt int [getArrowColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getArrowColor())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the color of the arrow if it's set through `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setArrowColor(int)`. If no color was set, transparent is returned.

### getDescriptionViewTextColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final @ColorInt int [getDescriptionViewTextColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getDescriptionViewTextColor())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the text color of DescriptionView if it's set through `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setDescriptionViewTextColor(int)`. If no color was set, transparent is returned.

### getDotBackgroundColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final @ColorInt int [getDotBackgroundColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getDotBackgroundColor())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the background color of the dot if it's set through `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setDotBackgroundColor(int)`. If no color was set, transparent is returned.

### getIconResourceId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final int [getIconResourceId](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getIconResourceId())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the resource id of the main icon.

### getLogoResourceId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final int [getLogoResourceId](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getLogoResourceId())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the resource ID of the splash logo image.

| Returns |
|---|---|
| `int` | The resource ID of the splash logo image. |

### getStartButtonText

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final @Nullable CharSequence [getStartButtonText](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getStartButtonText())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the start button text if it's set through `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setStartButtonText(java.lang.CharSequence)`}. If no string was set, null is returned.

### getTitleViewTextColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final @ColorInt int [getTitleViewTextColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getTitleViewTextColor())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the text color of TitleView if it's set through `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setTitleViewTextColor(int)`. If no color was set, transparent is returned.

### onCreateView

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public @Nullable View [onCreateView](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle))(
    LayoutInflater inflater,
    @Nullable ViewGroup container,
    Bundle savedInstanceState
)
```

> [!CAUTION]
> **This method is deprecated.**   

### onProvideTheme

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public int [onProvideTheme](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onProvideTheme())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the theme used for styling the fragment. The default returns -1, indicating that the host Activity's theme should be used.

| Returns |
|---|---|
| `int` | The theme resource ID of the theme to use in this fragment, or -1 to use the host Activity's theme. |

### onSaveInstanceState

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [onSaveInstanceState](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onSaveInstanceState(android.os.Bundle))(Bundle outState)
```

> [!CAUTION]
> **This method is deprecated.**   

### onViewCreated

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [onViewCreated](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onViewCreated(android.view.View,android.os.Bundle))(@NonNull View view, @Nullable Bundle savedInstanceState)
```

> [!CAUTION]
> **This method is deprecated.**   

### setArrowBackgroundColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [setArrowBackgroundColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setArrowBackgroundColor(int))(@ColorInt int color)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the background color of the arrow. If not set, the default color from attr in the theme will be used.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int color` | the color to use for arrow background |

### setArrowColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [setArrowColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setArrowColor(int))(@ColorInt int color)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the color of the arrow. This color will supersede the color set in the theme attribute if provided. If none of these two are set, the arrow will have its original bitmap color.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int color` | the color to use for arrow background |

### setDescriptionViewTextColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [setDescriptionViewTextColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setDescriptionViewTextColor(int))(@ColorInt int color)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the text color for DescriptionView. If not set, the default textColor set in style referenced by attr will be used.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int color` | the color to use as the text color for DescriptionView |

### setDotBackgroundColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [setDotBackgroundColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setDotBackgroundColor(int))(@ColorInt int color)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the background color of the dots. If not set, the default color from attr in the theme will be used.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int color` | the color to use for dot backgrounds |

### setIconResouceId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final void [setIconResouceId](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setIconResouceId(int))(int resourceId)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the resource id for the main icon.

### setLogoResourceId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public final void [setLogoResourceId](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setLogoResourceId(int))(int id)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the resource ID of the splash logo image. If the logo resource id set, the default logo splash animation will be played.

| Parameters |
|---|---|
| `int id` | The resource ID of the logo image. |

### setStartButtonText

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [setStartButtonText](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setStartButtonText(java.lang.CharSequence))(@Nullable CharSequence text)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the text on the start button text. If not set, the default text set in will be used.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html text` | the start button text |

### setTitleViewTextColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void [setTitleViewTextColor](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setTitleViewTextColor(int))(@ColorInt int color)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets the text color for TitleView. If not set, the default textColor set in style referenced by attr will be used.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int color` | the color to use as the text color for TitleView |

## Protected methods

### getCurrentPageIndex

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected final int [getCurrentPageIndex](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getCurrentPageIndex())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the index of the current page.

| Returns |
|---|---|
| `int` | The index of the current page. |

### getPageCount

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected abstract int [getPageCount](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageCount())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the page count.

| Returns |
|---|---|
| `int` | The page count. |

### getPageDescription

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected abstract @Nullable CharSequence [getPageDescription](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageDescription(int))(int pageIndex)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the description of the given page.

| Parameters |
|---|---|
| `int pageIndex` | The page index. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html` | The description of the page. |

### getPageTitle

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected abstract @Nullable CharSequence [getPageTitle](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#getPageTitle(int))(int pageIndex)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the title of the given page.

| Parameters |
|---|---|
| `int pageIndex` | The page index. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html` | The title of the page. |

### isLogoAnimationFinished

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected final boolean [isLogoAnimationFinished](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#isLogoAnimationFinished())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns whether the logo enter animation is finished.

| Returns |
|---|---|
| `boolean` | `true` if the logo enter transition is finished, `false` otherwise |

### moveToNextPage

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected void [moveToNextPage](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#moveToNextPage())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Navigates to the next page.

### moveToPreviousPage

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected void [moveToPreviousPage](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#moveToPreviousPage())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Navigates to the previous page.

### onCreateBackgroundView

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected abstract @Nullable View [onCreateBackgroundView](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateBackgroundView(android.view.LayoutInflater,android.view.ViewGroup))(
    @NonNull LayoutInflater inflater,
    @NonNull ViewGroup container
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called to have the inherited class create background view. This is optional and the fragment which doesn't have the background view can return `null`. This is called inside `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html inflater` | The LayoutInflater object that can be used to inflate the views, |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/ViewGroup.html container` | The parent view that the additional views are attached to.The fragment should not add the view by itself. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | The background view for the onboarding screen, or `null`. |

### onCreateContentView

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected abstract @Nullable View [onCreateContentView](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateContentView(android.view.LayoutInflater,android.view.ViewGroup))(
    @NonNull LayoutInflater inflater,
    @NonNull ViewGroup container
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called to have the inherited class create content view. This is optional and the fragment which doesn't have the content view can return `null`. This is called inside `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`.

The content view would be located at the center of the screen.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html inflater` | The LayoutInflater object that can be used to inflate the views, |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/ViewGroup.html container` | The parent view that the additional views are attached to.The fragment should not add the view by itself. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | The content view for the onboarding screen, or `null`. |

### onCreateDescriptionAnimator

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected @NonNull Animator [onCreateDescriptionAnimator](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateDescriptionAnimator())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Provides the entry animation for description view. This allows users to override the default fade and slide animation. Returning null will disable the animation.

### onCreateEnterAnimation

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected @Nullable Animator [onCreateEnterAnimation](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateEnterAnimation())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called to have the inherited class create its enter animation. The start animation runs after logo animation ends.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/animation/Animator.html` | The `https://developer.android.com/reference/android/animation/Animator.html` object which runs the page enter animation. |

### onCreateForegroundView

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected abstract @Nullable View [onCreateForegroundView](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateForegroundView(android.view.LayoutInflater,android.view.ViewGroup))(
    @NonNull LayoutInflater inflater,
    @NonNull ViewGroup container
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called to have the inherited class create foreground view. This is optional and the fragment which doesn't need the foreground view can return `null`. This is called inside `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)`.

This foreground view would have the highest z-order.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/LayoutInflater.html inflater` | The LayoutInflater object that can be used to inflate the views, |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/ViewGroup.html container` | The parent view that the additional views are attached to.The fragment should not add the view by itself. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html` | The foreground view for the onboarding screen, or `null`. |

### onCreateLogoAnimation

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected @Nullable Animator [onCreateLogoAnimation](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateLogoAnimation())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called to have the inherited class create its own logo animation.

This is called only if the logo image resource ID is not set by `https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#setLogoResourceId(int)`. If this returns `null`, the logo animation is skipped.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/animation/Animator.html` | The `https://developer.android.com/reference/android/animation/Animator.html` object which runs the logo animation. |

### onCreateTitleAnimator

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected @NonNull Animator [onCreateTitleAnimator](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onCreateTitleAnimator())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Provides the entry animation for title view. This allows users to override the default fade and slide animation. Returning null will disable the animation.

### onFinishFragment

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected void [onFinishFragment](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onFinishFragment())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called when the onboarding flow finishes.

### onLogoAnimationFinished

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected void [onLogoAnimationFinished](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onLogoAnimationFinished())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called immediately after the logo animation is complete or no logo animation is specified. This method can also be called when the activity is recreated, i.e. when no logo animation are performed. By default, this method will hide the logo view and start the entrance animation for this fragment. Overriding subclasses can provide their own data loading logic as to when the entrance animation should be executed.

### onPageChanged

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected void [onPageChanged](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#onPageChanged(int,int))(int newPage, int previousPage)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called when the page has been changed.

| Parameters |
|---|---|
| `int newPage` | The new page. |
| `int previousPage` | The previous page. |

### startEnterAnimation

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
protected final void [startEnterAnimation](https://developer.android.com/reference/androidx/leanback/app/OnboardingFragment#startEnterAnimation(boolean))(boolean force)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called to start entrance transition. This can be called by subclasses when the logo animation and data loading is complete. If force flag is set to false, it will only start the animation if it's not already done yet. Otherwise, it will always start the enter animation. In both cases, the logo view will hide and the rest of fragment views become visible after this call.

| Parameters |
|---|---|
| `boolean force` | `true` if enter animation has to be performed regardless of whether it's been done in the past, `false` otherwise |