|
|
@@ -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 {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|