Пример #1
0
  public void setViewSize(int width, int height) {

    mView.setAdspaceWidth(width);
    mView.setAdspaceHeight(height);
    //  mView.startReloadTimer();
    mView.loadNextAd();
  }
Пример #2
0
 @Override
 public void setProperty(String name, Object value) {
   if (name.equalsIgnoreCase("keywords")) {
     mKeywords = value.toString();
     if (mKeywords.length() > 0) mView.setKeywords(Arrays.asList(mKeywords.split(" ")));
   }
 }
Пример #3
0
 @Override
 public View createView() {
   mView =
       new AdView(
           mContext,
           REQUEST_URL,
           mControlInfo.optStringProperty("@SDAdsViewPublisherId"),
           true,
           true);
   if (mUserAge > 0) mView.setUserAge(mUserAge);
   mGender = mControlInfo.optStringProperty("@SDAdsViewUserGender");
   if (mGender.equalsIgnoreCase("female")) mView.setUserGender(Gender.FEMALE);
   if (mGender.equalsIgnoreCase("male")) mView.setUserGender(Gender.MALE);
   mKeywords = mControlInfo.optStringProperty("@SDAdsViewKeywords");
   if (mKeywords.length() > 0) mView.setKeywords(Arrays.asList(mKeywords.split(" ")));
   mView.setAdspaceStrict(
       false); // Optional, tells the server to only supply banner ads that are exactly of the
               // desired size. Without setting it, the server could also supply smaller Ads when
               // no ad of desired size is available.
   mView.setAdListener(this);
   return mView;
 }
Пример #4
0
 @Override
 public void runMethod(String name, List<Object> parameters) {
   if (name.equalsIgnoreCase("requestad")) {
     mView.loadNextAd();
   }
 }