Java 类org.apache.cordova.LinearLayoutSoftKeyboardDetect 实例源码

项目:litecoinEasyCheck    文件:AdMob.java   
@Override
public void run() {
  if (adSize == null) {
    result = new PluginResult(Status.ERROR, "AdSize is null. Did you use an AdSize constant?");
  } else {
    adView = new AdView(cordova.getActivity(), adSize, publisherId);
    adView.setAdListener(new BannerListener());
    LinearLayoutSoftKeyboardDetect parentView =
        (LinearLayoutSoftKeyboardDetect) webView.getParent();
    if (bannerAtTop) {
      parentView.addView(adView, 0);
    } else {
      parentView.addView(adView);
    }
    // Notify the plugin.
    result = new PluginResult(Status.OK);
  }
  synchronized (this) {
    this.notify();
  }
}
项目:litecoinEasyCheck    文件:AdMob.java   
@Override
public void run() {
  if (adSize == null) {
    result = new PluginResult(Status.ERROR, "AdSize is null. Did you use an AdSize constant?");
  } else {
    adView = new AdView(cordova.getActivity(), adSize, publisherId);
    adView.setAdListener(new BannerListener());
    LinearLayoutSoftKeyboardDetect parentView =
        (LinearLayoutSoftKeyboardDetect) webView.getParent();
    if (bannerAtTop) {
      parentView.addView(adView, 0);
    } else {
      parentView.addView(adView);
    }
    // Notify the plugin.
    result = new PluginResult(Status.OK);
  }
  synchronized (this) {
    this.notify();
  }
}
项目:BombTouch    文件:AdMobPlugin.java   
private void executeKillAd(final CallbackContext callbackContext) {
        final Runnable runnable = new Runnable() {
                public void run() {
                    if (adView == null) {
                        // Notify the plugin.
                            callbackContext.error("AdView is null.  Did you call createBannerView or already destroy it?");
                    } else {
                            LinearLayoutSoftKeyboardDetect parentView = (LinearLayoutSoftKeyboardDetect) webView
                        .getParent();
                        parentView.removeView(adView);
                        adView.removeAllViews();
                        adView.destroy();
                        adView = null;
                        callbackContext.success();
                    }
                }
        };

        this.cordova.getActivity().runOnUiThread(runnable);
}
项目:BombTouch    文件:AdMobPlugin.java   
private void executeKillAd(final CallbackContext callbackContext) {
        final Runnable runnable = new Runnable() {
                public void run() {
                    if (adView == null) {
                        // Notify the plugin.
                            callbackContext.error("AdView is null.  Did you call createBannerView or already destroy it?");
                    } else {
                            LinearLayoutSoftKeyboardDetect parentView = (LinearLayoutSoftKeyboardDetect) webView
                        .getParent();
                        parentView.removeView(adView);
                        adView.removeAllViews();
                        adView.destroy();
                        adView = null;
                        callbackContext.success();
                    }
                }
        };

        this.cordova.getActivity().runOnUiThread(runnable);
}
项目:litecoinEasyCheck    文件:AdMob.java   
@Override
public void run() {
  if(adView != null) {
    LinearLayoutSoftKeyboardDetect parentView =
      (LinearLayoutSoftKeyboardDetect) webView.getParent();
    parentView.removeView(adView);
  }
  // Notify the plugin.
  result = new PluginResult(Status.OK);
  synchronized (this) {
    this.notify();
  }
}
项目:litecoinEasyCheck    文件:AdMob.java   
@Override
public void run() {
  if(adView != null) {
    LinearLayoutSoftKeyboardDetect parentView =
      (LinearLayoutSoftKeyboardDetect) webView.getParent();
    parentView.removeView(adView);
  }
  // Notify the plugin.
  result = new PluginResult(Status.OK);
  synchronized (this) {
    this.notify();
  }
}
项目:BombTouch    文件:AdMobPlugin.java   
private synchronized void createBannerView(final String publisherId,
        final AdSize adSize, final CallbackContext callbackContext) {
    final CordovaInterface cordova = this.cordova;

    // Create the AdView on the UI thread.
    Log.w(LOGTAG, "createBannerView");
    Runnable runnable = new Runnable() {
        public void run() {
            Log.w(LOGTAG, "run");
            Log.w(LOGTAG, String.valueOf(webView));
            // Log.w(LOGTAG, "adSize::" + adSize); calling adSize.toString() with SmartBanner == crash
            if (adSize == null) {
                callbackContext
                        .error("AdSize is null. Did you use an AdSize constant?");
                return;
            } else {
                adView = new DfpAdView(cordova.getActivity(), adSize,
                        publisherId);
                adView.setAdListener(new BannerListener());
                LinearLayoutSoftKeyboardDetect parentView = (LinearLayoutSoftKeyboardDetect) webView
                        .getParent();
                if (positionAtTop) {
                    parentView.addView(adView, 0);
                } else {
                    parentView.addView(adView);
                }
                // Notify the plugin.
                callbackContext.success();
            }
        }
    };
    this.cordova.getActivity().runOnUiThread(runnable);
}
项目:BombTouch    文件:AdMobPlugin.java   
private synchronized void createBannerView(final String publisherId,
        final AdSize adSize, final CallbackContext callbackContext) {
    final CordovaInterface cordova = this.cordova;

    // Create the AdView on the UI thread.
    Log.w(LOGTAG, "createBannerView");
    Runnable runnable = new Runnable() {
        public void run() {
            Log.w(LOGTAG, "run");
            Log.w(LOGTAG, String.valueOf(webView));
            // Log.w(LOGTAG, "adSize::" + adSize); calling adSize.toString() with SmartBanner == crash
            if (adSize == null) {
                callbackContext
                        .error("AdSize is null. Did you use an AdSize constant?");
                return;
            } else {
                adView = new DfpAdView(cordova.getActivity(), adSize,
                        publisherId);
                adView.setAdListener(new BannerListener());
                LinearLayoutSoftKeyboardDetect parentView = (LinearLayoutSoftKeyboardDetect) webView
                        .getParent();
                if (positionAtTop) {
                    parentView.addView(adView, 0);
                } else {
                    parentView.addView(adView);
                }
                // Notify the plugin.
                callbackContext.success();
            }
        }
    };
    this.cordova.getActivity().runOnUiThread(runnable);
}