ErrorFragment

Added in 1.1.0
Deprecated in 1.1.0

public class ErrorFragment extends BrandedFragment


A fragment for displaying an error indication.

Summary

Public constructors

Public methods

@Nullable Drawable

Returns the background drawable.

@Nullable View.OnClickListener

Returns the button click listener.

@Nullable String

Returns the button text.

@Nullable Drawable

Returns the drawable used for the error image.

@Nullable CharSequence

Returns the error message.

boolean

Returns true if the background is translucent.

@Nullable View
onCreateView(
    LayoutInflater inflater,
    @Nullable ViewGroup container,
    Bundle savedInstanceState
)

This method is deprecated.

void

This method is deprecated.

void

Sets a drawable for the fragment background.

void

Set the button click listener.

void

Sets the button text.

void
setDefaultBackground(boolean translucent)

Sets the default background.

void

Sets the drawable to be used for the error image.

void

Sets the error message.

Inherited Constants

From android.content.ComponentCallbacks2
static final int
static final int
static final int
static final int
static final int
static final int
static final int

Inherited methods

From androidx.leanback.app.BrandedFragment
@Nullable Drawable

Returns the badge drawable used in the fragment title.

int

Returns the color used to draw the search affordance.

@Nullable SearchOrbView.Colors

Returns the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.

@Nullable CharSequence

Returns the title text for the fragment.

@Nullable View

Returns the view that implements TitleViewAdapter.Provider.

@Nullable TitleViewAdapter

Returns the TitleViewAdapter implemented by title view.

void
installTitleView(
    @NonNull LayoutInflater inflater,
    @NonNull ViewGroup parent,
    @Nullable Bundle savedInstanceState
)

Inflate title view and add to parent.

final boolean

Returns true/false to indicate the visibility of TitleView.

void

This method is deprecated.

@NonNull View
onInflateTitleView(
    @NonNull LayoutInflater inflater,
    @Nullable ViewGroup parent,
    @Nullable Bundle savedInstanceState
)

Called by installTitleView to inflate title view.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)

This method is deprecated.

void

Sets the drawable displayed in the fragment title.

void

Sets a click listener for the search affordance.

void

Sets the color used to draw the search affordance.

void

Sets the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.

void

Sets title text for the fragment.

void

Sets the view that implemented TitleViewAdapter.

void
showTitle(int flags)

Changes title view's components visibility and shows title.

void
showTitle(boolean show)

Shows or hides the title view.

From android.app.Fragment
void
dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)

This method is deprecated.

final boolean

This method is deprecated.

final Activity

This method is deprecated.

boolean

This method is deprecated.

boolean

This method is deprecated.

final Bundle

This method is deprecated.

final FragmentManager

This method is deprecated.

Context

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

final FragmentManager

This method is deprecated.

final Object

This method is deprecated.

final int

This method is deprecated.

final LayoutInflater

This method is deprecated.

LoaderManager

This method is deprecated.

final Fragment

This method is deprecated.

Transition

This method is deprecated.

final Resources

This method is deprecated.

final boolean

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

final String
getString(int resId)

This method is deprecated.

final String

This method is deprecated.

final Fragment

This method is deprecated.

final int

This method is deprecated.

final CharSequence
getText(int resId)

This method is deprecated.

boolean

This method is deprecated.

View

This method is deprecated.

final int

This method is deprecated.

static Fragment
instantiate(Context context, String fname)

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

void
onActivityCreated(Bundle savedInstanceState)

This method is deprecated.

void
onActivityResult(int requestCode, int resultCode, Intent data)

This method is deprecated.

void
onAttach(Context context)

This method is deprecated.

void
onAttachFragment(Fragment childFragment)

This method is deprecated.

void

This method is deprecated.

boolean

This method is deprecated.

void
onCreate(Bundle savedInstanceState)

This method is deprecated.

Animator
onCreateAnimator(int transit, boolean enter, int nextAnim)

This method is deprecated.

void
onCreateContextMenu(
    ContextMenu menu,
    View v,
    ContextMenu.ContextMenuInfo menuInfo
)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

