|
@@ -0,0 +1,553 @@
|
|
|
+package com.up.upcbmls.view.activity;
|
|
|
+
|
|
|
+import android.app.Dialog;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.support.annotation.Nullable;
|
|
|
+import android.text.TextUtils;
|
|
|
+import android.util.DisplayMetrics;
|
|
|
+import android.view.Gravity;
|
|
|
+import android.view.View;
|
|
|
+import android.view.View.OnClickListener;
|
|
|
+import android.view.ViewGroup;
|
|
|
+import android.view.WindowManager;
|
|
|
+import android.widget.AdapterView;
|
|
|
+import android.widget.Button;
|
|
|
+import android.widget.LinearLayout;
|
|
|
+import android.widget.ListView;
|
|
|
+import android.widget.PopupWindow;
|
|
|
+import android.widget.RelativeLayout;
|
|
|
+import android.widget.TextView;
|
|
|
+import android.widget.Toast;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.up.upcbmls.R;
|
|
|
+import com.up.upcbmls.adapter.PopAreasOneAdapter;
|
|
|
+import com.up.upcbmls.adapter.PopAreasTwoAdapter;
|
|
|
+import com.up.upcbmls.adapter.PopCityAdapter;
|
|
|
+import com.up.upcbmls.adapter.PopLxAdapter;
|
|
|
+import com.up.upcbmls.adapter.PopWorkAreasOneAdapter;
|
|
|
+import com.up.upcbmls.adapter.PopWorkAreasTwoAdapter;
|
|
|
+import com.up.upcbmls.adapter.PopWylxAdapter;
|
|
|
+import com.up.upcbmls.base.BaseActivity;
|
|
|
+import com.up.upcbmls.entity.ReleaseShopDictionaryEntity;
|
|
|
+import com.up.upcbmls.entity.ReleaseShopDictionaryEntity.ShopTypeBean;
|
|
|
+import com.up.upcbmls.entity.SelectCityListEntity;
|
|
|
+import com.up.upcbmls.entity.WorkAreaEntity;
|
|
|
+import com.up.upcbmls.entity.WorkAreaSqEntity;
|
|
|
+import com.up.upcbmls.presenter.impl.WorkAreaAPresenterImpl;
|
|
|
+import com.up.upcbmls.presenter.inter.IWorkAreaAPresenter;
|
|
|
+import com.up.upcbmls.util.DialogUtil;
|
|
|
+import com.up.upcbmls.util.Tool;
|
|
|
+import com.up.upcbmls.view.diy.popup.CommonPopupWindow;
|
|
|
+import com.up.upcbmls.view.inter.IWorkAreaAView;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import butterknife.BindView;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName: WorkAreaActivity
|
|
|
+ * @Description:
|
|
|
+ * @Author: dingchao
|
|
|
+ * @Date: 2020/1/7 17:05
|
|
|
+ */
|
|
|
+public class WorkAreaActivity extends BaseActivity implements OnClickListener, IWorkAreaAView {
|
|
|
+ @BindView(R.id.tv_app_title_title)
|
|
|
+ TextView tv_app_title_title;
|
|
|
+ @BindView(R.id.rl_app_title_return)
|
|
|
+ RelativeLayout rl_app_title_return;
|
|
|
+ private IWorkAreaAPresenter mIWorkAreaAPresenter;
|
|
|
+
|
|
|
+ @BindView(R.id.tv_activity_work_area_dqgzcs)
|
|
|
+ TextView tv_activity_work_area_dqgzcs;
|
|
|
+ @BindView(R.id.tv_activity_work_area_qy)
|
|
|
+ TextView tv_activity_work_area_qy;
|
|
|
+ @BindView(R.id.tv_activity_work_area_sq)
|
|
|
+ TextView tv_activity_work_area_sq;
|
|
|
+ @BindView(R.id.tv_activity_work_area_gzdwylx)
|
|
|
+ TextView tv_activity_work_area_gzdwylx;
|
|
|
+
|
|
|
+ @BindView(R.id.rl_activity_work_area_dqgzcs)
|
|
|
+ RelativeLayout rl_activity_work_area_dqgzcs;
|
|
|
+ @BindView(R.id.rl_activity_work_area_qy)
|
|
|
+ RelativeLayout rl_activity_work_area_qy;
|
|
|
+ @BindView(R.id.rl_activity_work_area_gzdwylx)
|
|
|
+ RelativeLayout rl_activity_work_area_gzdwylx;
|
|
|
+
|
|
|
+ Dialog mDialog;
|
|
|
+ Dialog mDialog2;
|
|
|
+ Dialog mDialog3;
|
|
|
+ Dialog mDialog4;
|
|
|
+
|
|
|
+ private String cityIdStr = "1";//默认为1
|
|
|
+ private String cityIdStrV = "1";//后台传值城市
|
|
|
+ private String QSStrV = "1";//后台传值区域商圈
|
|
|
+ private String areasOneV = "";//区域一级id
|
|
|
+ private String areasTwoV = "";//区域二级id
|
|
|
+ private String wylxV = "";//区域二级id
|
|
|
+
|
|
|
+ //城市
|
|
|
+ CommonPopupWindow window_city;
|
|
|
+ PopupWindow win_city;
|
|
|
+ ListView lv_areas_one_fkfs;
|
|
|
+ ListView lv_areas_two_fkfs;
|
|
|
+ PopCityAdapter popFkfsAdapter;
|
|
|
+ SelectCityListEntity selectCityListEntity;
|
|
|
+ @BindView(R.id.activity_popup)
|
|
|
+ LinearLayout activity_popup;
|
|
|
+
|
|
|
+
|
|
|
+ //区域商圈
|
|
|
+ //位置,区域 2
|
|
|
+ CommonPopupWindow window_wz;
|
|
|
+ PopupWindow win_wz;
|
|
|
+ PopWorkAreasOneAdapter popAreasOneAdapter;
|
|
|
+ PopWorkAreasTwoAdapter popAreasTwoAdapter;
|
|
|
+ //用来拼接区域展示的文字
|
|
|
+ String areasOne = "";
|
|
|
+ String areasTwo = "";
|
|
|
+ ListView lv_areas_one;
|
|
|
+ ListView lv_areas_two;
|
|
|
+ List<WorkAreaSqEntity.ListBean.BusinessCirclesBean> childListBeanXList = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+ //物业类型
|
|
|
+ CommonPopupWindow window_wylx;
|
|
|
+ PopupWindow win_wylx;
|
|
|
+ ListView lv_areas_one_wylx;
|
|
|
+ ListView lv_areas_two_wylx;
|
|
|
+ PopWylxAdapter popWylxAdapter;
|
|
|
+
|
|
|
+
|
|
|
+ @BindView(R.id.btn_activity_update)
|
|
|
+ Button btn_activity_update;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ switch (v.getId()) {
|
|
|
+ case R.id.rl_app_title_return:
|
|
|
+ finish();
|
|
|
+ break;
|
|
|
+ case R.id.rl_activity_work_area_dqgzcs:
|
|
|
+ openCityPop();
|
|
|
+ break;
|
|
|
+ case R.id.rl_activity_work_area_qy://区域商圈
|
|
|
+ openAreasPop();
|
|
|
+ break;
|
|
|
+ case R.id.rl_activity_work_area_gzdwylx://关注的物业类型
|
|
|
+ openWylxPop();
|
|
|
+ break;
|
|
|
+ case R.id.btn_activity_update://确认修改
|
|
|
+ updateDataCommit();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据提交
|
|
|
+ */
|
|
|
+ private void updateDataCommit() {
|
|
|
+
|
|
|
+ if (TextUtils.isEmpty(areasOneV) || TextUtils.isEmpty(areasTwoV)) {
|
|
|
+ Toast.makeText(mContext, "请选择区域商圈", Toast.LENGTH_SHORT).show();
|
|
|
+ } else if (TextUtils.isEmpty(wylxV)) {
|
|
|
+ Toast.makeText(mContext, "请选择关注的物业类型", Toast.LENGTH_SHORT).show();
|
|
|
+ } else {
|
|
|
+ /*
|
|
|
+id:当前登录用户id
|
|
|
+cityId:城市id
|
|
|
+areaId:区域id
|
|
|
+businessId:商圈id
|
|
|
+wyType:物业类型
|
|
|
+
|
|
|
+http://localhost:8200/userWorkCity/saveUserWorkCity
|
|
|
+?id=1&cityId=1&areaId=4&businessId=1&wyType=1*/
|
|
|
+ mDialog4 = DialogUtil.createLoadingDialog(mContext, "加载中...");
|
|
|
+ mIWorkAreaAPresenter.commitData(Tool.getUser(mContext).getData().getId()
|
|
|
+ , cityIdStrV, areasOneV, areasTwoV, wylxV);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected int getLayout() {
|
|
|
+ return R.layout.activity_work_area;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initEvent() {
|
|
|
+ tv_app_title_title.setText("工作区域");
|
|
|
+ rl_app_title_return.setOnClickListener(this);
|
|
|
+
|
|
|
+ mIWorkAreaAPresenter = new WorkAreaAPresenterImpl(this);
|
|
|
+ initListener();
|
|
|
+
|
|
|
+ //首先进行数据回显数据展示
|
|
|
+ mDialog = DialogUtil.createLoadingDialog(mContext, "加载中...");
|
|
|
+ mIWorkAreaAPresenter.findEntityById(Tool.getUser(mContext).getData().getId());
|
|
|
+ //获取城市数据列表
|
|
|
+ mIWorkAreaAPresenter.getOpenedCityList();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initListener() {
|
|
|
+ rl_activity_work_area_dqgzcs.setOnClickListener(this);
|
|
|
+ rl_activity_work_area_qy.setOnClickListener(this);
|
|
|
+ rl_activity_work_area_gzdwylx.setOnClickListener(this);
|
|
|
+ btn_activity_update.setOnClickListener(this);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public <T> T request(int requestFlag) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public <T> void response(T response, int responseFlag) {
|
|
|
+ switch (responseFlag) {
|
|
|
+ case 1://工作管理数据回显绑定
|
|
|
+ String str = (String) response;
|
|
|
+ WorkAreaEntity workAreaEntity = JSONObject.parseObject(str, WorkAreaEntity.class);
|
|
|
+ initDataViewBind(workAreaEntity);
|
|
|
+ break;
|
|
|
+ case 2://获取开通城市数据信息,底部弹窗数据绑定
|
|
|
+ selectCityListEntity = (SelectCityListEntity) response;
|
|
|
+ initCityData(selectCityListEntity.getData());
|
|
|
+ break;
|
|
|
+ case 3://区域商圈数据加载绑定
|
|
|
+ String str2 = (String) response;
|
|
|
+ WorkAreaSqEntity workAreaSqEntity = JSONObject.parseObject(str2, WorkAreaSqEntity.class);
|
|
|
+ initSqLxDataViewBind(workAreaSqEntity);
|
|
|
+ break;
|
|
|
+ case 4://保存成功
|
|
|
+ if (mDialog4 != null) {
|
|
|
+ DialogUtil.closeDialog(mDialog4);
|
|
|
+ }
|
|
|
+ Toast.makeText(mContext, "信息保存成功~", Toast.LENGTH_SHORT).show();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 区域商圈,物业类型数据绑定
|
|
|
+ *
|
|
|
+ * @param workAreaSqEntity
|
|
|
+ */
|
|
|
+ private void initSqLxDataViewBind(WorkAreaSqEntity workAreaSqEntity) {
|
|
|
+ //区域商圈数据绑定
|
|
|
+ initAreasDataBind(workAreaSqEntity.getList());
|
|
|
+ //类型绑定
|
|
|
+ initWylxData(workAreaSqEntity.getWyTypeList());
|
|
|
+ if (mDialog2 != null) {
|
|
|
+ DialogUtil.closeDialog(mDialog2);
|
|
|
+ }
|
|
|
+ if (mDialog3 != null) {
|
|
|
+ DialogUtil.closeDialog(mDialog3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 区域商圈赋值
|
|
|
+ *
|
|
|
+ * @param shopAreas
|
|
|
+ */
|
|
|
+ private void initAreasDataBind(List<WorkAreaSqEntity.ListBean> shopAreas) {
|
|
|
+ DisplayMetrics metrics = new DisplayMetrics();
|
|
|
+ getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
|
|
+ int screenHeight = metrics.heightPixels;
|
|
|
+ window_wz = new CommonPopupWindow(mContext, R.layout.pop_arease, ViewGroup.LayoutParams.MATCH_PARENT, (int) (screenHeight * 0.5)) {
|
|
|
+ @Override
|
|
|
+ protected void initView() {
|
|
|
+ View view = getContentView();
|
|
|
+ lv_areas_one = view.findViewById(R.id.lv_item_double_list_1);
|
|
|
+ lv_areas_two = view.findViewById(R.id.lv_item_double_list_2);
|
|
|
+
|
|
|
+ //赋值操作
|
|
|
+ //区域
|
|
|
+ popAreasOneAdapter = new PopWorkAreasOneAdapter(mContext, shopAreas);
|
|
|
+ lv_areas_one.setAdapter(popAreasOneAdapter);
|
|
|
+
|
|
|
+ //商圈
|
|
|
+ popAreasTwoAdapter = new PopWorkAreasTwoAdapter(mContext, shopAreas.get(0).getBusinessCircles());
|
|
|
+ lv_areas_two.setAdapter(popAreasTwoAdapter);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initEvent() {
|
|
|
+
|
|
|
+ //设置点击事件
|
|
|
+ lv_areas_one.setOnItemClickListener((parent, view, position, id) -> {
|
|
|
+ //改变选中的字体颜色
|
|
|
+ popAreasOneAdapter.setCheckItem(position);
|
|
|
+ //点击赋值操作
|
|
|
+ areasOne = shopAreas.get(position).getName();
|
|
|
+ areasOneV = shopAreas.get(position).getId();
|
|
|
+
|
|
|
+ //重新给二级赋值
|
|
|
+ childListBeanXList = shopAreas.get(position).getBusinessCircles();
|
|
|
+ popAreasTwoAdapter = new PopWorkAreasTwoAdapter(mContext, childListBeanXList);
|
|
|
+ lv_areas_two.setAdapter(popAreasTwoAdapter);
|
|
|
+ //二级点击事件
|
|
|
+ lv_areas_two.setOnItemClickListener((parent1, view1, position1, id1) -> {
|
|
|
+ popAreasTwoAdapter.setCheckItem(position1);
|
|
|
+ areasTwo = childListBeanXList.get(position1).getName();
|
|
|
+ areasTwoV = childListBeanXList.get(position1).getId();
|
|
|
+ //页面选择之后展示
|
|
|
+ if (areasOne.equals("请选择") && areasTwo.equals("请选择")) {
|
|
|
+ tv_activity_work_area_qy.setText("请选择区域商圈");
|
|
|
+ } else {
|
|
|
+ tv_activity_work_area_qy.setText(areasOne + "-" + areasTwo);
|
|
|
+ }
|
|
|
+ window_wz.dismisss();
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ //如果没有点击第一个列表直接点击二级,默认父级为一级
|
|
|
+ lv_areas_two.setOnItemClickListener((parent, view, position, id) -> {
|
|
|
+ popAreasTwoAdapter.setCheckItem(position);
|
|
|
+ if (position == 0) {
|
|
|
+ tv_activity_work_area_qy.setText("请选择区域上去按");
|
|
|
+ } else {
|
|
|
+ tv_activity_work_area_qy.setText(shopAreas.get(0).getName()
|
|
|
+ + "-" + shopAreas.get(0).getBusinessCircles().get(position).getName());
|
|
|
+ }
|
|
|
+ areasOneV = shopAreas.get(0).getId();
|
|
|
+ areasTwoV = shopAreas.get(0).getBusinessCircles().get(position).getId();
|
|
|
+ window_wz.dismisss();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initWindow() {
|
|
|
+ super.initWindow();
|
|
|
+ PopupWindow instance = getPopupWindow();
|
|
|
+ instance.setOnDismissListener(new PopupWindow.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss() {
|
|
|
+ WindowManager.LayoutParams lp = getWindow().getAttributes();
|
|
|
+ lp.alpha = 1.0f;
|
|
|
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
|
|
+ getWindow().setAttributes(lp);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initDataViewBind(WorkAreaEntity workAreaEntity) {
|
|
|
+ cityIdStr = workAreaEntity.getData().getCityId();
|
|
|
+ cityIdStrV = workAreaEntity.getData().getCityId();
|
|
|
+
|
|
|
+ areasOneV = workAreaEntity.getData().getAreaId();
|
|
|
+ areasTwoV = workAreaEntity.getData().getBusinessId();
|
|
|
+
|
|
|
+ wylxV = workAreaEntity.getData().getWyType();
|
|
|
+
|
|
|
+ //知道当前城市获取当前的区域内容
|
|
|
+ mIWorkAreaAPresenter.findAreaBusinessList(cityIdStr);
|
|
|
+ //先判断当前用户是否保存过工作区域,如果有true展示保存内容,否则默认值处理
|
|
|
+ tv_activity_work_area_dqgzcs.setText(workAreaEntity.getData().getCityName());
|
|
|
+ //
|
|
|
+ if (workAreaEntity.isFlag()) {//保存过工作区域
|
|
|
+ tv_activity_work_area_qy.setText(workAreaEntity.getData().getAreaName() + "-" + workAreaEntity.getData().getBusinessName());
|
|
|
+ tv_activity_work_area_gzdwylx.setText(workAreaEntity.getData().getWyName());
|
|
|
+
|
|
|
+ } else {
|
|
|
+ tv_activity_work_area_qy.setText("请选择区域商圈");
|
|
|
+ tv_activity_work_area_gzdwylx.setText("请选择关注的物业类型");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mDialog != null) {
|
|
|
+ DialogUtil.closeDialog(mDialog);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城市底部弹窗框
|
|
|
+ *
|
|
|
+ * @param payMethodList
|
|
|
+ */
|
|
|
+ private void initCityData(List<SelectCityListEntity.DataBean> payMethodList) {
|
|
|
+ DisplayMetrics metrics = new DisplayMetrics();
|
|
|
+ getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
|
|
+ int screenHeight = metrics.heightPixels;
|
|
|
+ window_city = new CommonPopupWindow(mContext, R.layout.pop_arease, ViewGroup.LayoutParams.MATCH_PARENT, (int) (screenHeight * 0.4)) {
|
|
|
+ @Override
|
|
|
+ protected void initView() {
|
|
|
+ View view = getContentView();
|
|
|
+ lv_areas_one_fkfs = view.findViewById(R.id.lv_item_double_list_1);
|
|
|
+ lv_areas_two_fkfs = view.findViewById(R.id.lv_item_double_list_2);
|
|
|
+
|
|
|
+ lv_areas_two_fkfs.setVisibility(View.GONE);
|
|
|
+ //赋值操作
|
|
|
+ //区域
|
|
|
+ popFkfsAdapter = new PopCityAdapter(mContext, payMethodList);
|
|
|
+ lv_areas_one_fkfs.setAdapter(popFkfsAdapter);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initEvent() {
|
|
|
+ //设置点击事件
|
|
|
+ lv_areas_one_fkfs.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ //改变选中的字体颜色
|
|
|
+ popFkfsAdapter.setCheckItem(position);
|
|
|
+ //点击赋值操作
|
|
|
+ cityIdStrV = payMethodList.get(position).getId();
|
|
|
+ cityIdStr = payMethodList.get(position).getId();
|
|
|
+ tv_activity_work_area_dqgzcs.setText(payMethodList.get(position).getName());
|
|
|
+ window_city.dismisss();
|
|
|
+ getQsData(cityIdStr);
|
|
|
+ //
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initWindow() {
|
|
|
+ super.initWindow();
|
|
|
+ PopupWindow instance = getPopupWindow();
|
|
|
+ instance.setOnDismissListener(new PopupWindow.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss() {
|
|
|
+ WindowManager.LayoutParams lp = getWindow().getAttributes();
|
|
|
+ lp.alpha = 1.0f;
|
|
|
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
|
|
+ getWindow().setAttributes(lp);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ if (mDialog3 != null) {
|
|
|
+ DialogUtil.closeDialog(mDialog3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 物业类型
|
|
|
+ *
|
|
|
+ * @param payMethodList
|
|
|
+ */
|
|
|
+ private void initWylxData(List<WorkAreaSqEntity.WyTypeListBean> payMethodList) {
|
|
|
+ DisplayMetrics metrics = new DisplayMetrics();
|
|
|
+ getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
|
|
+ int screenHeight = metrics.heightPixels;
|
|
|
+ window_wylx = new CommonPopupWindow(mContext, R.layout.pop_arease, ViewGroup.LayoutParams.MATCH_PARENT, (int) (screenHeight * 0.4)) {
|
|
|
+ @Override
|
|
|
+ protected void initView() {
|
|
|
+ View view = getContentView();
|
|
|
+ lv_areas_one_wylx = view.findViewById(R.id.lv_item_double_list_1);
|
|
|
+ lv_areas_two_wylx = view.findViewById(R.id.lv_item_double_list_2);
|
|
|
+
|
|
|
+ lv_areas_two_wylx.setVisibility(View.GONE);
|
|
|
+ //赋值操作
|
|
|
+ //区域
|
|
|
+ popWylxAdapter = new PopWylxAdapter(mContext, payMethodList);
|
|
|
+ lv_areas_one_wylx.setAdapter(popWylxAdapter);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initEvent() {
|
|
|
+ //设置点击事件
|
|
|
+ lv_areas_one_wylx.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ //改变选中的字体颜色
|
|
|
+ popWylxAdapter.setCheckItem(position);
|
|
|
+ //点击赋值操作
|
|
|
+ wylxV = payMethodList.get(position).getD_value();
|
|
|
+ tv_activity_work_area_gzdwylx.setText(payMethodList.get(position).getD_name());
|
|
|
+ window_wylx.dismisss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initWindow() {
|
|
|
+ super.initWindow();
|
|
|
+ PopupWindow instance = getPopupWindow();
|
|
|
+ instance.setOnDismissListener(new PopupWindow.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss() {
|
|
|
+ WindowManager.LayoutParams lp = getWindow().getAttributes();
|
|
|
+ lp.alpha = 1.0f;
|
|
|
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
|
|
+ getWindow().setAttributes(lp);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void getQsData(String cityid) {
|
|
|
+ //http://localhost:8200/userWorkCity/findAreaBusinessList?
|
|
|
+ tv_activity_work_area_qy.setText("请选择区域商圈");
|
|
|
+ mDialog2 = DialogUtil.createLoadingDialog(mContext, "加载中...");
|
|
|
+ mIWorkAreaAPresenter.findAreaBusinessList(cityid);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城市弹窗打开
|
|
|
+ */
|
|
|
+ private void openCityPop() {
|
|
|
+ Tool.hideKeyboard(WorkAreaActivity.this, activity_popup);
|
|
|
+ win_city = window_city.getPopupWindow();
|
|
|
+ win_city.setAnimationStyle(R.style.animTranslate);
|
|
|
+
|
|
|
+ window_city.showAtLocation(activity_popup, Gravity.BOTTOM, 0, 0);
|
|
|
+ WindowManager.LayoutParams lp = getWindow().getAttributes();
|
|
|
+ lp.alpha = 0.3f;
|
|
|
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
|
|
+// lp.width=activityPopup.getWidth()* 9 / 10; // 设置宽度
|
|
|
+ getWindow().setAttributes(lp);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 区域商圈打开
|
|
|
+ */
|
|
|
+ private void openAreasPop() {
|
|
|
+ Tool.hideKeyboard(WorkAreaActivity.this, activity_popup);
|
|
|
+ win_wz = window_wz.getPopupWindow();
|
|
|
+ win_wz.setAnimationStyle(R.style.animTranslate);
|
|
|
+
|
|
|
+ window_wz.showAtLocation(activity_popup, Gravity.BOTTOM, 0, 0);
|
|
|
+ WindowManager.LayoutParams lp = getWindow().getAttributes();
|
|
|
+ lp.alpha = 0.3f;
|
|
|
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
|
|
+// lp.width=activityPopup.getWidth()* 9 / 10; // 设置宽度
|
|
|
+ getWindow().setAttributes(lp);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城市弹窗打开
|
|
|
+ */
|
|
|
+ private void openWylxPop() {
|
|
|
+ Tool.hideKeyboard(WorkAreaActivity.this, activity_popup);
|
|
|
+ win_wylx = window_wylx.getPopupWindow();
|
|
|
+ win_wylx.setAnimationStyle(R.style.animTranslate);
|
|
|
+
|
|
|
+ window_wylx.showAtLocation(activity_popup, Gravity.BOTTOM, 0, 0);
|
|
|
+ WindowManager.LayoutParams lp = getWindow().getAttributes();
|
|
|
+ lp.alpha = 0.3f;
|
|
|
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
|
|
+// lp.width=activityPopup.getWidth()* 9 / 10; // 设置宽度
|
|
|
+ getWindow().setAttributes(lp);
|
|
|
+ }
|
|
|
+}
|