本文整理汇总了Java中org.apache.cordova.LinearLayoutSoftKeyboardDetect类的典型用法代码示例。如果您正苦于以下问题:Java LinearLayoutSoftKeyboardDetect类的具体用法?Java LinearLayoutSoftKeyboardDetect怎么用?Java LinearLayoutSoftKeyboardDetect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LinearLayoutSoftKeyboardDetect类属于org.apache.cordova包,在下文中一共展示了LinearLayoutSoftKeyboardDetect类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.apache.cordova.LinearLayoutSoftKeyboardDetect; //导入依赖的package包/类
@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();
}
}
示例2: executeKillAd
import org.apache.cordova.LinearLayoutSoftKeyboardDetect; //导入依赖的package包/类
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);
}
示例3: createBannerView
import org.apache.cordova.LinearLayoutSoftKeyboardDetect; //导入依赖的package包/类
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);
}