android.webkit.WebChromeClient#CustomViewCallback ( )源码实例Demo

下面列出了android.webkit.WebChromeClient#CustomViewCallback ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
    Log.d(TAG, "showing Custom View");
    // if a view already exists then immediately terminate the new one
    if (mCustomView != null) {
        callback.onCustomViewHidden();
        return;
    }
    
    // Store the view and its callback for later (to kill it properly)
    mCustomView = view;
    mCustomViewCallback = callback;
    
    // Add the custom view to its container.
    ViewGroup parent = (ViewGroup) this.getParent();
    parent.addView(view, COVER_SCREEN_GRAVITY_CENTER);
    
    // Hide the content view.
    this.setVisibility(View.GONE);
    
    // Finally show the custom view container.
    parent.setVisibility(View.VISIBLE);
    parent.bringToFront();
}
 
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
    Log.d(TAG, "showing Custom View");
    // if a view already exists then immediately terminate the new one
    if (mCustomView != null) {
        callback.onCustomViewHidden();
        return;
    }
    
    // Store the view and its callback for later (to kill it properly)
    mCustomView = view;
    mCustomViewCallback = callback;
    
    // Add the custom view to its container.
    ViewGroup parent = (ViewGroup) this.getParent();
    parent.addView(view, COVER_SCREEN_GRAVITY_CENTER);
    
    // Hide the content view.
    this.setVisibility(View.GONE);
    
    // Finally show the custom view container.
    parent.setVisibility(View.VISIBLE);
    parent.bringToFront();
}
 
源代码3 项目: bluemix-parking-meter   文件: CordovaWebView.java
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
    Log.d(TAG, "showing Custom View");
    // if a view already exists then immediately terminate the new one
    if (mCustomView != null) {
        callback.onCustomViewHidden();
        return;
    }
    
    // Store the view and its callback for later (to kill it properly)
    mCustomView = view;
    mCustomViewCallback = callback;
    
    // Add the custom view to its container.
    ViewGroup parent = (ViewGroup) this.getParent();
    parent.addView(view, COVER_SCREEN_GRAVITY_CENTER);
    
    // Hide the content view.
    this.setVisibility(View.GONE);
    
    // Finally show the custom view container.
    parent.setVisibility(View.VISIBLE);
    parent.bringToFront();
}
 
源代码4 项目: fvip   文件: WebVideoActivity.java
/** 视频播放全屏 **/
private void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    // if a view already exists then immediately terminate the new one
    if (customView != null) {
        callback.onCustomViewHidden();
        return;
    }

    WebVideoActivity.this.getWindow().getDecorView();

    FrameLayout decor = (FrameLayout) getWindow().getDecorView();
    fullscreenContainer = new FullscreenHolder(WebVideoActivity.this);
    fullscreenContainer.addView(view, COVER_SCREEN_PARAMS);
    decor.addView(fullscreenContainer, COVER_SCREEN_PARAMS);
    customView = view;
    setStatusBarVisibility(false);
    customViewCallback = callback;
}
 
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
    Log.d(TAG, "showing Custom View");
    // if a view already exists then immediately terminate the new one
    if (mCustomView != null) {
        callback.onCustomViewHidden();
        return;
    }
    
    // Store the view and its callback for later (to kill it properly)
    mCustomView = view;
    mCustomViewCallback = callback;
    
    // Add the custom view to its container.
    ViewGroup parent = (ViewGroup) this.getParent();
    parent.addView(view, COVER_SCREEN_GRAVITY_CENTER);
    
    // Hide the content view.
    this.setVisibility(View.GONE);
    
    // Finally show the custom view container.
    parent.setVisibility(View.VISIBLE);
    parent.bringToFront();
}
 
源代码6 项目: L.TileLayer.Cordova   文件: CordovaWebView.java
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
    Log.d(TAG, "showing Custom View");
    // if a view already exists then immediately terminate the new one
    if (mCustomView != null) {
        callback.onCustomViewHidden();
        return;
    }
    
    // Store the view and its callback for later (to kill it properly)
    mCustomView = view;
    mCustomViewCallback = callback;
    
    // Add the custom view to its container.
    ViewGroup parent = (ViewGroup) this.getParent();
    parent.addView(view, COVER_SCREEN_GRAVITY_CENTER);
    
    // Hide the content view.
    this.setVisibility(View.GONE);
    
    // Finally show the custom view container.
    parent.setVisibility(View.VISIBLE);
    parent.bringToFront();
}
 
@Override
@Deprecated
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
    LOG.d(TAG, "showing Custom View");
    // if a view already exists then immediately terminate the new one
    if (mCustomView != null) {
        callback.onCustomViewHidden();
        return;
    }

    // Store the view and its callback for later (to kill it properly)
    mCustomView = view;
    mCustomViewCallback = callback;

    // Add the custom view to its container.
    ViewGroup parent = (ViewGroup) engine.getView().getParent();
    parent.addView(view, new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT,
            Gravity.CENTER));

    // Hide the content view.
    engine.getView().setVisibility(View.GONE);

    // Finally show the custom view container.
    parent.setVisibility(View.VISIBLE);
    parent.bringToFront();
}
 
源代码8 项目: pychat   文件: CordovaWebViewImpl.java
@Override
@Deprecated
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
    LOG.d(TAG, "showing Custom View");
    // if a view already exists then immediately terminate the new one
    if (mCustomView != null) {
        callback.onCustomViewHidden();
        return;
    }

    // Store the view and its callback for later (to kill it properly)
    mCustomView = view;
    mCustomViewCallback = callback;

    // Add the custom view to its container.
    ViewGroup parent = (ViewGroup) engine.getView().getParent();
    parent.addView(view, new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT,
            Gravity.CENTER));

    // Hide the content view.
    engine.getView().setVisibility(View.GONE);

    // Finally show the custom view container.
    parent.setVisibility(View.VISIBLE);
    parent.bringToFront();
}
 
源代码9 项目: BigDataPlatform   文件: SystemWebChromeClient.java
@Override
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    parentEngine.getCordovaWebView().showCustomView(view, callback);
}
 
源代码10 项目: android-chromium   文件: AwContentsClient.java
public void onShowCustomView(View view,
       int requestedOrientation, WebChromeClient.CustomViewCallback callback) {
}
 
源代码11 项目: AndroidRipper   文件: RobotiumWebClient.java
@Override
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
	if (originalWebChromeClient != null) {
		originalWebChromeClient.onShowCustomView(view, callback);
	} 
}
 
源代码12 项目: Ninja   文件: BrowserActivity.java
@Override
public boolean onShowCustomView(View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback) {
    return onShowCustomView(view, callback);
}
 
源代码13 项目: phonegapbootcampsite   文件: CordovaChromeClient.java
@Override
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    this.appView.showCustomView(view, callback);
}
 
源代码14 项目: Ninja   文件: HolderService.java
@Override
public boolean onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    return true;
}
 
源代码15 项目: Ninja   文件: HolderService.java
@Override
public boolean onShowCustomView(View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback) {
    return true;
}
 
源代码16 项目: android-chromium   文件: AwContentsClient.java
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
    onShowCustomView(view, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, callback);
}
 
源代码17 项目: AgentWeb   文件: IVideo.java
void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback); 
源代码18 项目: JsBridge   文件: OnWebChromeClientListener.java
void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback); 
源代码19 项目: Ninja   文件: BrowserController.java
boolean onShowCustomView(View view, WebChromeClient.CustomViewCallback callback); 
源代码20 项目: Ninja   文件: BrowserController.java
boolean onShowCustomView(View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback);