Bläddra i källkod

Merge remote-tracking branch 'origin/sheep_develop' into sheep_develop

liujiangyao 7 år sedan
förälder
incheckning
224197eb7a

+ 33 - 3
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -79,14 +79,15 @@ import com.sheep.gamegroup.util.MyListview;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
+import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.activity.NotificationsUtils;
+import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
 import com.sheep.gamegroup.view.adapter.AdpHomeListGrideview;
 import com.sheep.gamegroup.view.adapter.AdpHomeListListview;
 import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
 import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
 import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
-import com.sheep.gamegroup.view.fragment.FgtPlayGameSon;
 import com.sheep.gamegroup.view.fragment.FgtTryMakeMoney;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -186,6 +187,8 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     TextView homepage_item_juan_tv;
     @BindView(R.id.recyclerview_line)
     View recyclerview_line;
+    @BindView(R.id.full_home_list_rv)
+    RecyclerView full_home_list_rv;
     @BindView(R.id.bottom_line_text)
     TextView bottom_line_text;
 
@@ -207,6 +210,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     private List<BulletinEnty> bulletinEntyLists = new ArrayList<>();
 
     private List<HomeListEntity> homeListEntitys = new ArrayList<>();
+    private List<HomeListEntity> fullHomeList = new ArrayList<>();
     private List<HomeListEntity> homeListEntitysGridview = new ArrayList<>();
     private List<HomeListEntity> homeListEntitysListview = new ArrayList<>();
     private AdpHomeListGrideview adpHomeListGrideview;
@@ -590,6 +594,28 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         });
         CommonUtil.getInstance().reflex(tabLayout, activity);
         setAnimation(ivDuty);
+        //只显示图片并且充满的homeList
+        full_home_list_rv.setHasFixedSize(true);
+        full_home_list_rv.setNestedScrollingEnabled(false);
+        full_home_list_rv.setLayoutManager(new LinearLayoutManager(activity));
+        full_home_list_rv.setAdapter(new AdbCommonRecycler<HomeListEntity>(activity, fullHomeList){
+            @Override
+            public int getViewIdByType(int type) {
+                return R.layout.item_image_full_home_list;
+            }
+
+            @Override
+            public void convert(ViewHolder holder, final HomeListEntity item) {
+                ImageView imageView = holder.getView(R.id.image);
+                GlideImageLoader.setImage(imageView, item.getIcon());
+                imageView.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        CommonUtil.getInstance().goWhere(activity, item, "首页");
+                    }
+                });
+            }
+        });
     }
 
     private int curPosition = 0;
