com.amazon.android.webkit.AmazonWebChromeClient Java Examples

The following examples show how to use com.amazon.android.webkit.AmazonWebChromeClient. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CordovaWebView.java    From cordova-amazon-fireos with Apache License 2.0 6 votes vote down vote up
public void showCustomView(View view, AmazonWebChromeClient.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();
}
 
Example #2
Source File: CordovaChromeClient.java    From cordova-amazon-fireos with Apache License 2.0 4 votes vote down vote up
@Override
public void onShowCustomView(View view, AmazonWebChromeClient.CustomViewCallback callback) {
    this.appView.showCustomView(view, callback);
}
 
Example #3
Source File: CordovaWebView.java    From cordova-amazon-fireos with Apache License 2.0 4 votes vote down vote up
@Override
public void setWebChromeClient(AmazonWebChromeClient client) {
    this.chromeClient = (CordovaChromeClient)client;
    super.setWebChromeClient(client);
}