예제 #1
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(" ")));
   }
 }
예제 #2
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;
 }