当前位置: 首页>>代码示例>>Java>>正文


Java XWalkNavigationHistory类代码示例

本文整理汇总了Java中org.xwalk.core.XWalkNavigationHistory的典型用法代码示例。如果您正苦于以下问题:Java XWalkNavigationHistory类的具体用法?Java XWalkNavigationHistory怎么用?Java XWalkNavigationHistory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XWalkNavigationHistory类属于org.xwalk.core包,在下文中一共展示了XWalkNavigationHistory类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: receiveCommand

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
@Override
public void receiveCommand (CrosswalkWebView view, int commandId, @Nullable ReadableArray args) {
    switch (commandId) {
        case GO_BACK:
            view.getNavigationHistory().navigate(XWalkNavigationHistory.Direction.BACKWARD, 1);
            break;
        case GO_FORWARD:
            view.getNavigationHistory().navigate(XWalkNavigationHistory.Direction.FORWARD, 1);
            break;
        case RELOAD:
            view.reload(XWalkView.RELOAD_NORMAL);
            break;
        case POST_MESSAGE:
            try {
                JSONObject eventInitDict = new JSONObject();
                eventInitDict.put("data", args.getString(0));
                view.evaluateJavascript("document.dispatchEvent(new MessageEvent('message', " + eventInitDict.toString() + "))", null);
            } catch (JSONException e) {
                throw new RuntimeException(e);
            }
            break;
    }
}
 
开发者ID:KingBarbarian,项目名称:react-native-android-new-crosswalk,代码行数:24,代码来源:CrosswalkWebViewGroupManager.java

示例2: onLoadFinished

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
@Override
public void onLoadFinished (XWalkView view, String url) {
    ((CrosswalkWebView) view).linkBridge();
    ((CrosswalkWebView) view).callInjectedJavaScript();

    XWalkNavigationHistory navigationHistory = view.getNavigationHistory();
    eventDispatcher.dispatchEvent(
        new NavigationStateChangeEvent(
            getId(),
            SystemClock.uptimeMillis(),
            view.getTitle(),
            false,
            url,
            navigationHistory.canGoBack(),
            navigationHistory.canGoForward()
        )
    );

}
 
开发者ID:KingBarbarian,项目名称:react-native-android-new-crosswalk,代码行数:20,代码来源:CrosswalkWebView.java

示例3: onLoadStarted

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
@Override
public void onLoadStarted (XWalkView view, String url) {
    XWalkNavigationHistory navigationHistory = view.getNavigationHistory();
    eventDispatcher.dispatchEvent(
        new NavigationStateChangeEvent(
            getId(),
            SystemClock.uptimeMillis(),
            view.getTitle(),
            true,
            url,
            navigationHistory.canGoBack(),
            navigationHistory.canGoForward()
        )
    );
}
 
开发者ID:KingBarbarian,项目名称:react-native-android-new-crosswalk,代码行数:16,代码来源:CrosswalkWebView.java

示例4: goBack

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
@Override
public boolean goBack() {
    if (this.webView.getNavigationHistory().canGoBack()) {
        this.webView.getNavigationHistory().navigate(XWalkNavigationHistory.Direction.BACKWARD, 1);
        return true;
    }
    return false;
}
 
开发者ID:infil00p,项目名称:cordova-plugin-crosswalk-webview,代码行数:9,代码来源:XWalkWebViewEngine.java

示例5: backHistory

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
/**
 * Go to previous page in history.  (We manage our own history)
 *
 * @return true if we went back, false if we are already at top
 */
@Override
public boolean backHistory() {

    // Check webview first to see if there is a history
    // This is needed to support curPage#diffLink, since they are added to appView's history, but not our history url array (JQMobile behavior)
    if (this.webview.getNavigationHistory().canGoBack()) {
        printBackForwardList();
        this.webview.getNavigationHistory().navigate(XWalkNavigationHistory.Direction.BACKWARD, 1);

        return true;
    }
    return false;
}
 
开发者ID:ZachMoreno,项目名称:krakn,代码行数:19,代码来源:XWalkCordovaWebView.java

