billyyoyo лет назад: 6
Родитель
Сommit
1eb7b5397f

+ 12 - 6
app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java

@@ -82,6 +82,7 @@ import org.greenrobot.eventbus.Subscribe;
 
 
 import java.net.URI;
 import java.net.URI;
 import java.util.HashMap;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Locale;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -224,17 +225,22 @@ public class KFZSJs {
 
 
     @JavascriptInterface
     @JavascriptInterface
     public String getSheepAds(int type) {
     public String getSheepAds(int type) {
-        return JSONObject.toJSONString(DDProviderHelper.getInstance().listSheepAd(type));
+        List<SheepAd> ads = DDProviderHelper.getInstance().listSheepAd(type);
+        if (ads != null) {
+            return JSONObject.toJSONString(ads);
+        } else {
+            return "";
+        }
     }
     }
 
 
     @JavascriptInterface
     @JavascriptInterface
-    public void clickSheepAd(String json){
+    public void clickSheepAd(String json) {
         SheepAd ad = JSONObject.parseObject(json, SheepAd.class);
         SheepAd ad = JSONObject.parseObject(json, SheepAd.class);
         AdHelper.goAdLink(activity, ad);
         AdHelper.goAdLink(activity, ad);
     }
     }
 
 
     @JavascriptInterface
     @JavascriptInterface
-    public void statSheepAd(String ids){
+    public void statSheepAd(String ids) {
         AdHelper.stat(ids, 1);
         AdHelper.stat(ids, 1);
     }
     }
 
 
@@ -310,7 +316,7 @@ public class KFZSJs {
     }
     }
 
 
     @JavascriptInterface
     @JavascriptInterface
-    public void shareWebAsImage(String url){
+    public void shareWebAsImage(String url) {
         Intent in = new Intent(activity, ActWebShareImage.class);
         Intent in = new Intent(activity, ActWebShareImage.class);
         in.putExtra("web_url", url);
         in.putExtra("web_url", url);
         activity.startActivity(in);
         activity.startActivity(in);
@@ -478,7 +484,7 @@ public class KFZSJs {
     }
     }
 
 
     @JavascriptInterface
     @JavascriptInterface
-    public void onPayCompleted(String orderNo, int status){
+    public void onPayCompleted(String orderNo, int status) {
         Intent intent = new Intent();
         Intent intent = new Intent();
         intent.putExtra("orderno", orderNo);
         intent.putExtra("orderno", orderNo);
         intent.putExtra("status", status);
         intent.putExtra("status", status);
@@ -497,7 +503,7 @@ public class KFZSJs {
     }
     }
 
 
     @JavascriptInterface
     @JavascriptInterface
-    public void buyVip(){
+    public void buyVip() {
         Jump2View.getInstance().gotoVip(activity);
         Jump2View.getInstance().gotoVip(activity);
     }
     }
 
 

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java

@@ -148,6 +148,9 @@ public class SplashAct extends BaseActivity {
                 if (isLoad) {
                 if (isLoad) {
                     ad = DDProviderHelper.getInstance().getSheepAd(SheepAd.FORM_SPASH);
                     ad = DDProviderHelper.getInstance().getSheepAd(SheepAd.FORM_SPASH);
                     loadAdvertising();
                     loadAdvertising();
+                    if (ad == null) {
+                        sendHandlerMessages(2000);
+                    }
                 }
                 }
             } else {
             } else {
                 if (isLoad) {
                 if (isLoad) {

+ 5 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -790,11 +790,13 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
             ViewUtil.setVisibility(banner, false);
             ViewUtil.setVisibility(banner, false);
         }
         }
         List<SheepAd> list = DDProviderHelper.getInstance().listSheepAd(SheepAd.FORM_HOME_BAR);
         List<SheepAd> list = DDProviderHelper.getInstance().listSheepAd(SheepAd.FORM_HOME_BAR);
-        barListList.clear();
-        if (list.size() > 0) {
+        if (list != null && list.size() > 0) {
+            barListList.clear();
             barListList.add(list.get(0));
             barListList.add(list.get(0));
         }
         }
-        AdHelper.stat(list.get(0).getAd_id(), 1);
+        if (barListList != null && barListList.size() > 0) {
+            AdHelper.stat(barListList.get(0).getAd_id(), 1);
+        }
         ViewUtil.notifyDataSetChanged(bar_list_rv);
         ViewUtil.notifyDataSetChanged(bar_list_rv);
         //首页list
         //首页list
         List<HomeListEntity> cacheHomeListEtyList = DataUtil.getInstance().getCacheList(ApiKey.home_list, HomeListEntity.class);
         List<HomeListEntity> cacheHomeListEtyList = DataUtil.getInstance().getCacheList(ApiKey.home_list, HomeListEntity.class);