public final class

XWalkNavigationHistory

extends XWalkNavigationHistoryInternal
java.lang.Object
   ↳ XWalkNavigationHistoryInternal
     ↳ org.xwalk.core.XWalkNavigationHistory

Class Overview

This class represents a navigation history for a XWalkView instance. It's not thread-safe and should be only called on UI thread.

Summary

Nested Classes
enum XWalkNavigationHistory.Direction The direction for web page navigation. 
Public Constructors
XWalkNavigationHistory(XWalkNavigationHistoryInternal internal)
Public Methods
boolean canGoBack()
Test whether XWalkView can go back.
boolean canGoForward()
Test whether XWalkView can go forward.
void clear()
Clear all history owned by this XWalkView.
int getCurrentIndex()
Get the index for current navigation item.
XWalkNavigationItem getCurrentItem()
Get the current item which XWalkView displays.
XWalkNavigationItem getItemAt(int index)
Get a specific item given by index.
boolean hasItemAt(int index)
Test whether there is an item at a specific index.
void navigate(XWalkNavigationHistory.Direction direction, int steps)
Navigates to the specified step from the current navigation item.
int size()
Total size of navigation history for the XWalkView.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public XWalkNavigationHistory (XWalkNavigationHistoryInternal internal)

Public Methods

public boolean canGoBack ()

Test whether XWalkView can go back.

Returns
  • true if it can go back.

public boolean canGoForward ()

Test whether XWalkView can go forward.

Returns
  • true if it can go forward.

public void clear ()

Clear all history owned by this XWalkView.

public int getCurrentIndex ()

Get the index for current navigation item.

Returns
  • current index in the navigation history.

public XWalkNavigationItem getCurrentItem ()

Get the current item which XWalkView displays.

Returns
  • the current navigation item.

public XWalkNavigationItem getItemAt (int index)

Get a specific item given by index.

Parameters
index the given index.
Returns
  • the navigation item for the given index.

public boolean hasItemAt (int index)

Test whether there is an item at a specific index.

Parameters
index the given index.
Returns
  • true if there is an item at the specific index.

public void navigate (XWalkNavigationHistory.Direction direction, int steps)

Navigates to the specified step from the current navigation item. Do nothing if the offset is out of bound.

Parameters
direction the direction of navigation.
steps go back or foward with a given steps.

public int size ()

Total size of navigation history for the XWalkView.

Returns
  • the size of total navigation items.