示例6: printBackForwardList

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
public void printBackForwardList() {
	XWalkNavigationHistory currentList = this.webview.getNavigationHistory();
	int currentSize = currentList.size();
    LOG.d(TAG, "My URL is " + webview.getUrl());
    LOG.d(TAG, "navigation history:");
    for(int i = 0; i < currentSize; ++i)
    {
    	XWalkNavigationItem item = currentList.getItemAt(i);
        String url = item.getUrl();
        LOG.d(TAG, "The URL at index: " + Integer.toString(i) + " is " + url );
    }
}
 
开发者ID:ZachMoreno,项目名称:krakn,代码行数:13,代码来源:XWalkCordovaWebView.java

示例7: startOfHistory

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
public boolean startOfHistory()
{
	XWalkNavigationHistory currentList = this.webview.getNavigationHistory();
	XWalkNavigationItem item = currentList.getItemAt(0);
    if( item!=null){	// Null-fence in case they haven't called loadUrl yet (CB-2458)
     String url = item.getUrl();
     String currentUrl = this.webview.getUrl();
     LOG.d(TAG, "The current URL is: " + currentUrl);
     LOG.d(TAG, "The URL at item 0 is: " + url);
     return currentUrl.equals(url);
    }
    return false;
}
 
开发者ID:ZachMoreno,项目名称:krakn,代码行数:14,代码来源:XWalkCordovaWebView.java

示例8: backHistory

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
/**
 * Go to previous page in history.  (We manage our own history)
 *
 * @return true if we went back, false if we are already at top
 */
public boolean backHistory() {
    // Check webview first to see if there is a history
    // This is needed to support curPage#diffLink, since they are added to appView's history, but not our history url array (JQMobile behavior)
    if (super.getNavigationHistory().canGoBack()) {
        super.getNavigationHistory().navigate(XWalkNavigationHistory.Direction.BACKWARD, 1);
        return true;
    }
    return false;
}
 
开发者ID:Hanul,项目名称:Wetube,代码行数:15,代码来源:CordovaWebView.java

示例9: printBackForwardList

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
public void printBackForwardList() {
    XWalkNavigationHistory currentList = this.getNavigationHistory();
    int currentSize = currentList.size();
    for(int i = 0; i < currentSize; ++i)
    {
        XWalkNavigationItem item = currentList.getItemAt(i);
        String url = item.getUrl();
        LOG.d(TAG, "The URL at index: " + Integer.toString(i) + " is " + url );
    }
}
 
开发者ID:Hanul,项目名称:Wetube,代码行数:11,代码来源:CordovaWebView.java

示例10: startOfHistory

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
public boolean startOfHistory()
{
    XWalkNavigationHistory currentList = this.getNavigationHistory();
    XWalkNavigationItem item = currentList.getItemAt(0);
    if( item!=null){	// Null-fence in case they haven't called loadUrl yet (CB-2458)
     String url = item.getUrl();
     String currentUrl = this.getUrl();
     LOG.d(TAG, "The current URL is: " + currentUrl);
     LOG.d(TAG, "The URL at item 0 is: " + url);
     return currentUrl.equals(url);
    }
    return false;
}
 
开发者ID:Hanul,项目名称:Wetube,代码行数:14,代码来源:CordovaWebView.java

示例11: onKeyDown

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
@Override
public boolean onKeyDown(int keyCode, @NonNull KeyEvent event){
    if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.getNavigationHistory().canGoBack()){
        webView.getNavigationHistory().navigate(XWalkNavigationHistory.Direction.BACKWARD, 1);
        return true;
    }
    return super.onKeyDown(keyCode, event);
}
 
开发者ID:bakerframework,项目名称:baker-android-refactor,代码行数:9,代码来源:ModalActivity.java

示例12: goForward

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
public void goForward() {
	getNavigationHistory().navigate(
			XWalkNavigationHistory.Direction.FORWARD, 1);
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:5,代码来源:ACEWebView.java

示例13: goBack

import org.xwalk.core.XWalkNavigationHistory; //导入依赖的package包/类
public void goBack() {
	getNavigationHistory().navigate(
			XWalkNavigationHistory.Direction.BACKWARD, 1);
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:5,代码来源:ACEWebView.java


注:本文中的org.xwalk.core.XWalkNavigationHistory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。