本文整理匯總了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);
}