Kaynağa Gözat

Merge branch '2.8' of http://10.8.230.114:3000/kemllor/small_sheep_android into 2.8

liujiangyao 7 yıl önce
ebeveyn
işleme
d01ebca42e

+ 2 - 0
app/src/main/AndroidManifest.xml

@@ -490,6 +490,8 @@
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActGameAccount"
             android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActSearchGame"
+            android:screenOrientation="portrait"/>
     </application>
 
 

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -137,7 +137,7 @@ public interface ApiService {
 
 
     /**
-     * 获取正在运行的任务
+     * 微信登录
      * @param jsonObject
      */
     @POST("app/auth/login_by_we_chat")
@@ -146,7 +146,7 @@ public interface ApiService {
 
 
     /**
-     * 获取正在运行的任务
+     * qq登录
      * @param jsonObject
      */
     @POST("app/auth/login_by_qq")

+ 1 - 4
app/src/main/java/com/sheep/gamegroup/model/util/AutoTaskListUtil.java

@@ -68,10 +68,7 @@ public class AutoTaskListUtil {
         //下面的功能主要是初始化 正在运行的应用自动审核任务列表
         AutoTaskListUtil.getInstance().clear();
         SheepApp.getInstance().getNetComponent().getApiService()
-                .releaseTask(1,100,
-                        SheepApp.getInstance().getConnectAddress().getPlatForm(),1,
-                        0, 0,
-                        "-1", 3)
+                .returnTask(3)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java

@@ -53,7 +53,7 @@ public class UMConfigUtils {
         USER_BIND_WEIXIN("账号安全 -> 绑定微信号(立即绑定按钮)"),//5019
         USER_AUTHENTICATION("账号安全 -> 实名认证(提交按钮)"),//5020
         USER_LOGOUT("账号安全 -> 退出登录按钮"),//5021
-        GAME_SEARCH("搜索界面-> 搜索按钮"),//5022
+        GAME_SEARCH("游戏模块 -> 搜索界面-> 搜索按钮"),//5022
         GAME_DOWNLOAD_MANAGER("主界面右上角 -> 下载管理按钮"),//5023
         TASK_ACCEPT("接取任务"),//5024
         SHEEP_NEWBIE_TASK_LIST("新手任务列表界面,(界面已经修改为对话框了)"),//5025
@@ -132,6 +132,8 @@ public class UMConfigUtils {
         SHARE_TO_WX("分享到微信"),//5098
         SHARE_TO_QQ("分享到QQ"),//5099
         USER_FEEDBACK_COMMIT("个人中心 -> 意见反馈 -> 提交建议"),//5100
+        SEARCH_GAME("游戏代充模块 -> 搜索游戏"),//5101
+        SEARCH_GAME_COMMIT("游戏代充模块 -> 搜索游戏 -> 点击搜索按钮"),//5102
         ;
         private String tag;
 

+ 104 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java

@@ -0,0 +1,104 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v7.widget.AppCompatAutoCompleteTextView;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.GridView;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.view.adapter.ArrayAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.SEARCH_GAME_COMMIT;
+
+/**
+ * Created by realicing on 2018/04/.
+ * realicing@sina.com
+ */
+public class ActSearchGame extends BaseActivity {
+
+    @BindView(R.id.search_game_input)
+    AppCompatAutoCompleteTextView search_game_input;
+    @BindView(R.id.search_game_bt)
+    TextView search_game_bt;
+    @BindView(R.id.search_game_hot_list)
+    GridView search_game_hot_list;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_search_game;
+    }
+    private ActSearchGame activity;
+    private ArrayAdapter<TaskReleaseEty> hotAdapter;
+    @Override
+    public void initView() {
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitle(this, "搜索游戏")
+                .setTitleFinish(this);
+        hotAdapter = new ArrayAdapter<TaskReleaseEty>(activity, R.layout.hot_tag_item){
+            @Override
+            public boolean convert(int position, View convertView, ViewGroup parent, TaskReleaseEty item) {
+                if(convertView instanceof TextView){
+                    ((TextView) convertView).setText(item.getName());
+                }
+                return true;
+            }
+        };
+        search_game_hot_list.setAdapter(hotAdapter);
+    }
+
+    @Override
+    public void initListener() {
+    }
+
+    List<TaskReleaseEty> hotList = new ArrayList<>();
+    @Override
+    public void initData() {
+        SheepApp.getInstance().getNetComponent().getApiService()
+                .releaseTask(1,9,
+                        SheepApp.getInstance().getConnectAddress().getPlatForm(),1,
+                        0, 0,
+                        "-1", 3)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
+                        ListUtil.addAll(hotList, newList);
+                        hotAdapter.notifyDataSetChanged();
+                    }
+                });
+
+    }
+
+    @OnClick({R.id.search_game_bt})
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
+            case R.id.search_game_bt:
+                SEARCH_GAME_COMMIT.onEvent();
+                break;
+        }
+    }
+
+}

+ 9 - 0
app/src/main/res/drawable/shape_blue_stroke_rectangle_small.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="5dp" />
+    <stroke
+        android:width="1dp"
+        android:color="@color/blue_end" />
+    <solid android:color="#edfaff" />
+</shape>

+ 57 - 0
app/src/main/res/layout/act_search_game.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/bg_gray">
+
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/bg_gray"
+        android:gravity="center_horizontal"
+        android:orientation="vertical">
+
+        <include layout="@layout/title" />
+
+        <android.support.v7.widget.AppCompatAutoCompleteTextView
+            android:id="@+id/search_game_input"
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:layout_marginEnd="@dimen/content_padding"
+            android:layout_marginStart="@dimen/content_padding"
+            android:layout_marginTop="@dimen/content_padding_20"
+            android:background="@drawable/shape_blue_stroke_rectangle_small"
+            android:hint="请输入游戏名称"
+            android:maxLength="20"
+            android:paddingEnd="@dimen/dp_10"
+            android:paddingStart="@dimen/dp_10"
+            android:textColor="@color/black_666666"
+            android:textColorHint="@color/txt_gray_929292"
+            android:textSize="@dimen/text_size_3" />
+
+        <TextView
+            android:id="@+id/search_game_bt"
+            style="@style/style_button_newbie_task"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:paddingEnd="50dp"
+            android:paddingStart="50dp"
+            android:text="搜索" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="热门游戏:" />
+
+        <GridView
+            android:id="@+id/search_game_hot_list"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/content_padding_20"
+            android:gravity="center_horizontal"
+            android:horizontalSpacing="@dimen/content_padding_13"
+            android:listSelector="@color/transparent"
+            android:numColumns="3"
+            android:scrollbars="none" />
+    </LinearLayout>
+</android.support.v4.widget.NestedScrollView>