LayoutInflater
onGetLayoutInflater(Bundle savedInstanceState)

This method is deprecated.

void
onHiddenChanged(boolean hidden)

This method is deprecated.

void
onInflate(AttributeSet attrs, Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void
onMultiWindowModeChanged(
    boolean isInMultiWindowMode,
    Configuration newConfig
)

This method is deprecated.

boolean

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onPictureInPictureModeChanged(
    boolean isInPictureInPictureMode,
    Configuration newConfig
)

This method is deprecated.

void

This method is deprecated.

void
onRequestPermissionsResult(
    int requestCode,
    String[] permissions,
    int[] grantResults
)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onTrimMemory(int level)

This method is deprecated.

void
onViewCreated(View view, Bundle savedInstanceState)

This method is deprecated.

void
onViewStateRestored(Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

final void
requestPermissions(String[] permissions, int requestCode)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setHasOptionsMenu(boolean hasMenu)

This method is deprecated.

void

This method is deprecated.

void
setMenuVisibility(boolean menuVisible)

This method is deprecated.

void

This method is deprecated.

void
setRetainInstance(boolean retain)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setTargetFragment(Fragment fragment, int requestCode)

This method is deprecated.

void
setUserVisibleHint(boolean isVisibleToUser)

This method is deprecated.

boolean

This method is deprecated.

void

This method is deprecated.

void
startActivityForResult(Intent intent, int requestCode)

This method is deprecated.

void
startIntentSenderForResult(
    IntentSender intent,
    int requestCode,
    Intent fillInIntent,
    int flagsMask,
    int flagsValues,
    int extraFlags,
    Bundle options
)

This method is deprecated.

void

This method is deprecated.

String

This method is deprecated.

void

This method is deprecated.

Public constructors

ErrorFragment

Added in 1.1.0
Deprecated in 1.1.0
public ErrorFragment()

Public methods

getBackgroundDrawable

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable Drawable getBackgroundDrawable()

Returns the background drawable. May be null if a default is used.

getButtonClickListener

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable View.OnClickListener getButtonClickListener()

Returns the button click listener.

getButtonText

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable String getButtonText()

Returns the button text.

getImageDrawable

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable Drawable getImageDrawable()

Returns the drawable used for the error image.

getMessage

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable CharSequence getMessage()

Returns the error message.

isBackgroundTranslucent

Added in 1.1.0
Deprecated in 1.1.0
public boolean isBackgroundTranslucent()

Returns true if the background is translucent.

onCreateView

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable View onCreateView(
    LayoutInflater inflater,
    @Nullable ViewGroup container,
    Bundle savedInstanceState
)

onStart

public void onStart()

setBackgroundDrawable

Added in 1.1.0
Deprecated in 1.1.0
public void setBackgroundDrawable(@Nullable Drawable drawable)

Sets a drawable for the fragment background.

Parameters
@Nullable Drawable drawable

The drawable used for the background.

setButtonClickListener

Added in 1.1.0
Deprecated in 1.1.0
public void setButtonClickListener(@Nullable View.OnClickListener clickListener)

Set the button click listener.

Parameters
@Nullable View.OnClickListener clickListener

The click listener for the button.

setButtonText

Added in 1.1.0
Deprecated in 1.1.0
public void setButtonText(@Nullable String text)

Sets the button text.

Parameters
@Nullable String text

The button text.

setDefaultBackground

Added in 1.1.0
Deprecated in 1.1.0
public void setDefaultBackground(boolean translucent)

Sets the default background.

Parameters
boolean translucent

True to set a translucent background.

setImageDrawable

Added in 1.1.0
Deprecated in 1.1.0
public void setImageDrawable(@Nullable Drawable drawable)

Sets the drawable to be used for the error image.

Parameters
@Nullable Drawable drawable

The drawable used for the error image.

setMessage

Added in 1.1.0
Deprecated in 1.1.0
public void setMessage(@Nullable CharSequence message)

Sets the error message.

Parameters
@Nullable CharSequence message

The error message.