Explorar el Código

首页修改任务列表

zhaoyi hace 8 años
padre
commit
3bd0956199

+ 57 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/WxAccountDetail.java

@@ -2,6 +2,10 @@ package com.sheep.jiuyan.samllsheep.page;
 
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ListView;
+import android.widget.PopupWindow;
 import android.widget.TextView;
 
 import com.sheep.jiuyan.samllsheep.R;
@@ -9,10 +13,14 @@ import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 import com.sheep.jiuyan.samllsheep.net.NetManager;
 import com.sheep.jiuyan.samllsheep.net.SheepCallback;
 import com.sheep.jiuyan.samllsheep.net.Url;
+import com.sheep.jiuyan.samllsheep.page.adapter.AdpChangeUser;
 import com.sheep.jiuyan.samllsheep.page.adapter.AdpWxDetailList;
 import com.sheep.jiuyan.samllsheep.page.entry.TaskPublish;
+import com.sheep.jiuyan.samllsheep.page.entry.User;
 import com.sheep.jiuyan.samllsheep.page.entry.WxDetailList;
+import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import java.io.IOException;
 import java.util.HashMap;
@@ -33,6 +41,8 @@ public class WxAccountDetail extends BaseActivity {
     private RecyclerView mRecyclerView;//列表
     private TextView mTxtAccount;//当前微信号
     private AdpWxDetailList mAdpWxDetailList;
+    private PopupWindow mPopupWindow;
+    private AdpChangeUser mAdpChangeUser;
 
 
     @Override
@@ -45,16 +55,60 @@ public class WxAccountDetail extends BaseActivity {
         mRecyclerView = (RecyclerView) findViewById(R.id.recy_wx_account_detail);
         mTxtAccount = (TextView) findViewById(R.id.txt_wx_account_detail);
         mAdpWxDetailList = new AdpWxDetailList(this);
+        mAdpChangeUser = new AdpChangeUser(this);
 
         mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
         mRecyclerView.setAdapter(mAdpWxDetailList);
+        TitleBarUtils.getInstance()
+                .setTitle(this, "挂机帐号")
+                .setTitleFinish(this);
     }
 
     @Override
     public void initListener() {
-
+        findViewById(R.id.img_wx_account_detail)
+                .setOnClickListener(cls_ChangeUser);
     }
 
+
+    /**
+     * 切换用户的实现
+     */
+    private View.OnClickListener cls_ChangeUser = new View.OnClickListener() {
+        @Override
+        public void onClick(View view) {
+            if (mPopupWindow == null) {
+                View view1 = View.inflate(WxAccountDetail.this, R.layout.pop_change_user, null);
+                mPopupWindow = new PopupWindow(view1, G.WIDTH, -2);
+                View foot = View.inflate(WxAccountDetail.this, R.layout.foot_pop_change_user, null);
+                foot.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        G.showToast("点我添加");
+                    }
+                });
+                ListView listView = view1.findViewById(R.id.list_pop_change_user);
+                listView.addFooterView(foot);
+                //测试
+                mAdpChangeUser.add(new User());
+                mAdpChangeUser.add(new User());
+                mAdpChangeUser.add(new User());
+                mAdpChangeUser.add(new User());
+                listView.setAdapter(mAdpChangeUser);
+                mPopupWindow.setContentView(view1);
+                mPopupWindow.setOutsideTouchable(true);
+                listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+                    @Override
+                    public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
+                        G.showToast("点第:" + i + "项");
+                    }
+                });
+            }
+            mPopupWindow.showAsDropDown(view);
+        }
+    };
+
+
     @Override
     public void initData() {
         HashMap<String, String> map = new HashMap<>();
@@ -70,4 +124,6 @@ public class WxAccountDetail extends BaseActivity {
             }
         });
     }
+
+
 }

+ 38 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/page/adapter/AdpChangeUser.java

@@ -0,0 +1,38 @@
+package com.sheep.jiuyan.samllsheep.page.adapter;
+
+import android.content.Context;
+import android.support.annotation.Nullable;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.page.entry.User;
+
+/**
+ * @ Created by Dlg
+ * @ <p>TiTle:  AdpChangeUser</p>
+ * @ <p>Description:</p>
+ * @ date:  2018/1/17 12:01
+ * @ QQ:    315096953
+ */
+
+public class AdpChangeUser extends AdpCommonList<User> {
+
+    public AdpChangeUser(Context context) {
+        super(context);
+    }
+
+    @Override
+    public View getView(int i, View view, ViewGroup viewGroup) {
+        if (view == null) {
+            view = View.inflate(mContext, R.layout.item_pop_change_user, null);
+        }
+        return view;
+    }
+
+    @Nullable
+    @Override
+    public CharSequence[] getAutofillOptions() {
+        return new CharSequence[0];
+    }
+}

+ 8 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/page/entry/TaskCount.java

@@ -0,0 +1,8 @@
+package com.sheep.jiuyan.samllsheep.page.entry;
+
+/**
+ * Created by kemllor on 2018/1/17.
+ */
+
+public class TaskCount {
+}

+ 10 - 10
app/src/main/java/com/sheep/jiuyan/samllsheep/page/entry/WxDetailList.java

