Просмотр исходного кода

功能开发:游戏详情接口换v2

Sora 1 год назад
Родитель
Сommit
89aa882432

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java

@@ -48,7 +48,7 @@ public class NetModule {
     public Retrofit provideRetrofit(OkHttpClient okhttpClient) {
     public Retrofit provideRetrofit(OkHttpClient okhttpClient) {
         Retrofit retrofit = new Retrofit.Builder()
         Retrofit retrofit = new Retrofit.Builder()
                 .client(okhttpClient)
                 .client(okhttpClient)
-                .baseUrl(SheepApp.getInstance().getConnectAddress().getAppUrl()+"v1/")
+                .baseUrl(SheepApp.getInstance().getConnectAddress().getAppUrl())
 //                .baseUrl("http://ss.17xmy.com/v1/")
 //                .baseUrl("http://ss.17xmy.com/v1/")
 //                .baseUrl("http://192.168.0.109:8080/v1/")
 //                .baseUrl("http://192.168.0.109:8080/v1/")
 //                .baseUrl("http://10.8.240.180:8080/v1/")
 //                .baseUrl("http://10.8.240.180:8080/v1/")

Разница между файлами не показана из-за своего большого размера
+ 285 - 293
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java


+ 15 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/Applications.java

@@ -12,6 +12,7 @@ import com.sheep.jiuyan.samllsheep.R;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.List;
 
 
 import rx.functions.Action1;
 import rx.functions.Action1;
@@ -106,6 +107,20 @@ public class Applications implements IDownload, IGameGroup, Serializable {
     private int activity_id;
     private int activity_id;
 
 
     private String activity_url;
     private String activity_url;
+    private String game_tag_new;
+
+    public List<String> getGameTagNewList() {
+        String[] arr = game_tag_new.split(",");
+        return Arrays.asList(arr);
+    }
+
+    public String getGame_tag_new() {
+        return game_tag_new;
+    }
+
+    public void setGame_tag_new(String game_tag_new) {
+        this.game_tag_new = game_tag_new;
+    }
 
 
     public int getActivity_id() {
     public int getActivity_id() {
         return activity_id;
         return activity_id;

+ 3 - 4
app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGameGroupOrGameDetail.java

@@ -36,7 +36,6 @@ import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GameEntity;
-import com.sheep.gamegroup.model.entity.GameListTag;
 import com.sheep.gamegroup.model.entity.Lp;
 import com.sheep.gamegroup.model.entity.Lp;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.module.game.adapter.AdpGameGroupGameCompare;
 import com.sheep.gamegroup.module.game.adapter.AdpGameGroupGameCompare;
@@ -231,7 +230,7 @@ public class ActGameGroupOrGameDetail extends BaseActivity {
         }
         }
     }
     }
 
 
-    private List<GameListTag> tagList = ListUtil.emptyList();
+    private List<String> tagList = ListUtil.emptyList();
 
 
     //重置view
     //重置view
     private void resetView() {
     private void resetView() {
@@ -313,9 +312,9 @@ public class ActGameGroupOrGameDetail extends BaseActivity {
         //加载游戏大小与多少人在玩信息
         //加载游戏大小与多少人在玩信息
         ViewUtil.setText(binding.gcGameAppDetailInfoTv, gameGroup == null ? gameEntity.getApp().getPlayInfo() : gameGroup.getInfo(null));
         ViewUtil.setText(binding.gcGameAppDetailInfoTv, gameGroup == null ? gameEntity.getApp().getPlayInfo() : gameGroup.getInfo(null));
         //加载游戏标签
         //加载游戏标签
-        if (gameEntity.getApp().getTags() != null) {
+        if (gameEntity.getApp().getGameTagNewList() != null) {
             tagList.clear();
             tagList.clear();
-            tagList.addAll(gameEntity.getApp().getTags());
+            tagList.addAll(gameEntity.getApp().getGameTagNewList());
             ListUtil.removeNull(tagList);
             ListUtil.removeNull(tagList);
             if (binding.gcGameAppDetailTagList.getAdapter() != null)
             if (binding.gcGameAppDetailTagList.getAdapter() != null)
                 binding.gcGameAppDetailTagList.getAdapter().notifyDataSetChanged();
                 binding.gcGameAppDetailTagList.getAdapter().notifyDataSetChanged();

+ 8 - 15
app/src/main/java/com/sheep/gamegroup/util/TagListUtil.java

@@ -1,13 +1,12 @@
 package com.sheep.gamegroup.util;
 package com.sheep.gamegroup.util;
 
 
+import android.widget.TextView;
+
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 import androidx.recyclerview.widget.RecyclerView;
-import android.view.View;
-import android.widget.TextView;
 
 
 import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
 import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
 import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
 import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
-import com.sheep.gamegroup.model.entity.GameListTag;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
 
@@ -20,25 +19,19 @@ import java.util.List;
 public class TagListUtil {
 public class TagListUtil {
 
 
     //设置tag标签横向列表
     //设置tag标签横向列表
-    public static void setTagList(RecyclerView recyclerView, List<GameListTag> tagList) {
+    public static void setTagList(RecyclerView recyclerView, List<String> tagList) {
         LinearLayoutManager playGameActManager = new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.HORIZONTAL, false);
         LinearLayoutManager playGameActManager = new LinearLayoutManager(SheepApp.getInstance(), LinearLayoutManager.HORIZONTAL, false);
         recyclerView.setHasFixedSize(true);
         recyclerView.setHasFixedSize(true);
         recyclerView.setNestedScrollingEnabled(false);
         recyclerView.setNestedScrollingEnabled(false);
         recyclerView.setLayoutManager(playGameActManager);
         recyclerView.setLayoutManager(playGameActManager);
-        recyclerView.setAdapter(new RecyclerViewAdapter<GameListTag>(SheepApp.getInstance(), R.layout.item_tag, tagList) {
+        recyclerView.setAdapter(new RecyclerViewAdapter<String>(SheepApp.getInstance(), R.layout.item_tag, tagList) {
             @Override
             @Override
-            public void convert(ViewHolder viewHolder, final GameListTag item, int position) {
-                if(item == null)
+            public void convert(ViewHolder viewHolder, final String item, int position) {
+                if (item == null)
                     return;
                     return;
-                if(viewHolder.itemView instanceof TextView){
-                    ViewUtil.setText((TextView) viewHolder.itemView, item.getName());
+                if (viewHolder.itemView instanceof TextView) {
+                    ViewUtil.setText((TextView) viewHolder.itemView, item);
                 }
                 }
-                viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        Jump2View.getInstance().goActPlayGameList(recyclerView.getContext(), item);
-                    }
-                });
             }
             }
         });
         });
 
 

+ 15 - 14
app/src/main/java/com/sheep/gamegroup/view/activity/ActGcGameAppDetail.java

@@ -1,18 +1,21 @@
 package com.sheep.gamegroup.view.activity;
 package com.sheep.gamegroup.view.activity;
 
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_SHARE;
+
 import android.content.Intent;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Bundle;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import com.google.android.material.tabs.TabLayout;
-import androidx.fragment.app.Fragment;
-import androidx.viewpager.widget.ViewPager;
-import androidx.recyclerview.widget.RecyclerView;
 import android.text.TextUtils;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.TextView;
 
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.viewpager.widget.ViewPager;
+
+import com.google.android.material.tabs.TabLayout;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
@@ -26,7 +29,6 @@ import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GameEntity;
-import com.sheep.gamegroup.model.entity.GameListTag;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ApiUtil;
 import com.sheep.gamegroup.util.ApiUtil;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -57,8 +59,6 @@ import butterknife.OnClick;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
 import io.reactivex.schedulers.Schedulers;
 
 
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_SHARE;
-
 
 
 /**
 /**
  * Created by realicing on 2018/10/31.
  * Created by realicing on 2018/10/31.
@@ -151,7 +151,7 @@ public class ActGcGameAppDetail extends BaseActivity {
         ViewUtil.setImage(write_comment, ViewUtil.getNetImgByName("write_comment"));
         ViewUtil.setImage(write_comment, ViewUtil.getNetImgByName("write_comment"));
     }
     }
 
 
-    private List<GameListTag> tagList = ListUtil.emptyList();
+    private List<String> tagList = ListUtil.emptyList();
 
 
     //重置view
     //重置view
     private void resetView() {
     private void resetView() {
@@ -219,7 +219,8 @@ public class ActGcGameAppDetail extends BaseActivity {
             ViewUtil.setText(gc_game_app_detail_fl_tv);
             ViewUtil.setText(gc_game_app_detail_fl_tv);
         //加载游戏标签
         //加载游戏标签
         if (gameEntity.getApp().getTags() != null) {
         if (gameEntity.getApp().getTags() != null) {
-            tagList.addAll(gameEntity.getApp().getTags());
+            tagList.clear();
+            tagList.addAll(gameEntity.getApp().getGameTagNewList());
             ListUtil.removeNull(tagList);
             ListUtil.removeNull(tagList);
             if (recyclerView.getAdapter() != null)
             if (recyclerView.getAdapter() != null)
                 recyclerView.getAdapter().notifyDataSetChanged();
                 recyclerView.getAdapter().notifyDataSetChanged();
@@ -368,9 +369,9 @@ public class ActGcGameAppDetail extends BaseActivity {
 
 
     @OnClick(R.id.gc_game_app_detail_bt3)
     @OnClick(R.id.gc_game_app_detail_bt3)
     public void onGoDirectionalPay(View v) {
     public void onGoDirectionalPay(View v) {
-        CommonUtil.getInstance().getUserInfo(false, user->{
-            if(user==null) return;
-            if(user.isVIP()){
+        CommonUtil.getInstance().getUserInfo(false, user -> {
+            if (user == null) return;
+            if (user.isVIP()) {
                 Jump2View.getInstance().gotoGameVipRecharge(gameEntity.getApp());
                 Jump2View.getInstance().gotoGameVipRecharge(gameEntity.getApp());
             } else {
             } else {
                 Jump2View.getInstance().gotoVip(this);
                 Jump2View.getInstance().gotoVip(this);

+ 0 - 11
app/src/main/res/layout/act_game_group_or_game_detail.xml

@@ -166,17 +166,6 @@
                         app:layout_constraintTop_toTopOf="@id/gc_game_app_detail_icon"
                         app:layout_constraintTop_toTopOf="@id/gc_game_app_detail_icon"
                         tools:text="游戏标题" />
                         tools:text="游戏标题" />
 
 
-                    <!--                    <ImageView-->
-                    <!--                        android:id="@+id/gc_game_app_hot_iv"-->
-                    <!--                        android:layout_width="8dp"-->
-                    <!--                        android:layout_height="10dp"-->
-                    <!--                        android:layout_marginStart="3dp"-->
-                    <!--                        android:src="@mipmap/hot"-->
-                    <!--                        android:visibility="gone"-->
-                    <!--                        app:layout_constraintStart_toEndOf="@+id/gc_game_app_detail_name"-->
-                    <!--                        app:layout_constraintTop_toTopOf="@+id/gc_game_app_detail_name"-->
-                    <!--                        tools:visibility="visible" />-->
-
                     <androidx.recyclerview.widget.RecyclerView
                     <androidx.recyclerview.widget.RecyclerView
                         android:id="@+id/gc_game_app_detail_tag_list"
                         android:id="@+id/gc_game_app_detail_tag_list"
                         android:layout_width="0dp"
                         android:layout_width="0dp"