@@ -729,9 +755,11 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         List<HomeListEntity> cacheHomeListEtyList = DataUtil.getInstance().getCacheList(ApiKey.home_list, HomeListEntity.class);
         if (ListUtil.isEmpty(cacheHomeListEtyList)) {
             home_list_gridview_layout.setVisibility(View.GONE);
+            full_home_list_rv.setVisibility(View.GONE);
         } else {
             home_list_gridview_layout.setVisibility(View.VISIBLE);
-            homeListEntitys.addAll(cacheHomeListEtyList);
+            CommonUtil.getInstance().splitHomeList(cacheHomeListEtyList, homeListEntitys, fullHomeList);
+            full_home_list_rv.setVisibility(fullHomeList.isEmpty() ? View.GONE : View.VISIBLE);
             boolean isShowQB = false;
             boolean isShowMd = false;
             for (int i = 0; i < homeListEntitys.size(); i++) {
@@ -751,6 +779,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             addNewTask();
             SheepApp.getInstance().setShowQB(isShowQB);
             SheepApp.getInstance().setShowMidong(isShowMd);
+            full_home_list_rv.getAdapter().notifyDataSetChanged();
             adpHomeListGrideview.notifyDataSetChanged();
             adpHomeListListview.notifyDataSetChanged();
             home_list_gridview_listview.setVisibility(homeListEntitysListview.isEmpty() ? View.GONE : View.VISIBLE);
@@ -1090,7 +1119,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                 homeListEntitys.clear();
                 homeListEntitysGridview.clear();
                 homeListEntitysListview.clear();
-                homeListEntitys.addAll(homeListEntityList);
+                CommonUtil.getInstance().splitHomeList(homeListEntityList, homeListEntitys, fullHomeList);
                 boolean isShowQB = false;
                 boolean isShowMd = false;
                 for (int i = 0; i < homeListEntitys.size(); i++) {
@@ -1110,6 +1139,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                 addNewTask();
                 SheepApp.getInstance().setShowQB(isShowQB);
                 SheepApp.getInstance().setShowMidong(isShowMd);
+                full_home_list_rv.getAdapter().notifyDataSetChanged();
                 adpHomeListGrideview.notifyDataSetChanged();
                 adpHomeListListview.notifyDataSetChanged();
                 home_list_gridview_listview.setVisibility(homeListEntitysListview.isEmpty() ? View.GONE : View.VISIBLE);

+ 20 - 7
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -31,7 +31,6 @@ import com.arialyy.aria.core.inf.IEntity;
 import com.kfzs.duanduan.datashare.provider.download.DownLoadInfo;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.event.EventTypes;
-import com.kfzs.duanduan.services.DownloadTaskService;
 import com.mdad.sdk.mdsdk.AdManager;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.alipay.PayResult;
@@ -43,8 +42,6 @@ import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
-import com.sheep.gamegroup.model.entity.NewbieTask;
-import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
 import com.sheep.gamegroup.model.entity.PlayGameEntity;
 import com.sheep.gamegroup.model.entity.RouserArticlesEntity;
 import com.sheep.gamegroup.model.entity.SlideshowEty;
@@ -60,7 +57,6 @@ import com.sheep.gamegroup.model.util.EntityUtils;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.usage.AppUsageManager;
 import com.sheep.gamegroup.view.activity.GameTaskOrderListAct;
-import com.sheep.gamegroup.view.dialog.DialogNewbieTask1;
 import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
 import com.sheep.gamegroup.view.dialog.DialogShare;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
@@ -81,7 +77,6 @@ import com.zhy.http.okhttp.callback.FileCallBack;
 
 import org.afinal.simplecache.ApiKey;
 import org.greenrobot.eventbus.EventBus;
-import org.xutils.ex.DbException;
 
 import java.io.File;
 import java.lang.reflect.Field;
@@ -106,7 +101,6 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.LINK_SHARE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_COPY;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECEIVE_AWARD_GAME_TASK;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.RESERVATION_GAME_TASK;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.XIAOMI_GAME_RECEIVE;
 import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST;
 import static com.sheep.gamegroup.view.adapter.WelfareAdapter.TO_REFRESH;
@@ -841,7 +835,26 @@ public class CommonUtil {
         popShare(activity, url, type, null);
     }
 
-   public static class UMShareListener implements com.umeng.socialize.UMShareListener {
+    /**
+     * 把homeList列表分开,例如:超维对决显示的图片是充满的,并且在绵羊头条下面
+     * @param allList
+     * @param homeList
+     * @param fullHomeList
+     */
+    public void splitHomeList(List<HomeListEntity> allList, List<HomeListEntity> homeList, final List<HomeListEntity> fullHomeList) {
+        ListUtil.addAll(homeList, ListUtil.removeItem(allList, new ListUtil.CallBack<HomeListEntity, Boolean>() {
+            @Override
+            public Boolean call(HomeListEntity item) {
+                boolean result = "1024".equals(item.getDesc());
+                if(result){
+                    fullHomeList.add(item);
+                }
+                return !result;
+            }
+        }));
+    }
+
+    public static class UMShareListener implements com.umeng.socialize.UMShareListener {
 
         @Override
         public void onStart(SHARE_MEDIA share_media) {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/PlayGameListAdapter.java

@@ -62,7 +62,7 @@ public class PlayGameListAdapter extends AdbCommonRecycler<GameEntityList>{
                 ViewUtil.setText(item_name_tv, gameEntity.getApp().getName());
                 ViewUtil.setText(item_date_tv, gameEntity.getApp().getPackage_size()+"M");
                 GlideImageLoader.setGameImage((ImageView) holder.itemView.findViewById(R.id.item_icon_iv), gameEntity.getApp().getIcon());
-                CommonUtil.getInstance().palyGameDetailBtnValue(context,gameEntity,detail_task_tv_center);
+                CommonUtil.getInstance().palyGameDetailBtnValue(context,gameEntity,detail_task_tv_center, 1);
 
                 item_download_welfare_line.setVisibility(holder.getAdapterPosition() + 1 == getItemCount() ? View.GONE : View.VISIBLE);
 

+ 6 - 1
app/src/main/res/layout/homepage_act_layout.xml

@@ -40,6 +40,12 @@
                     android:visibility="visible" />
 
                 <include layout="@layout/homepage_item_notice_and_currenttime" />
+                <!--超维对决HomeList-->
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/full_home_list_rv"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:visibility="gone"/>
 
                 <View
                     android:layout_width="match_parent"
@@ -47,7 +53,6 @@
                     android:background="#fff5f5f5" />
 
                 <include layout="@layout/homepage_item_get_award" />
-
                 <View
                     android:layout_width="match_parent"
                     android:layout_height="1dp"

+ 13 - 0
app/src/main/res/layout/item_image_full_home_list.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:padding="8dp">
+
+    <ImageView
+        android:id="@+id/image"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:adjustViewBounds="true"
+        android:scaleType="fitXY" />
+</RelativeLayout>