@@ -10,24 +10,24 @@ package com.sheep.jiuyan.samllsheep.page.entry;
 
 public class WxDetailList {
 
-    private Integer wxid;
+    private Integer WxTd;
 
-    private Task task;
+    private Task Task;
 
 
-    public Integer getWxid() {
-        return wxid == null ? 0 : wxid;
+    public Integer getWxTd() {
+        return WxTd == null ? 0 : WxTd;
     }
 
-    public void setWxid(Integer wxid) {
-        this.wxid = wxid;
+    public void setWxTd(Integer wxTd) {
+        WxTd = wxTd;
     }
 
-    public Task getTask() {
-        return task;
+    public com.sheep.jiuyan.samllsheep.page.entry.Task getTask() {
+        return Task;
     }
 
-    public void setTask(Task task) {
-        this.task = task;
+    public void setTask(com.sheep.jiuyan.samllsheep.page.entry.Task task) {
+        Task = task;
     }
 }

+ 3 - 0
app/src/main/res/layout/fgt_main_page_offline_task.xml

@@ -30,6 +30,7 @@
             android:layout_height="wrap_content"
             android:layout_weight="1"
             android:gravity="left"
+            android:paddingLeft="@dimen/content_padding_big"
             android:text="账号"
             android:textColor="@color/black_text_gray"
             android:textSize="@dimen/text_size_5" />
@@ -39,6 +40,7 @@
             android:layout_height="wrap_content"
             android:layout_weight="1"
             android:gravity="left"
+            android:paddingLeft="@dimen/content_padding_big"
             android:text="账号状态"
             android:textColor="@color/black_text_gray"
             android:textSize="@dimen/text_size_5" />
@@ -48,6 +50,7 @@
             android:layout_height="wrap_content"
             android:layout_weight="1"
             android:gravity="left"
+            android:paddingLeft="@dimen/content_padding_big"
             android:text="备注"
             android:textColor="@color/black_text_gray"
             android:textSize="@dimen/text_size_5" />

+ 23 - 0
app/src/main/res/layout/foot_pop_change_user.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="@dimen/layout_heigh_large"
+    android:layout_marginTop="@dimen/content_padding_small"
+    android:gravity="center_vertical"
+    android:orientation="horizontal">
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:src="@drawable/add" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/layout_heigh_large"
+        android:gravity="center_vertical"
+        android:layout_marginLeft="@dimen/content_padding_big"
+        android:text="添加新微信帐号"
+        android:textColor="@color/colorPrimaryDark"
+        android:textSize="@dimen/text_size_5" />
+
+</LinearLayout>

+ 3 - 0
app/src/main/res/layout/item_fgt_main_page_offline_task.xml

@@ -11,6 +11,7 @@
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_weight="1"
+        android:paddingLeft="@dimen/content_padding_big"
         android:text="帐号1"
         android:textColor="@color/black_text_deep"
         android:textSize="@dimen/text_size_4" />
@@ -20,6 +21,7 @@
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_weight="1"
+        android:paddingLeft="@dimen/content_padding_big"
         android:text="挂机中"
         android:textColor="@color/black_text_deep"
         android:textSize="@dimen/text_size_4" />
@@ -29,6 +31,7 @@
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_weight="1"
+        android:paddingLeft="@dimen/content_padding_big"
         android:text="备注"
         android:textColor="@color/black_text_deep"
         android:textSize="@dimen/text_size_4" />

+ 50 - 0
app/src/main/res/layout/item_pop_change_user.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:paddingBottom="@dimen/content_padding"
+    android:paddingTop="@dimen/content_padding">
+
+    <de.hdodenhof.circleimageview.CircleImageView
+        android:id="@+id/img_item_pop_change_user_logo"
+        android:layout_width="40dp"
+        android:layout_height="40dp"
+        android:src="@color/colorPrimary"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/txt_item_pop_change_user_nick"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/content_padding"
+        android:text="昵称"
+        android:textColor="@color/black_text_deep"
+        android:textSize="@dimen/text_size_4"
+        app:layout_constraintLeft_toRightOf="@id/img_item_pop_change_user_logo" />
+
+    <TextView
+        android:id="@+id/txt_item_pop_change_user_id"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/content_padding_small"
+        android:text="游戏id"
+        android:textColor="@color/black_text_gray"
+        android:textSize="@dimen/text_size_3"
+        app:layout_constraintStart_toStartOf="@+id/txt_item_pop_change_user_nick"
+        app:layout_constraintTop_toBottomOf="@id/txt_item_pop_change_user_nick"
+        tools:layout_editor_absoluteY="6dp" />
+
+
+    <ImageView
+        android:id="@+id/img_item_pop_change_user_choose"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginRight="@dimen/content_padding_big"
+        android:src="@drawable/hook_choose"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+</android.support.constraint.ConstraintLayout>

+ 1 - 1
app/src/main/res/layout/item_wx_account_detail.xml

@@ -2,7 +2,7 @@
 <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_height="wrap_content"
     android:padding="@dimen/content_padding_big">
 
     <ImageView

+ 21 - 0
app/src/main/res/layout/pop_change_user.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/white"
+    android:orientation="vertical"
+    android:paddingLeft="@dimen/content_padding_big"
+    android:paddingRight="@dimen/content_padding_big">
+
+    <ListView
+        android:id="@+id/list_pop_change_user"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:divider="@color/translate"
+        android:dividerHeight="0px"
+        tools:listfooter="@layout/foot_pop_change_user"
+        tools:listitem="@layout/item_pop_change_user"></ListView>
+
+
+</LinearLayout>

+ 1 - 0
app/src/main/res/layout/wx_account_detail.xml

@@ -35,6 +35,7 @@
             android:layout_weight="1" />
 
         <ImageView
+            android:id="@+id/img_wx_account_detail"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:padding="@dimen/content_padding_small"