public class

NavigationBackStack

extends Object
implements Parcelable
java.lang.Object
   ↳ com.pspdfkit.ui.navigation.NavigationBackStack<T>

Class Overview

Manages a browser like backstack of items.

Summary

Nested Classes
interface NavigationBackStack.BackStackListener<T> Listener for changes to the navigation back stack. 
class NavigationBackStack.NavigationItem<T> A single item on the navigation backstack. 
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<NavigationBackStack> CREATOR
Public Constructors
NavigationBackStack()
Public Methods
void addBackStackListener(BackStackListener<T> backStackListener)
Adds a back stack listener to be notified of changes.
void addItem(T item)
Adds a new item depending on if we are currently going back or forward.
void clearBackStackListeners()
Removes all previously added back stack listeners.
int describeContents()
T getBackItem()
Returns the current top back item, or null.
T getForwardItem()
Returns the current top forward item, or null.
void goBack()
Goes back one step, or does nothing if the stack is already empty.
void goForward()
Goes forward one step, or does nothing if the stack is already empty.
void removeBackStackListener(BackStackListener<T> backStackListener)
Removes the back stack listener.
void replaceWith(NavigationBackStack<T> navigationHistory)
Replaces navigation back stack with another instance.
void resetForwardList()
Removes all forward navigation items.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<NavigationBackStack> CREATOR

Public Constructors

public NavigationBackStack ()

Public Methods

public void addBackStackListener (BackStackListener<T> backStackListener)

Adds a back stack listener to be notified of changes. If the listener has already been added previously, this method will be a no-op. Adding null is not allowed, and will result in an exception.

Parameters
backStackListener NavigationBackStack.BackStackListener that should be notified. Must be non-null.

public void addItem (T item)

Adds a new item depending on if we are currently going back or forward.

Parameters
item The item to add.

public void clearBackStackListeners ()

Removes all previously added back stack listeners. To remove just one listener use removeBackStackListener(NavigationBackStack.BackStackListener). Upon calling this method no listeners will be notified of any changes.

public int describeContents ()

public T getBackItem ()

Returns the current top back item, or null.

public T getForwardItem ()

Returns the current top forward item, or null.

public void goBack ()

Goes back one step, or does nothing if the stack is already empty.

public void goForward ()

Goes forward one step, or does nothing if the stack is already empty.

public void removeBackStackListener (BackStackListener<T> backStackListener)

Removes the back stack listener. Upon calling this method the listener will no longer be notified of any changes. If the listener has not been added, this method will be a no-op. Adding null is not allowed,and will result in an exception.

Parameters
backStackListener NavigationBackStack.BackStackListener that should be removed. Must be non-null.

public void replaceWith (NavigationBackStack<T> navigationHistory)

Replaces navigation back stack with another instance. Keeps all back stack listeners.

Parameters
navigationHistory New navigation back stack.

public void resetForwardList ()

Removes all forward navigation items.

public void writeToParcel (Parcel dest, int flags)