作者 liming

修改筛选弹窗

@@ -9,3 +9,4 @@ @@ -9,3 +9,4 @@
9 /build 9 /build
10 /captures 10 /captures
11 .externalNativeBuild 11 .externalNativeBuild
  12 +/.idea
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="Encoding" addBOMForNewFiles="with NO BOM" />  
4 -</project>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="GradleSettings">  
4 - <option name="linkedExternalProjectsSettings">  
5 - <GradleProjectSettings>  
6 - <option name="distributionType" value="DEFAULT_WRAPPED" />  
7 - <option name="externalProjectPath" value="$PROJECT_DIR$" />  
8 - <option name="modules">  
9 - <set>  
10 - <option value="$PROJECT_DIR$" />  
11 - <option value="$PROJECT_DIR$/app" />  
12 - </set>  
13 - </option>  
14 - <option name="resolveModulePerSourceSet" value="false" />  
15 - </GradleProjectSettings>  
16 - </option>  
17 - </component>  
18 -</project>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="NullableNotNullManager">  
4 - <option name="myDefaultNullable" value="android.support.annotation.Nullable" />  
5 - <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />  
6 - <option name="myNullables">  
7 - <value>  
8 - <list size="10">  
9 - <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />  
10 - <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />  
11 - <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />  
12 - <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />  
13 - <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />  
14 - <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />  
15 - <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />  
16 - <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />  
17 - <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />  
18 - <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />  
19 - </list>  
20 - </value>  
21 - </option>  
22 - <option name="myNotNulls">  
23 - <value>  
24 - <list size="9">  
25 - <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />  
26 - <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />  
27 - <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />  
28 - <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />  
29 - <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />  
30 - <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />  
31 - <item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />  
32 - <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />  
33 - <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />  
34 - </list>  
35 - </value>  
36 - </option>  
37 - </component>  
38 - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">  
39 - <output url="file://$PROJECT_DIR$/build/classes" />  
40 - </component>  
41 - <component name="ProjectType">  
42 - <option name="id" value="Android" />  
43 - </component>  
44 -</project>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="NullableNotNullManager">  
4 - <option name="myDefaultNullable" value="android.support.annotation.Nullable" />  
5 - <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />  
6 - <option name="myNullables">  
7 - <value>  
8 - <list size="7">  
9 - <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />  
10 - <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />  
11 - <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />  
12 - <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />  
13 - <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />  
14 - <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />  
15 - <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />  
16 - </list>  
17 - </value>  
18 - </option>  
19 - <option name="myNotNulls">  
20 - <value>  
21 - <list size="6">  
22 - <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />  
23 - <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />  
24 - <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />  
25 - <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />  
26 - <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />  
27 - <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />  
28 - </list>  
29 - </value>  
30 - </option>  
31 - </component>  
32 -=======  
33 ->>>>>>> liming  
34 - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">  
35 - <output url="file://$PROJECT_DIR$/build/classes" />  
36 - </component>  
37 - <component name="ProjectType">  
38 - <option name="id" value="Android" />  
39 - </component>  
40 -</project>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="NullableNotNullManager">  
4 - <option name="myDefaultNullable" value="android.support.annotation.Nullable" />  
5 - <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />  
6 - <option name="myNullables">  
7 - <value>  
8 - <list size="7">  
9 - <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />  
10 - <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />  
11 - <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />  
12 - <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />  
13 - <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />  
14 - <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />  
15 - <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />  
16 - </list>  
17 - </value>  
18 - </option>  
19 - <option name="myNotNulls">  
20 - <value>  
21 - <list size="6">  
22 - <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />  
23 - <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />  
24 - <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />  
25 - <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />  
26 - <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />  
27 - <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />  
28 - </list>  
29 - </value>  
30 - </option>  
31 - </component>  
32 - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">  
33 - <output url="file://$PROJECT_DIR$/build/classes" />  
34 - </component>  
35 - <component name="ProjectType">  
36 - <option name="id" value="Android" />  
37 - </component>  
38 -</project>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">  
4 - <output url="file://$PROJECT_DIR$/build/classes" />  
5 - </component>  
6 - <component name="ProjectType">  
7 - <option name="id" value="Android" />  
8 - </component>  
9 -</project>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="RunConfigurationProducerService">  
4 - <option name="ignoredProducers">  
5 - <set>  
6 - <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />  
7 - <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />  
8 - <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />  
9 - </set>  
10 - </option>  
11 - </component>  
12 -</project>  
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="GitSharedSettings">  
4 - <option name="FORCE_PUSH_PROHIBITED_PATTERNS">  
5 - <list>  
6 - <option value="liming" />  
7 - </list>  
8 - </option>  
9 - </component>  
10 - <component name="VcsDirectoryMappings">  
11 - <mapping directory="" vcs="Git" />  
12 - </component>  
13 -</project>  
@@ -11,8 +11,6 @@ android { @@ -11,8 +11,6 @@ android {
11 } 11 }
12 }*/ 12 }*/
13 13
14 -  
15 -  
16 compileSdkVersion 28 14 compileSdkVersion 28
17 defaultConfig { 15 defaultConfig {
18 applicationId "com.hh.xuetubao" 16 applicationId "com.hh.xuetubao"
不能预览此文件类型
@@ -38,6 +38,8 @@ import com.hh.xuetubao.model.ZhaopinModel; @@ -38,6 +38,8 @@ import com.hh.xuetubao.model.ZhaopinModel;
38 import com.hh.xuetubao.mvp.BaseMvpActivity; 38 import com.hh.xuetubao.mvp.BaseMvpActivity;
39 import com.hh.xuetubao.mvp.CommonPresenter; 39 import com.hh.xuetubao.mvp.CommonPresenter;
40 import com.hh.xuetubao.mvp.ICommonView; 40 import com.hh.xuetubao.mvp.ICommonView;
  41 +import com.hh.xuetubao.stacklabel.OnLabelClickListener;
  42 +import com.hh.xuetubao.stacklabel.StackLabel;
41 43
42 import java.util.ArrayList; 44 import java.util.ArrayList;
43 import java.util.List; 45 import java.util.List;
@@ -86,7 +88,14 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -86,7 +88,14 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
86 private PopCityListAdapter popCityListAdapter; 88 private PopCityListAdapter popCityListAdapter;
87 89
88 SelectBean beanA = new SelectBean(); 90 SelectBean beanA = new SelectBean();
89 - SelectBean beanB = new SelectBean(); 91 + SelectBean cityBean = new SelectBean();
  92 +
  93 +
  94 + // 类别
  95 + List<String> lebeiA = new ArrayList<>(); // 数据
  96 + List<String> lebeiB = new ArrayList<>(); // 数据
  97 + List<String> lb_one = new ArrayList<>(); // 选中
  98 + List<String> lb_two = new ArrayList<>(); // 选中
90 99
91 @Override 100 @Override
92 public void initView() { 101 public void initView() {
@@ -142,7 +151,6 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -142,7 +151,6 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
142 doRequset(requsetBody); 151 doRequset(requsetBody);
143 152
144 mPresenter.getPresenter(7, 1, String.valueOf(true)); 153 mPresenter.getPresenter(7, 1, String.valueOf(true));
145 -  
146 mPresenter.getPresenter(8, 1, String.valueOf(0), String.valueOf(true)); 154 mPresenter.getPresenter(8, 1, String.valueOf(0), String.valueOf(true));
147 mPresenter.getPresenter(8, 2, String.valueOf(1), String.valueOf(true)); 155 mPresenter.getPresenter(8, 2, String.valueOf(1), String.valueOf(true));
148 mPresenter.getPresenter(8, 3, String.valueOf(3), String.valueOf(true)); 156 mPresenter.getPresenter(8, 3, String.valueOf(3), String.valueOf(true));
@@ -185,36 +193,21 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -185,36 +193,21 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
185 AddressBean bean = (AddressBean) o; 193 AddressBean bean = (AddressBean) o;
186 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 194 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
187 hangyeList.addAll(propListBeans); 195 hangyeList.addAll(propListBeans);
  196 + for (int i = 0; i < hangyeList.size(); i++) {
  197 + String propName = hangyeList.get(i).getPropName();
  198 + lebeiA.add(propName);
  199 + }
  200 + lb_one.add(hangyeList.get(0).getPropName());
188 } 201 }
189 if (api == 8 && intent == 2) { 202 if (api == 8 && intent == 2) {
190 AddressBean bean = (AddressBean) o; 203 AddressBean bean = (AddressBean) o;
191 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 204 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
192 zhinengList.addAll(propListBeans); 205 zhinengList.addAll(propListBeans);
193 - }  
194 - if (api == 8 && intent == 3) {  
195 - AddressBean bean = (AddressBean) o;  
196 - List<AddressBean.PropListBean> propListBeans = bean.getPropList();  
197 - xingzhiList.addAll(propListBeans);  
198 - }  
199 - if (api == 8 && intent == 4) {  
200 - AddressBean bean = (AddressBean) o;  
201 - List<AddressBean.PropListBean> propListBeans = bean.getPropList();  
202 - guiMoList.addAll(propListBeans);  
203 - }  
204 - if (api == 8 && intent == 5) {  
205 - AddressBean bean = (AddressBean) o;  
206 - List<AddressBean.PropListBean> propListBeans = bean.getPropList();  
207 - xueLiList.addAll(propListBeans);  
208 - }  
209 - if (api == 8 && intent == 6) {  
210 - AddressBean bean = (AddressBean) o;  
211 - List<AddressBean.PropListBean> propListBeans = bean.getPropList();  
212 - jingYanList.addAll(propListBeans);  
213 - }  
214 - if (api == 8 && intent == 7) {  
215 - AddressBean bean = (AddressBean) o;  
216 - List<AddressBean.PropListBean> propListBeans = bean.getPropList();  
217 - zhiYeList.addAll(propListBeans); 206 + for (int i = 0; i < zhinengList.size(); i++) {
  207 + String propName = zhinengList.get(i).getPropName();
  208 + lebeiB.add(propName);
  209 + }
  210 + lb_two.add(zhinengList.get(0).getPropName());
218 } 211 }
219 212
220 } 213 }
@@ -241,17 +234,17 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -241,17 +234,17 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
241 Intent intent = new Intent(this, CompanyDetailActivity.class); 234 Intent intent = new Intent(this, CompanyDetailActivity.class);
242 intent.putExtra("CompanyOid", CompanyOid); 235 intent.putExtra("CompanyOid", CompanyOid);
243 startActivity(intent); 236 startActivity(intent);
244 -  
245 } 237 }
246 238
247 @Override 239 @Override
248 public void onClick(View v) { 240 public void onClick(View v) {
249 switch (v.getId()) { 241 switch (v.getId()) {
250 case R.id.lin_leibie: 242 case R.id.lin_leibie:
251 - showCategoryPop(hangyeList, zhinengList); 243 + showDrop1(lebeiA,lebeiB);
252 break; 244 break;
253 case R.id.lin_city: 245 case R.id.lin_city:
254 - showCityPop(provinceList, cityList); 246 +// showCityPop(provinceList, cityList);
  247 + showCityPop(CompanyActivity.this, provinceList, cityList);
255 break; 248 break;
256 } 249 }
257 } 250 }
@@ -268,7 +261,7 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -268,7 +261,7 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
268 super.onNext(value); 261 super.onNext(value);
269 CompanyBean bean = (CompanyBean) value; 262 CompanyBean bean = (CompanyBean) value;
270 List<CompanyBean.CompanyListBean> listBeans = bean.getCompanyList(); 263 List<CompanyBean.CompanyListBean> listBeans = bean.getCompanyList();
271 - 264 + Log.e("listBeans",listBeans.toString().trim());
272 companyList.clear(); 265 companyList.clear();
273 companyList.addAll(listBeans); 266 companyList.addAll(listBeans);
274 companyRecAdapter.notifyDataSetChanged(); 267 companyRecAdapter.notifyDataSetChanged();
@@ -288,23 +281,23 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -288,23 +281,23 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
288 } 281 }
289 282
290 //职位->城市弹窗 283 //职位->城市弹窗
291 - private void showCityPop(final List<AddressBean.ProvListBean> provinceList, final List<AddressBean.CityListBean> cityList) { 284 + private void showCityPop(final CompanyActivity activity, final List<AddressBean.ProvListBean> provinceList, final List<AddressBean.CityListBean> cityList) {
292 285
293 - View contentView = LayoutInflater.from(this).inflate(R.layout.pop_city, null); 286 + View contentView = LayoutInflater.from(CompanyActivity.this).inflate(R.layout.pop_city, null);
294 final ListView listOne = (ListView) contentView.findViewById(R.id.list_one); 287 final ListView listOne = (ListView) contentView.findViewById(R.id.list_one);
295 final ListView listTwo = (ListView) contentView.findViewById(R.id.list_two); 288 final ListView listTwo = (ListView) contentView.findViewById(R.id.list_two);
296 final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset); 289 final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
297 final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure); 290 final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
298 291
299 - final PopProvinceListAdapter popListAdapter = new PopProvinceListAdapter(provinceList, this); 292 + final PopProvinceListAdapter popListAdapter = new PopProvinceListAdapter(provinceList, CompanyActivity.this);
300 listOne.setAdapter(popListAdapter); 293 listOne.setAdapter(popListAdapter);
301 - popCityListAdapter = new PopCityListAdapter(cityList, this); 294 + popCityListAdapter = new PopCityListAdapter(cityList, CompanyActivity.this);
302 listTwo.setAdapter(popCityListAdapter); 295 listTwo.setAdapter(popCityListAdapter);
303 296
304 - if (beanB.getSelectA() != 0) { 297 + if (cityBean.getSelectA() != 0) {
305 listTwo.setVisibility(View.VISIBLE); 298 listTwo.setVisibility(View.VISIBLE);
306 - popListAdapter.change(beanB.getSelectA());  
307 - popCityListAdapter.change(beanB.getSelectB()); 299 + popListAdapter.change(cityBean.getSelectA());
  300 + popCityListAdapter.change(cityBean.getSelectB());
308 } else { 301 } else {
309 listTwo.setVisibility(View.INVISIBLE); 302 listTwo.setVisibility(View.INVISIBLE);
310 } 303 }
@@ -312,30 +305,31 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -312,30 +305,31 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
312 listOne.setOnItemClickListener(new AdapterView.OnItemClickListener() { 305 listOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
313 @Override 306 @Override
314 public void onItemClick(AdapterView<?> parent, View view, int position, long id) { 307 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
315 - requsetBody.setProvinceId(provinceList.get(position).getProvOid());  
316 - 308 +// requsetBody.setProvinceId(provinceList.get(position).getProvOid());
  309 + Log.e("requestBodyA",requsetBody.toString());
317 if (position == 0) { 310 if (position == 0) {
318 proviceId = provinceList.get(1).getProvOid(); 311 proviceId = provinceList.get(1).getProvOid();
319 listTwo.setVisibility(View.INVISIBLE); 312 listTwo.setVisibility(View.INVISIBLE);
320 - beanB.setSelectB(0);  
321 - } else if (beanB.getSelectA() == position && beanB.getSelectA() != 0) { 313 + cityBean.setSelectB(0);
  314 + requsetBody.setProvinceId(null); // 不限
  315 + requsetBody.setCityId(null); // 不限
  316 +
  317 + } else if (cityBean.getSelectA() == position && cityBean.getSelectA() != 0) {
322 listTwo.setVisibility(View.VISIBLE); 318 listTwo.setVisibility(View.VISIBLE);
323 - popCityListAdapter.change(beanB.getSelectB());  
324 - beanB.setSelectB(beanB.getSelectB()); 319 + popCityListAdapter.change(cityBean.getSelectB());
  320 + cityBean.setSelectB(cityBean.getSelectB());
  321 + requsetBody.setProvinceId(provinceList.get(position).getProvOid());
325 } else { 322 } else {
326 proviceId = provinceList.get(position).getProvOid(); 323 proviceId = provinceList.get(position).getProvOid();
327 listTwo.setVisibility(View.VISIBLE); 324 listTwo.setVisibility(View.VISIBLE);
328 popCityListAdapter.change(0); 325 popCityListAdapter.change(0);
  326 + requsetBody.setProvinceId(provinceList.get(position).getProvOid());
329 } 327 }
330 -  
331 -// if (position == 0) {  
332 -// proviceId = provinceList.get(1).getProvOid();  
333 -// } else {  
334 -// proviceId = provinceList.get(position).getProvOid();  
335 -// } 328 +// model.getModel(activity, 7, 2, proviceId, String.valueOf(true));
336 mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true)); 329 mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
  330 +
337 popListAdapter.change(position); 331 popListAdapter.change(position);
338 - beanB.setSelectA(position); 332 + cityBean.setSelectA(position);
339 333
340 } 334 }
341 }); 335 });
@@ -343,9 +337,14 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -343,9 +337,14 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
343 listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() { 337 listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
344 @Override 338 @Override
345 public void onItemClick(AdapterView<?> parent, View view, int position, long id) { 339 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
346 - requsetBody.setCityId(cityList.get(position).getCityId()); 340 + if(position == 0){
  341 + requsetBody.setCityId(null);
  342 + }else {
  343 + requsetBody.setCityId(cityList.get(position).getCityId());
  344 + }
  345 + Log.e("requestBodyB",requsetBody.toString());
347 popCityListAdapter.change(position); // 改 346 popCityListAdapter.change(position); // 改
348 - beanB.setSelectB(position); 347 + cityBean.setSelectB(position);
349 } 348 }
350 }); 349 });
351 350
@@ -361,57 +360,175 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -361,57 +360,175 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
361 @Override 360 @Override
362 public void onClick(View v) { 361 public void onClick(View v) {
363 362
364 - beanB.setSelectA(0);  
365 - beanB.setSelectB(0);  
366 -  
367 -// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
368 -// reset.setTextColor(getResources().getColor(R.color.color_ffffff));  
369 -// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
370 -// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));  
371 -  
372 requsetBody.setProvinceId(null); 363 requsetBody.setProvinceId(null);
373 requsetBody.setCityId(null); 364 requsetBody.setCityId(null);
  365 +
  366 + cityBean.setSelectA(0);
  367 + cityBean.setSelectB(0);
  368 +
  369 + requsetBody.setProvinceId(provinceList.get(0).getProvOid());
  370 + proviceId = provinceList.get(1).getProvOid();
  371 + mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
  372 +
  373 + popListAdapter.change(0);
  374 + popCityListAdapter.change(0);
  375 + listTwo.setVisibility(View.INVISIBLE);
  376 +
374 } 377 }
375 }); 378 });
376 sure.setOnClickListener(new View.OnClickListener() { 379 sure.setOnClickListener(new View.OnClickListener() {
377 @Override 380 @Override
378 public void onClick(View v) { 381 public void onClick(View v) {
  382 + Log.e("requestBodyB",requsetBody.toString());
  383 + doRequset(requsetBody);
379 popupWindow.dismiss(); 384 popupWindow.dismiss();
380 - chageAlpha(1f);  
381 -// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
382 -// sure.setTextColor(getResources().getColor(R.color.color_ffffff));  
383 -// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
384 -// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));  
385 385
386 - doRequset(requsetBody);  
387 } 386 }
388 }); 387 });
  388 +
389 popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() { 389 popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
390 @Override 390 @Override
391 public void onDismiss() { 391 public void onDismiss() {
392 - chageAlpha(1f);  
393 } 392 }
394 }); 393 });
395 } 394 }
396 395
397 - //职位->类别弹窗  
398 - private void showCategoryPop(final List<AddressBean.PropListBean> propList, final List<AddressBean.PropListBean> zhinengList) {  
399 -  
400 - View contentView = LayoutInflater.from(this).inflate(R.layout.pop_category, null);  
401 - GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);  
402 - GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);  
403 - final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);  
404 - final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);  
405 -  
406 - final GridViewAdapter adapter = new GridViewAdapter(propList, this);  
407 - gridOne.setAdapter(adapter);  
408 - final GridViewAdapter adapter1 = new GridViewAdapter(zhinengList, this);  
409 - gridTwo.setAdapter(adapter1); 396 + //职位->城市弹窗
  397 +// private void showCityPop(final List<AddressBean.ProvListBean> provinceList, final List<AddressBean.CityListBean> cityList) {
  398 +//
  399 +// View contentView = LayoutInflater.from(this).inflate(R.layout.pop_city, null);
  400 +// final ListView listOne = (ListView) contentView.findViewById(R.id.list_one);
  401 +// final ListView listTwo = (ListView) contentView.findViewById(R.id.list_two);
  402 +// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
  403 +// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
  404 +//
  405 +// final PopProvinceListAdapter popListAdapter = new PopProvinceListAdapter(provinceList, this);
  406 +// listOne.setAdapter(popListAdapter);
  407 +// popCityListAdapter = new PopCityListAdapter(cityList, this);
  408 +// listTwo.setAdapter(popCityListAdapter);
  409 +//
  410 +// if (beanB.getSelectA() != 0) {
  411 +// listTwo.setVisibility(View.VISIBLE);
  412 +// popListAdapter.change(beanB.getSelectA());
  413 +// popCityListAdapter.change(beanB.getSelectB());
  414 +// } else {
  415 +// listTwo.setVisibility(View.INVISIBLE);
  416 +// }
  417 +//
  418 +// listOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  419 +// @Override
  420 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  421 +// requsetBody.setProvinceId(provinceList.get(position).getProvOid());
  422 +//
  423 +// if (position == 0) {
  424 +// proviceId = provinceList.get(1).getProvOid();
  425 +// listTwo.setVisibility(View.INVISIBLE);
  426 +// beanB.setSelectB(0);
  427 +// } else if (beanB.getSelectA() == position && beanB.getSelectA() != 0) {
  428 +// listTwo.setVisibility(View.VISIBLE);
  429 +// popCityListAdapter.change(beanB.getSelectB());
  430 +// beanB.setSelectB(beanB.getSelectB());
  431 +// } else {
  432 +// proviceId = provinceList.get(position).getProvOid();
  433 +// listTwo.setVisibility(View.VISIBLE);
  434 +// popCityListAdapter.change(0);
  435 +// }
  436 +//
  437 +// mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
  438 +// popListAdapter.change(position);
  439 +// beanB.setSelectA(position);
  440 +//
  441 +// }
  442 +// });
  443 +//
  444 +// listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  445 +// @Override
  446 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  447 +// requsetBody.setCityId(cityList.get(position).getCityId());
  448 +// popCityListAdapter.change(position); // 改
  449 +// beanB.setSelectB(position);
  450 +// }
  451 +// });
  452 +//
  453 +// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCity.getBottom());
  454 +// popupWindow.setOutsideTouchable(true);
  455 +// popupWindow.setTouchable(true);
  456 +// popupWindow.setFocusable(true);
  457 +// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
  458 +// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
  459 +// popupWindow.showAsDropDown(linCity);
  460 +//
  461 +// reset.setOnClickListener(new View.OnClickListener() {
  462 +// @Override
  463 +// public void onClick(View v) {
  464 +//
  465 +// beanB.setSelectA(0);
  466 +// beanB.setSelectB(0);
  467 +// requsetBody.setProvinceId(null);
  468 +// requsetBody.setCityId(null);
  469 +// }
  470 +// });
  471 +// sure.setOnClickListener(new View.OnClickListener() {
  472 +// @Override
  473 +// public void onClick(View v) {
  474 +// popupWindow.dismiss();
  475 +// chageAlpha(1f);
  476 +// doRequset(requsetBody);
  477 +// }
  478 +// });
  479 +// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
  480 +// @Override
  481 +// public void onDismiss() {
  482 +// chageAlpha(1f);
  483 +// }
  484 +// });
  485 +// }
  486 +
  487 + /* 类别 */
  488 + private void showDrop1(final List<String> lebeiA, final List<String> lebeiB) {
  489 +
  490 + View contentView = LayoutInflater.from(CompanyActivity.this).inflate(R.layout.pop_category, null);
  491 + final StackLabel stack1 = contentView.findViewById(R.id.stacklabel_a);
  492 + final StackLabel stack2 = contentView.findViewById(R.id.stacklabel_b);
  493 +
  494 + View reset = contentView.findViewById(R.id.tv_reset);
  495 + View sure = contentView.findViewById(R.id.tv_sure);
  496 +
  497 + stack1.setLabels(lebeiA);
  498 + stack2.setLabels(lebeiB);
  499 +
  500 + stack1.setSelectMode(true, lb_one);
  501 + stack2.setSelectMode(true, lb_two);
  502 +
  503 + stack1.setOnLabelClickListener(new OnLabelClickListener() {
  504 + @Override
  505 + public void onClick(int index, View v, String s) {
  506 + if (lb_one.size() > 1) {
  507 + lb_one.remove(1);
  508 + }
  509 + lb_one.remove(0);
  510 + lb_one.add(lebeiA.get(index));
  511 + stack1.setSelectMode(true, lb_one);
  512 + lb_one.add(index + "");
  513 + Log.e("lb_one", lb_one.toString());
  514 + }
  515 + });
410 516
411 - adapter.setClickPosition(beanA.getSelectA());  
412 - adapter1.setClickPosition(beanA.getSelectB()); 517 + stack2.setOnLabelClickListener(new OnLabelClickListener() {
  518 + @Override
  519 + public void onClick(int index, View v, String s) {
  520 + if (lb_two.size() > 1) {
  521 + lb_two.remove(1);
  522 + }
  523 + lb_two.remove(0);
  524 + lb_two.add(lebeiB.get(index));
  525 + stack2.setSelectMode(true, lb_two);
  526 + lb_two.add(index + "");
  527 + Log.e("lb_two", lb_two.toString());
  528 + }
  529 + });
413 530
414 - final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linLeibie.getBottom()); 531 + final PopupWindow popupWindow = new PopupWindow(contentView, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linLeibie.getBottom());
415 popupWindow.setOutsideTouchable(true); 532 popupWindow.setOutsideTouchable(true);
416 popupWindow.setTouchable(true); 533 popupWindow.setTouchable(true);
417 popupWindow.setFocusable(true); 534 popupWindow.setFocusable(true);
@@ -419,69 +536,113 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod @@ -419,69 +536,113 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
419 popupWindow.setAnimationStyle(R.style.AnimTopMiddle); 536 popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
420 popupWindow.showAsDropDown(linLeibie); 537 popupWindow.showAsDropDown(linLeibie);
421 538
422 - gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {  
423 - @Override  
424 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
425 - adapter.setClickPosition(position);  
426 - adapter.notifyDataSetChanged();  
427 - requsetBody.setCompanyIndustry(propList.get(position).getPropId());  
428 - beanA.setSelectA(position);  
429 - }  
430 - });  
431 -  
432 -  
433 - gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {  
434 - @Override  
435 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
436 - adapter1.setClickPosition(position);  
437 - adapter1.notifyDataSetChanged();  
438 - requsetBody.setJobFunction(zhinengList.get(position).getPropId());  
439 - beanA.setSelectB(position);  
440 - }  
441 - });  
442 -  
443 reset.setOnClickListener(new View.OnClickListener() { 539 reset.setOnClickListener(new View.OnClickListener() {
444 @Override 540 @Override
445 public void onClick(View v) { 541 public void onClick(View v) {
446 - reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
447 - reset.setTextColor(getResources().getColor(R.color.color_ffffff));  
448 - sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
449 - sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));  
450 542
451 - beanA.setSelectA(0);  
452 - beanB.setSelectB(0); 543 + if (lb_one.size() > 0) {
  544 + lb_one.remove(0);
  545 + }
453 546
454 - adapter.setClickPosition(0);  
455 - adapter.notifyDataSetChanged();  
456 - adapter1.setClickPosition(0);  
457 - adapter1.notifyDataSetChanged(); 547 + lb_one.add(lebeiA.get(0));
  548 + stack1.setSelectMode(true, lb_one);
458 549
459 - requsetBody.setCompanyIndustry(null);  
460 - requsetBody.setJobFunction(null); 550 + if (lb_two.size() > 0) {
  551 + lb_two.remove(0);
  552 + }
  553 + lb_two.add(lebeiB.get(0));
  554 + stack2.setSelectMode(true, lb_two);
461 } 555 }
462 }); 556 });
  557 +
463 sure.setOnClickListener(new View.OnClickListener() { 558 sure.setOnClickListener(new View.OnClickListener() {
464 @Override 559 @Override
465 public void onClick(View v) { 560 public void onClick(View v) {
466 - popupWindow.dismiss();  
467 - chageAlpha(1f);  
468 - sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
469 - sure.setTextColor(getResources().getColor(R.color.color_ffffff));  
470 - reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
471 - reset.setTextColor(getResources().getColor(R.color.color_6f6f6f)); 561 +
  562 + if (lb_one.size() > 0) {
  563 + if (!lb_one.get(0).equals("不限")) {
  564 + requsetBody.setCompanyIndustry(hangyeList.get(Integer.valueOf(lb_one.get(1))).getPropId());
  565 + } else {
  566 + requsetBody.setCompanyIndustry(null);
  567 + }
  568 + } else {
  569 + requsetBody.setCompanyIndustry(null);
  570 + }
  571 +
  572 + if (lb_two.size() > 0) {
  573 + if (!lb_two.get(0).equals("不限")) {
  574 + requsetBody.setJobFunction(zhinengList.get(Integer.valueOf(lb_two.get(1))).getPropId());
  575 + } else {
  576 + requsetBody.setJobFunction(null);
  577 + }
  578 + } else {
  579 + requsetBody.setJobFunction(null);
  580 + }
472 581
473 doRequset(requsetBody); 582 doRequset(requsetBody);
474 - }  
475 - });  
476 - popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {  
477 - @Override  
478 - public void onDismiss() {  
479 - chageAlpha(1f); 583 + popupWindow.dismiss();
480 } 584 }
481 }); 585 });
482 586
483 } 587 }
484 588
  589 +// //职位->类别弹窗
  590 +// private void showCategoryPop(final List<AddressBean.PropListBean> propList, final List<AddressBean.PropListBean> zhinengList) {
  591 +//
  592 +// View contentView = LayoutInflater.from(this).inflate(R.layout.pop_category, null);
  593 +//
  594 +// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
  595 +// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
  596 +//
  597 +// final GridViewAdapter adapter = new GridViewAdapter(propList, this);
  598 +//// gridOne.setAdapter(adapter);
  599 +// final GridViewAdapter adapter1 = new GridViewAdapter(zhinengList, this);
  600 +//// gridTwo.setAdapter(adapter1);
  601 +//
  602 +// adapter.setClickPosition(beanA.getSelectA());
  603 +// adapter1.setClickPosition(beanA.getSelectB());
  604 +//
  605 +// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linLeibie.getBottom());
  606 +// popupWindow.setOutsideTouchable(true);
  607 +// popupWindow.setTouchable(true);
  608 +// popupWindow.setFocusable(true);
  609 +// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
  610 +// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
  611 +// popupWindow.showAsDropDown(linLeibie);
  612 +//
  613 +// reset.setOnClickListener(new View.OnClickListener() {
  614 +// @Override
  615 +// public void onClick(View v) {
  616 +
  617 +// beanA.setSelectA(0);
  618 +// beanB.setSelectB(0);
  619 +//
  620 +// adapter.setClickPosition(0);
  621 +// adapter.notifyDataSetChanged();
  622 +// adapter1.setClickPosition(0);
  623 +// adapter1.notifyDataSetChanged();
  624 +//
  625 +// requsetBody.setCompanyIndustry(null);
  626 +// requsetBody.setJobFunction(null);
  627 +// }
  628 +// });
  629 +// sure.setOnClickListener(new View.OnClickListener() {
  630 +// @Override
  631 +// public void onClick(View v) {
  632 +// popupWindow.dismiss();
  633 +// doRequset(requsetBody);
  634 +// }
  635 +// });
  636 +// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
  637 +// @Override
  638 +// public void onDismiss() {
  639 +// chageAlpha(1f);
  640 +// }
  641 +// });
  642 +//
  643 +// }
  644 +
  645 +
485 private void chageAlpha(float color) { 646 private void chageAlpha(float color) {
486 /* 647 /*
487 WindowManager.LayoutParams lp = getWindow().getAttributes(); 648 WindowManager.LayoutParams lp = getWindow().getAttributes();
@@ -80,7 +80,7 @@ public class JobHuntCompanyAdapter extends RecyclerView.Adapter<JobHuntCompanyAd @@ -80,7 +80,7 @@ public class JobHuntCompanyAdapter extends RecyclerView.Adapter<JobHuntCompanyAd
80 80
81 @Override 81 @Override
82 public int getItemCount() { 82 public int getItemCount() {
83 - return 3; 83 + return list.size();
84 } 84 }
85 85
86 public class ViewHolder extends RecyclerView.ViewHolder { 86 public class ViewHolder extends RecyclerView.ViewHolder {
@@ -59,7 +59,7 @@ public class JobHuntWorkAdapter extends RecyclerView.Adapter<JobHuntWorkAdapter. @@ -59,7 +59,7 @@ public class JobHuntWorkAdapter extends RecyclerView.Adapter<JobHuntWorkAdapter.
59 59
60 @Override 60 @Override
61 public int getItemCount() { 61 public int getItemCount() {
62 - return 3; 62 + return list.size();
63 } 63 }
64 64
65 public class ViewHolder extends RecyclerView.ViewHolder { 65 public class ViewHolder extends RecyclerView.ViewHolder {
@@ -148,6 +148,37 @@ public class CompanyBean implements Serializable { @@ -148,6 +148,37 @@ public class CompanyBean implements Serializable {
148 public void setIndustry(String Industry) { 148 public void setIndustry(String Industry) {
149 this.Industry = Industry; 149 this.Industry = Industry;
150 } 150 }
  151 +
  152 + @Override
  153 + public String toString() {
  154 + return "IndustryListBean{" +
  155 + "Industry='" + Industry + '\'' +
  156 + '}';
  157 + }
  158 + }
  159 +
  160 + @Override
  161 + public String toString() {
  162 + return "CompanyListBean{" +
  163 + "CompanyOid='" + CompanyOid + '\'' +
  164 + ", CompanyLogo='" + CompanyLogo + '\'' +
  165 + ", CompanName='" + CompanName + '\'' +
  166 + ", Address='" + Address + '\'' +
  167 + ", CompanyNature='" + CompanyNature + '\'' +
  168 + ", CompanySize='" + CompanySize + '\'' +
  169 + ", PopularJobName='" + PopularJobName + '\'' +
  170 + ", PopularJobOid='" + PopularJobOid + '\'' +
  171 + ", JobCount=" + JobCount +
  172 + ", IndustryList=" + IndustryList +
  173 + '}';
151 } 174 }
152 } 175 }
  176 +
  177 + @Override
  178 + public String toString() {
  179 + return "CompanyBean{" +
  180 + "IsSuccess=" + IsSuccess +
  181 + ", CompanyList=" + CompanyList +
  182 + '}';
  183 + }
153 } 184 }
@@ -21,6 +21,7 @@ import android.widget.LinearLayout; @@ -21,6 +21,7 @@ import android.widget.LinearLayout;
21 import android.widget.ListView; 21 import android.widget.ListView;
22 import android.widget.PopupWindow; 22 import android.widget.PopupWindow;
23 import android.widget.TextView; 23 import android.widget.TextView;
  24 +import android.widget.Toast;
24 25
25 import com.hh.xuetubao.MyServer; 26 import com.hh.xuetubao.MyServer;
26 import com.hh.xuetubao.R; 27 import com.hh.xuetubao.R;
@@ -40,6 +41,8 @@ import com.hh.xuetubao.model.ZhaopinModel; @@ -40,6 +41,8 @@ import com.hh.xuetubao.model.ZhaopinModel;
40 import com.hh.xuetubao.mvp.BaseMvpFragment; 41 import com.hh.xuetubao.mvp.BaseMvpFragment;
41 import com.hh.xuetubao.mvp.CommonPresenter; 42 import com.hh.xuetubao.mvp.CommonPresenter;
42 import com.hh.xuetubao.mvp.ICommonView; 43 import com.hh.xuetubao.mvp.ICommonView;
  44 +import com.hh.xuetubao.stacklabel.OnLabelClickListener;
  45 +import com.hh.xuetubao.stacklabel.StackLabel;
43 46
44 import java.util.ArrayList; 47 import java.util.ArrayList;
45 import java.util.List; 48 import java.util.List;
@@ -96,6 +99,26 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode @@ -96,6 +99,26 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
96 SelectBean companyBean = new SelectBean(); 99 SelectBean companyBean = new SelectBean();
97 SelectBean yqBean = new SelectBean(); 100 SelectBean yqBean = new SelectBean();
98 101
  102 + // 类别
  103 + List<String> lebeiA = new ArrayList<>(); // 数据
  104 + List<String> lebeiB = new ArrayList<>(); // 数据
  105 + List<String> lb_one = new ArrayList<>(); // 选中
  106 + List<String> lb_two = new ArrayList<>(); // 选中
  107 +
  108 + // 公司
  109 + List<String> gsA = new ArrayList<>(); // 数据
  110 + List<String> gsB = new ArrayList<>(); // 数据
  111 + List<String> gs_one = new ArrayList<>(); // 选中
  112 + List<String> gs_two = new ArrayList<>(); // 选中
  113 +
  114 + // 公司
  115 + List<String> yqA = new ArrayList<>(); // 数据
  116 + List<String> yqB = new ArrayList<>(); // 数据
  117 + List<String> yqC = new ArrayList<>(); // 数据
  118 + List<String> yq_one = new ArrayList<>(); // 选中
  119 + List<String> yq_two = new ArrayList<>(); // 选中
  120 + List<String> yq_three = new ArrayList<>(); // 选中
  121 +
99 @Override 122 @Override
100 public int getLayoutId() { 123 public int getLayoutId() {
101 return R.layout.fragment_office; 124 return R.layout.fragment_office;
@@ -193,36 +216,71 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode @@ -193,36 +216,71 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
193 AddressBean bean = (AddressBean) o; 216 AddressBean bean = (AddressBean) o;
194 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 217 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
195 hangyeList.addAll(propListBeans); 218 hangyeList.addAll(propListBeans);
  219 + for (int i = 0; i < hangyeList.size(); i++) {
  220 + String propName = hangyeList.get(i).getPropName();
  221 + lebeiA.add(propName);
  222 + }
  223 + lb_one.add(hangyeList.get(0).getPropName());
196 } 224 }
197 if (api == 8 && intent == 2) { 225 if (api == 8 && intent == 2) {
198 AddressBean bean = (AddressBean) o; 226 AddressBean bean = (AddressBean) o;
199 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 227 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
200 zhinengList.addAll(propListBeans); 228 zhinengList.addAll(propListBeans);
  229 + for (int i = 0; i < zhinengList.size(); i++) {
  230 + String propName = zhinengList.get(i).getPropName();
  231 + lebeiB.add(propName);
  232 + }
  233 + lb_two.add(zhinengList.get(0).getPropName());
201 } 234 }
202 if (api == 8 && intent == 3) { 235 if (api == 8 && intent == 3) {
203 AddressBean bean = (AddressBean) o; 236 AddressBean bean = (AddressBean) o;
204 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 237 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
205 xingzhiList.addAll(propListBeans); 238 xingzhiList.addAll(propListBeans);
  239 + for (int i = 0; i < xingzhiList.size(); i++) {
  240 + String propName = xingzhiList.get(i).getPropName();
  241 + gsA.add(propName);
  242 + }
  243 + gs_one.add(xingzhiList.get(0).getPropName());
206 } 244 }
207 if (api == 8 && intent == 4) { 245 if (api == 8 && intent == 4) {
208 AddressBean bean = (AddressBean) o; 246 AddressBean bean = (AddressBean) o;
209 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 247 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
210 guiMoList.addAll(propListBeans); 248 guiMoList.addAll(propListBeans);
  249 + for (int i = 0; i < propListBeans.size(); i++) {
  250 + String propName = propListBeans.get(i).getPropName();
  251 + gsB.add(propName);
  252 + }
  253 + gs_two.add(propListBeans.get(0).getPropName());
211 } 254 }
212 if (api == 8 && intent == 5) { 255 if (api == 8 && intent == 5) {
213 AddressBean bean = (AddressBean) o; 256 AddressBean bean = (AddressBean) o;
214 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 257 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
215 xueLiList.addAll(propListBeans); 258 xueLiList.addAll(propListBeans);
  259 + for (int i = 0; i < propListBeans.size(); i++) {
  260 + String propName = propListBeans.get(i).getPropName();
  261 + yqA.add(propName);
  262 + }
  263 + yq_one.add(propListBeans.get(0).getPropName());
216 } 264 }
217 if (api == 8 && intent == 6) { 265 if (api == 8 && intent == 6) {
218 AddressBean bean = (AddressBean) o; 266 AddressBean bean = (AddressBean) o;
219 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 267 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
220 jingYanList.addAll(propListBeans); 268 jingYanList.addAll(propListBeans);
  269 + for (int i = 0; i < propListBeans.size(); i++) {
  270 + String propName = propListBeans.get(i).getPropName();
  271 + yqB.add(propName);
  272 + }
  273 + yq_two.add(propListBeans.get(0).getPropName());
221 } 274 }
222 if (api == 8 && intent == 7) { 275 if (api == 8 && intent == 7) {
223 AddressBean bean = (AddressBean) o; 276 AddressBean bean = (AddressBean) o;
224 List<AddressBean.PropListBean> propListBeans = bean.getPropList(); 277 List<AddressBean.PropListBean> propListBeans = bean.getPropList();
225 zhiYeList.addAll(propListBeans); 278 zhiYeList.addAll(propListBeans);
  279 + for (int i = 0; i < propListBeans.size(); i++) {
  280 + String propName = propListBeans.get(i).getPropName();
  281 + yqC.add(propName);
  282 + }
  283 + yq_three.add(propListBeans.get(0).getPropName());
226 } 284 }
227 } 285 }
228 286
@@ -261,57 +319,61 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode @@ -261,57 +319,61 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
261 public void onClick(View v) { 319 public void onClick(View v) {
262 switch (v.getId()) { 320 switch (v.getId()) {
263 case R.id.lin_category: 321 case R.id.lin_category:
264 - showCategoryPop(hangyeList, zhinengList); 322 + showDrop1(lebeiA, lebeiB);
265 break; 323 break;
266 case R.id.lin_city: 324 case R.id.lin_city:
267 showCityPop(getActivity(), provinceList, cityList); 325 showCityPop(getActivity(), provinceList, cityList);
268 break; 326 break;
269 - case R.id.lin_company:  
270 - showCompanyPop(xingzhiList, guiMoList); 327 + case R.id.lin_company: // 公司
  328 + showDrop2(gsA, gsB);
271 break; 329 break;
272 - case R.id.lin_require:  
273 - showRequirePop(xueLiList, jingYanList, zhiYeList); 330 + case R.id.lin_require: // 要求
  331 + showDrop3(yqA, yqB, yqC);
274 break; 332 break;
275 } 333 }
276 } 334 }
277 335
278 - //职位->类别弹窗  
279 - private void showCategoryPop(final List<AddressBean.PropListBean> propList, final List<AddressBean.PropListBean> zhinengList) { 336 + /* 类别 */
  337 + private void showDrop1(final List<String> lebeiA, final List<String> lebeiB) {
280 338
281 View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null); 339 View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
282 - GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);  
283 - GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);  
284 - final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);  
285 - final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure); 340 + final StackLabel stack1 = contentView.findViewById(R.id.stacklabel_a);
  341 + final StackLabel stack2 = contentView.findViewById(R.id.stacklabel_b);
286 342
287 - final GridViewAdapter adapter = new GridViewAdapter(propList, getActivity());  
288 - gridOne.setAdapter(adapter);  
289 - adapter.setClickPosition(lbBean.getSelectA()); 343 + View reset = contentView.findViewById(R.id.tv_reset);
  344 + View sure = contentView.findViewById(R.id.tv_sure);
290 345
291 - final GridViewAdapter adapter1 = new GridViewAdapter(zhinengList, getActivity());  
292 - gridTwo.setAdapter(adapter1);  
293 - adapter1.setClickPosition(lbBean.getSelectB()); 346 + stack1.setLabels(lebeiA);
  347 + stack2.setLabels(lebeiB);
294 348
295 - gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {  
296 - @Override  
297 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
298 - adapter.setClickPosition(position);  
299 - adapter.notifyDataSetChanged();  
300 - requestBody.setCompanyIndustry(propList.get(position).getPropId()); 349 + stack1.setSelectMode(true, lb_one);
  350 + stack2.setSelectMode(true, lb_two);
301 351
302 - lbBean.setSelectA(position); 352 + stack1.setOnLabelClickListener(new OnLabelClickListener() {
  353 + @Override
  354 + public void onClick(int index, View v, String s) {
  355 + if (lb_one.size() > 1) {
  356 + lb_one.remove(1);
  357 + }
  358 + lb_one.remove(0);
  359 + lb_one.add(lebeiA.get(index));
  360 + stack1.setSelectMode(true, lb_one);
  361 + lb_one.add(index + "");
  362 + Log.e("lb_one", lb_one.toString());
303 } 363 }
304 }); 364 });
305 365
306 -  
307 - gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() { 366 + stack2.setOnLabelClickListener(new OnLabelClickListener() {
308 @Override 367 @Override
309 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
310 - adapter1.setClickPosition(position);  
311 - adapter1.notifyDataSetChanged();  
312 - requestBody.setJobFunction(zhinengList.get(position).getPropId());  
313 -  
314 - lbBean.setSelectB(position); 368 + public void onClick(int index, View v, String s) {
  369 + if (lb_two.size() > 1) {
  370 + lb_two.remove(1);
  371 + }
  372 + lb_two.remove(0);
  373 + lb_two.add(lebeiB.get(index));
  374 + stack2.setSelectMode(true, lb_two);
  375 + lb_two.add(index + "");
  376 + Log.e("lb_two", lb_two.toString());
315 } 377 }
316 }); 378 });
317 379
@@ -326,277 +388,288 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode @@ -326,277 +388,288 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
326 reset.setOnClickListener(new View.OnClickListener() { 388 reset.setOnClickListener(new View.OnClickListener() {
327 @Override 389 @Override
328 public void onClick(View v) { 390 public void onClick(View v) {
329 -// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
330 -// reset.setTextColor(getResources().getColor(R.color.color_ffffff));  
331 -// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
332 -// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));  
333 391
334 - lbBean.setSelectA(0);  
335 - lbBean.setSelectB(0); 392 + if (lb_one.size() > 0) {
  393 + lb_one.remove(0);
  394 + }
336 395
337 - adapter.setClickPosition(0);  
338 - adapter.notifyDataSetChanged();  
339 - adapter1.setClickPosition(0);  
340 - adapter1.notifyDataSetChanged(); 396 + lb_one.add(lebeiA.get(0));
  397 + stack1.setSelectMode(true, lb_one);
341 398
342 - requestBody.setCompanyIndustry(null);  
343 - requestBody.setJobFunction(null); 399 + if (lb_two.size() > 0) {
  400 + lb_two.remove(0);
  401 + }
  402 + lb_two.add(lebeiB.get(0));
  403 + stack2.setSelectMode(true, lb_two);
344 } 404 }
345 }); 405 });
  406 +
346 sure.setOnClickListener(new View.OnClickListener() { 407 sure.setOnClickListener(new View.OnClickListener() {
347 @Override 408 @Override
348 public void onClick(View v) { 409 public void onClick(View v) {
349 - popupWindow.dismiss();  
350 - chageAlpha(1f);  
351 -// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
352 -// sure.setTextColor(getResources().getColor(R.color.color_ffffff));  
353 -// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
354 -// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));  
355 -  
356 - doRequset(requestBody);  
357 - }  
358 - });  
359 -  
360 - popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {  
361 - @Override  
362 - public void onDismiss() {  
363 - chageAlpha(1f);  
364 - }  
365 - });  
366 -  
367 - }  
368 -  
369 -  
370 - private void doRequset(JobSearchBody body) {  
371 - Log.e("zhangtao:request", body.toString());  
372 - Log.e("zhangtao", "=================================================");  
373 - MyServer myServer = HttpUtils.getInstance().getServer(NetConfig.zhaopinUrl);  
374 - myServer.JobSearch(body)  
375 - .subscribeOn(Schedulers.io())  
376 - .observeOn(AndroidSchedulers.mainThread())  
377 - .subscribe(new BaseObsever() {  
378 - @Override  
379 - public void onNext(Object value) {  
380 - super.onNext(value);  
381 - HotJobBean hotJobBean = (HotJobBean) value;  
382 - List<HotJobBean.JobListBean> jobListBeans = hotJobBean.getJobList();  
383 -  
384 - jobList.clear();  
385 - jobList.addAll(jobListBeans);  
386 - jobHuntWorkAdapter.notifyDataSetChanged();  
387 410
  411 + if (lb_one.size() > 0) {
  412 + if (!lb_one.get(0).equals("不限")) {
  413 + requestBody.setCompanyIndustry(hangyeList.get(Integer.valueOf(lb_one.get(1))).getPropId());
  414 + } else {
  415 + requestBody.setCompanyIndustry(null);
388 } 416 }
  417 + } else {
  418 + requestBody.setCompanyIndustry(null);
  419 + }
389 420
390 - @Override  
391 - public void onError(Throwable e) {  
392 - super.onError(e); 421 + if (lb_two.size() > 0) {
  422 + if (!lb_two.get(0).equals("不限")) {
  423 + requestBody.setJobFunction(zhinengList.get(Integer.valueOf(lb_two.get(1))).getPropId());
  424 + } else {
  425 + requestBody.setJobFunction(null);
393 } 426 }
  427 + } else {
  428 + requestBody.setJobFunction(null);
  429 + }
394 430
395 - @Override  
396 - public void onComplete() {  
397 - super.onComplete();  
398 - }  
399 - }); 431 + doRequset(requestBody);
  432 + popupWindow.dismiss();
  433 + }
  434 + });
400 435
401 } 436 }
402 437
403 - //职位->要求弹窗  
404 - private void showRequirePop(final List<AddressBean.PropListBean> xueLiList, final List<AddressBean.PropListBean> jingYanList, final List<AddressBean.PropListBean> zhiYeList) { 438 + /* 公司 */
  439 + private void showDrop2(final List<String> gsA, final List<String> gsB) {
405 440
406 - View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_require, null);  
407 - GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);  
408 - GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);  
409 - GridView gridThree = (GridView) contentView.findViewById(R.id.grid_three);  
410 - final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);  
411 - final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset); 441 + View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
  442 + final StackLabel stack1 = contentView.findViewById(R.id.stacklabel_a);
  443 + final StackLabel stack2 = contentView.findViewById(R.id.stacklabel_b);
  444 + View reset = contentView.findViewById(R.id.tv_reset);
  445 + View sure = contentView.findViewById(R.id.tv_sure);
412 446
413 - final GridViewAdapter adapter = new GridViewAdapter(xueLiList, getActivity());  
414 - gridOne.setAdapter(adapter);  
415 - final GridViewAdapter adapter1 = new GridViewAdapter(jingYanList, getActivity());  
416 - gridTwo.setAdapter(adapter1);  
417 - final GridViewAdapter adapter2 = new GridViewAdapter(zhiYeList, getActivity());  
418 - gridThree.setAdapter(adapter2); 447 + TextView title_one = contentView.findViewById(R.id.title_one);
  448 + TextView title_two = contentView.findViewById(R.id.title_two);
  449 + title_one.setText("公司性质");
  450 + title_two.setText("团队规模");
419 451
420 - adapter.setClickPosition(yqBean.getSelectA());  
421 - adapter1.setClickPosition(yqBean.getSelectB());  
422 - adapter2.setClickPosition(yqBean.getSelectC()); 452 + stack1.setLabels(gsA);
  453 + stack2.setLabels(gsB);
423 454
424 - gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {  
425 - @Override  
426 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
427 - adapter.setClickPosition(position);  
428 - adapter.notifyDataSetChanged();  
429 - requestBody.setEducation(xueLiList.get(position).getPropId());  
430 - yqBean.setSelectA(position);  
431 - }  
432 - }); 455 + stack1.setSelectMode(true, gs_one);
  456 + stack2.setSelectMode(true, gs_two);
433 457
434 - gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() { 458 + stack1.setOnLabelClickListener(new OnLabelClickListener() {
435 @Override 459 @Override
436 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
437 - adapter1.setClickPosition(position);  
438 - adapter1.notifyDataSetChanged();  
439 - requestBody.setExprience(jingYanList.get(position).getPropId());  
440 - yqBean.setSelectB(position); 460 + public void onClick(int index, View v, String s) {
  461 + if (gs_one.size() > 1) {
  462 + gs_one.remove(1);
  463 + }
  464 + gs_one.remove(0);
  465 + gs_one.add(gsA.get(index));
  466 + stack1.setSelectMode(true, gs_one);
  467 + gs_one.add(index + "");
  468 + Log.e("gs_one", gs_one.toString());
441 } 469 }
442 }); 470 });
443 471
444 - gridThree.setOnItemClickListener(new AdapterView.OnItemClickListener() { 472 + stack2.setOnLabelClickListener(new OnLabelClickListener() {
445 @Override 473 @Override
446 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
447 - adapter2.setClickPosition(position);  
448 - adapter2.notifyDataSetChanged();  
449 - requestBody.setJobNature(zhiYeList.get(position).getPropId());  
450 - yqBean.setSelectC(position); 474 + public void onClick(int index, View v, String s) {
  475 + if (gs_two.size() > 1) {
  476 + gs_two.remove(1);
  477 + }
  478 + gs_two.remove(0);
  479 + gs_two.add(gsB.get(index));
  480 + stack2.setSelectMode(true, gs_two);
  481 + gs_two.add(index + "");
  482 + Log.e("gs_two", gs_two.toString());
451 } 483 }
452 }); 484 });
453 485
454 - final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom()); 486 + final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCompany.getBottom());
455 popupWindow.setOutsideTouchable(true); 487 popupWindow.setOutsideTouchable(true);
456 popupWindow.setTouchable(true); 488 popupWindow.setTouchable(true);
457 popupWindow.setFocusable(true); 489 popupWindow.setFocusable(true);
458 popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm)); 490 popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
459 popupWindow.setAnimationStyle(R.style.AnimTopMiddle); 491 popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
460 - popupWindow.showAsDropDown(linRequire); 492 + popupWindow.showAsDropDown(linCompany);
461 493
462 reset.setOnClickListener(new View.OnClickListener() { 494 reset.setOnClickListener(new View.OnClickListener() {
463 @Override 495 @Override
464 public void onClick(View v) { 496 public void onClick(View v) {
465 -// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
466 -// reset.setTextColor(getResources().getColor(R.color.color_ffffff));  
467 -// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
468 -// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));  
469 -  
470 - yqBean.setSelectA(0);  
471 - yqBean.setSelectB(0);  
472 - yqBean.setSelectC(0);  
473 -  
474 - adapter.setClickPosition(0);  
475 - adapter.notifyDataSetChanged();  
476 - adapter1.setClickPosition(0);  
477 - adapter1.notifyDataSetChanged();  
478 - adapter2.setClickPosition(0);  
479 - adapter2.notifyDataSetChanged();  
480 -  
481 - requestBody.setEducation(null);  
482 - requestBody.setExprience(null);  
483 - requestBody.setJobNature(null); 497 +
  498 + if (gs_one.size() > 0) {
  499 + gs_one.remove(0);
  500 + }
  501 +
  502 + gs_one.add(gsA.get(0));
  503 + stack1.setSelectMode(true, gs_one);
  504 +
  505 + if (gs_two.size() > 0) {
  506 + gs_two.remove(0);
  507 + }
  508 + gs_two.add(gsB.get(0));
  509 + stack2.setSelectMode(true, gs_two);
484 } 510 }
485 }); 511 });
  512 +
486 sure.setOnClickListener(new View.OnClickListener() { 513 sure.setOnClickListener(new View.OnClickListener() {
487 @Override 514 @Override
488 public void onClick(View v) { 515 public void onClick(View v) {
489 - popupWindow.dismiss();  
490 - chageAlpha(1f);  
491 -// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
492 -// sure.setTextColor(getResources().getColor(R.color.color_ffffff));  
493 -// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
494 -// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f)); 516 +
  517 + if (gs_one.size() > 0) {
  518 + if (!gs_one.get(0).equals("不限")) {
  519 + requestBody.setCompanyNature(xingzhiList.get(Integer.valueOf(gs_one.get(1))).getPropId());
  520 + } else {
  521 + requestBody.setCompanyNature(null);
  522 + }
  523 + } else {
  524 + requestBody.setCompanyNature(null);
  525 + }
  526 +
  527 + if (gs_two.size() > 0) {
  528 + if (!gs_two.get(0).equals("不限")) {
  529 + requestBody.setCompanySize(guiMoList.get(Integer.valueOf(gs_two.get(1))).getPropId());
  530 + } else {
  531 + requestBody.setCompanySize(null);
  532 + }
  533 + } else {
  534 + requestBody.setCompanySize(null);
  535 + }
495 536
496 doRequset(requestBody); 537 doRequset(requestBody);
  538 + popupWindow.dismiss();
497 } 539 }
498 }); 540 });
499 541
500 - popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {  
501 - @Override  
502 - public void onDismiss() {  
503 - chageAlpha(1f);  
504 - }  
505 - });  
506 } 542 }
507 543
508 - //职位->公司弹窗  
509 - private void showCompanyPop(final List<AddressBean.PropListBean> xingzhiList, final List<AddressBean.PropListBean> guiMoList) { 544 + /* 要求 */
  545 + private void showDrop3(final List<String> yqA, final List<String> yqB, final List<String> yqC) {
  546 + View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_require, null);
  547 + final StackLabel stack1 = contentView.findViewById(R.id.stack_req_a);
  548 + final StackLabel stack2 = contentView.findViewById(R.id.stack_req_b);
  549 + final StackLabel stack3 = contentView.findViewById(R.id.stack_req_c);
510 550
511 - View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);  
512 - TextView textOne = (TextView) contentView.findViewById(R.id.title_one);  
513 - TextView texttwo = (TextView) contentView.findViewById(R.id.title_two);  
514 - GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);  
515 - GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);  
516 - final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);  
517 final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure); 551 final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
  552 + final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
518 553
519 - textOne.setText("公司性质");  
520 - texttwo.setText("团队规模");  
521 -  
522 - final GridViewAdapter adapter = new GridViewAdapter(xingzhiList, getActivity());  
523 - gridOne.setAdapter(adapter);  
524 - final GridViewAdapter adapter1 = new GridViewAdapter(guiMoList, getActivity());  
525 - gridTwo.setAdapter(adapter1); 554 + stack1.setLabels(yqA);
  555 + stack2.setLabels(yqB);
  556 + stack3.setLabels(yqC);
526 557
527 - adapter.setClickPosition(companyBean.getSelectA());  
528 - adapter1.setClickPosition(companyBean.getSelectB()); 558 + stack1.setSelectMode(true, yq_one);
  559 + stack2.setSelectMode(true, yq_two);
  560 + stack3.setSelectMode(true, yq_three);
529 561
530 - gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() { 562 + stack1.setOnLabelClickListener(new OnLabelClickListener() {
531 @Override 563 @Override
532 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
533 - adapter.setClickPosition(position);  
534 - adapter.notifyDataSetChanged();  
535 - requestBody.setCompanyNature(xingzhiList.get(position).getPropId());  
536 -  
537 - companyBean.setSelectA(position); 564 + public void onClick(int index, View v, String s) {
  565 + if (yq_one.size() > 1) {
  566 + yq_one.remove(1);
  567 + }
  568 + yq_one.remove(0);
  569 + yq_one.add(yqA.get(index));
  570 + stack1.setSelectMode(true, yq_one);
  571 + yq_one.add(index + "");
  572 + Log.e("yq_one", yq_one.toString());
538 } 573 }
539 }); 574 });
540 575
541 - gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() { 576 + stack2.setOnLabelClickListener(new OnLabelClickListener() {
542 @Override 577 @Override
543 - public void onItemClick(AdapterView<?> parent, View view, int position, long id) {  
544 - adapter1.setClickPosition(position);  
545 - adapter1.notifyDataSetChanged();  
546 - requestBody.setCompanySize(guiMoList.get(position).getPropId()); 578 + public void onClick(int index, View v, String s) {
  579 + if (yq_two.size() > 1) {
  580 + yq_two.remove(1);
  581 + }
  582 + yq_two.remove(0);
  583 + yq_two.add(yqB.get(index));
  584 + stack2.setSelectMode(true, yq_two);
  585 + yq_two.add(index + "");
  586 + Log.e("yq_two", yq_two.toString());
  587 + }
  588 + });
547 589
548 - companyBean.setSelectB(position); 590 + stack3.setOnLabelClickListener(new OnLabelClickListener() {
  591 + @Override
  592 + public void onClick(int index, View v, String s) {
  593 + if (yq_three.size() > 1) {
  594 + yq_three.remove(1);
  595 + }
  596 + yq_three.remove(0);
  597 + yq_three.add(yqC.get(index));
  598 + stack3.setSelectMode(true, yq_three);
  599 + yq_three.add(index + "");
  600 + Log.e("yq_three", yq_three.toString());
549 } 601 }
550 }); 602 });
551 603
552 - final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCompany.getBottom()); 604 + final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom());
553 popupWindow.setOutsideTouchable(true); 605 popupWindow.setOutsideTouchable(true);
554 popupWindow.setTouchable(true); 606 popupWindow.setTouchable(true);
555 popupWindow.setFocusable(true); 607 popupWindow.setFocusable(true);
556 popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm)); 608 popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
557 popupWindow.setAnimationStyle(R.style.AnimTopMiddle); 609 popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
558 - popupWindow.showAsDropDown(linCompany); 610 + popupWindow.showAsDropDown(linRequire);
559 611
560 reset.setOnClickListener(new View.OnClickListener() { 612 reset.setOnClickListener(new View.OnClickListener() {
561 @Override 613 @Override
562 public void onClick(View v) { 614 public void onClick(View v) {
563 -// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
564 -// reset.setTextColor(getResources().getColor(R.color.color_ffffff));  
565 -// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
566 -// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));  
567 -  
568 - companyBean.setSelectA(0);  
569 - companyBean.setSelectB(0); 615 + if (yq_one.size() > 0) {
  616 + yq_one.remove(0);
  617 + }
  618 + yq_one.add(gsA.get(0));
  619 + stack1.setSelectMode(true, yq_one);
570 620
571 - adapter.setClickPosition(0);  
572 - adapter.notifyDataSetChanged();  
573 - adapter1.setClickPosition(0);  
574 - adapter1.notifyDataSetChanged(); 621 + if (yq_two.size() > 0) {
  622 + yq_two.remove(0);
  623 + }
  624 + yq_two.add(gsB.get(0));
  625 + stack2.setSelectMode(true, yq_two);
575 626
576 - requestBody.setCompanyNature(null);  
577 - requestBody.setCompanySize(null); 627 + if (yq_three.size() > 0) {
  628 + yq_three.remove(0);
  629 + }
  630 + yq_three.add(gsB.get(0));
  631 + stack3.setSelectMode(true, yq_three);
578 } 632 }
579 }); 633 });
  634 +
580 sure.setOnClickListener(new View.OnClickListener() { 635 sure.setOnClickListener(new View.OnClickListener() {
581 @Override 636 @Override
582 public void onClick(View v) { 637 public void onClick(View v) {
583 - popupWindow.dismiss();  
584 - chageAlpha(1f);  
585 -// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));  
586 -// sure.setTextColor(getResources().getColor(R.color.color_ffffff));  
587 -// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));  
588 -// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f)); 638 + if (yq_one.size() > 0) {
  639 + if (!yq_one.get(0).equals("不限")) {
  640 + requestBody.setEducation(xueLiList.get(Integer.valueOf(yq_one.get(1))).getPropId());
  641 + } else {
  642 + requestBody.setEducation(null);
  643 + }
  644 + } else {
  645 + requestBody.setEducation(null);
  646 + }
  647 +
  648 + if (yq_two.size() > 0) {
  649 + if (!yq_two.get(0).equals("不限")) {
  650 + requestBody.setExprience(jingYanList.get(Integer.valueOf(yq_two.get(1))).getPropId());
  651 + } else {
  652 + requestBody.setExprience(null);
  653 + }
  654 + } else {
  655 + requestBody.setExprience(null);
  656 + }
  657 +
  658 + if (yq_three.size() > 0) {
  659 + if (!yq_three.get(0).equals("不限")) {
  660 + requestBody.setJobNature(zhiYeList.get(Integer.valueOf(yq_three.get(1))).getPropId());
  661 + } else {
  662 + requestBody.setJobNature(null);
  663 + }
  664 + } else {
  665 + requestBody.setJobNature(null);
  666 + }
589 667
590 doRequset(requestBody); 668 doRequset(requestBody);
  669 + popupWindow.dismiss();
591 } 670 }
592 }); 671 });
593 672
594 - popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {  
595 - @Override  
596 - public void onDismiss() {  
597 - chageAlpha(1f);  
598 - }  
599 - });  
600 } 673 }
601 674
602 //职位->城市弹窗 675 //职位->城市弹窗
@@ -624,20 +697,24 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode @@ -624,20 +697,24 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
624 listOne.setOnItemClickListener(new AdapterView.OnItemClickListener() { 697 listOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
625 @Override 698 @Override
626 public void onItemClick(AdapterView<?> parent, View view, int position, long id) { 699 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
627 - requestBody.setProvinceId(provinceList.get(position).getProvOid()); 700 +
628 701
629 if (position == 0) { 702 if (position == 0) {
630 proviceId = provinceList.get(1).getProvOid(); 703 proviceId = provinceList.get(1).getProvOid();
631 listTwo.setVisibility(View.INVISIBLE); 704 listTwo.setVisibility(View.INVISIBLE);
632 cityBean.setSelectB(0); 705 cityBean.setSelectB(0);
  706 + requestBody.setProvinceId(null); // 不限
  707 + requestBody.setCityIdId(null); // 不限
633 } else if (cityBean.getSelectA() == position && cityBean.getSelectA() != 0) { 708 } else if (cityBean.getSelectA() == position && cityBean.getSelectA() != 0) {
634 listTwo.setVisibility(View.VISIBLE); 709 listTwo.setVisibility(View.VISIBLE);
635 popCityListAdapter.change(cityBean.getSelectB()); 710 popCityListAdapter.change(cityBean.getSelectB());
636 cityBean.setSelectB(cityBean.getSelectB()); 711 cityBean.setSelectB(cityBean.getSelectB());
  712 + requestBody.setProvinceId(provinceList.get(position).getProvOid());
637 } else { 713 } else {
638 proviceId = provinceList.get(position).getProvOid(); 714 proviceId = provinceList.get(position).getProvOid();
639 listTwo.setVisibility(View.VISIBLE); 715 listTwo.setVisibility(View.VISIBLE);
640 popCityListAdapter.change(0); 716 popCityListAdapter.change(0);
  717 + requestBody.setProvinceId(provinceList.get(position).getProvOid());
641 } 718 }
642 719
643 // model.getModel(activity, 7, 2, proviceId, String.valueOf(true)); 720 // model.getModel(activity, 7, 2, proviceId, String.valueOf(true));
@@ -652,11 +729,13 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode @@ -652,11 +729,13 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
652 listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() { 729 listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
653 @Override 730 @Override
654 public void onItemClick(AdapterView<?> parent, View view, int position, long id) { 731 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
655 - requestBody.setCityIdId(cityList.get(position).getCityId()); 732 + if(position == 0){
  733 + requestBody.setCityIdId(null);
  734 + }else {
  735 + requestBody.setCityIdId(cityList.get(position).getCityId());
  736 + }
656 popCityListAdapter.change(position); // 改 737 popCityListAdapter.change(position); // 改
657 -  
658 cityBean.setSelectB(position); 738 cityBean.setSelectB(position);
659 -  
660 } 739 }
661 }); 740 });
662 741
@@ -692,20 +771,425 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode @@ -692,20 +771,425 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
692 @Override 771 @Override
693 public void onClick(View v) { 772 public void onClick(View v) {
694 popupWindow.dismiss(); 773 popupWindow.dismiss();
695 - chageAlpha(1f);  
696 - 774 + Log.e("requestBody",requestBody.toString());
697 doRequset(requestBody); 775 doRequset(requestBody);
698 } 776 }
699 }); 777 });
700 778
701 - popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {  
702 - @Override  
703 - public void onDismiss() {  
704 - chageAlpha(1f);  
705 - }  
706 - });  
707 } 779 }
708 780
  781 + // 数据返回
  782 + private void doRequset(JobSearchBody body) {
  783 + Log.e("zhangtao:request", body.toString());
  784 + Log.e("zhangtao", "=================================================");
  785 + MyServer myServer = HttpUtils.getInstance().getServer(NetConfig.zhaopinUrl);
  786 + myServer.JobSearch(body)
  787 + .subscribeOn(Schedulers.io())
  788 + .observeOn(AndroidSchedulers.mainThread())
  789 + .subscribe(new BaseObsever() {
  790 + @Override
  791 + public void onNext(Object value) {
  792 + super.onNext(value);
  793 + HotJobBean hotJobBean = (HotJobBean) value;
  794 + List<HotJobBean.JobListBean> jobListBeans = hotJobBean.getJobList();
  795 +
  796 + jobList.clear();
  797 + jobList.addAll(jobListBeans);
  798 + jobHuntWorkAdapter.notifyDataSetChanged();
  799 +
  800 + }
  801 +
  802 + @Override
  803 + public void onError(Throwable e) {
  804 + super.onError(e);
  805 + }
  806 +
  807 + @Override
  808 + public void onComplete() {
  809 + super.onComplete();
  810 + }
  811 + });
  812 +
  813 + }
  814 +
  815 + // private void showRequirePop(final List<AddressBean.PropListBean> xueLiList, final List<AddressBean.PropListBean> jingYanList, final List<AddressBean.PropListBean> zhiYeList) {
  816 +//
  817 +// View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_require, null);
  818 +// GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
  819 +// GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
  820 +// GridView gridThree = (GridView) contentView.findViewById(R.id.grid_three);
  821 +// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
  822 +// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
  823 +//
  824 +// final GridViewAdapter adapter = new GridViewAdapter(xueLiList, getActivity());
  825 +// gridOne.setAdapter(adapter);
  826 +// final GridViewAdapter adapter1 = new GridViewAdapter(jingYanList, getActivity());
  827 +// gridTwo.setAdapter(adapter1);
  828 +// final GridViewAdapter adapter2 = new GridViewAdapter(zhiYeList, getActivity());
  829 +// gridThree.setAdapter(adapter2);
  830 +//
  831 +// adapter.setClickPosition(yqBean.getSelectA());
  832 +// adapter1.setClickPosition(yqBean.getSelectB());
  833 +// adapter2.setClickPosition(yqBean.getSelectC());
  834 +//
  835 +// gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  836 +// @Override
  837 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  838 +// adapter.setClickPosition(position);
  839 +// adapter.notifyDataSetChanged();
  840 +// requestBody.setEducation(xueLiList.get(position).getPropId());
  841 +// yqBean.setSelectA(position);
  842 +// }
  843 +// });
  844 +//
  845 +// gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  846 +// @Override
  847 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  848 +// adapter1.setClickPosition(position);
  849 +// adapter1.notifyDataSetChanged();
  850 +// requestBody.setExprience(jingYanList.get(position).getPropId());
  851 +// yqBean.setSelectB(position);
  852 +// }
  853 +// });
  854 +//
  855 +// gridThree.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  856 +// @Override
  857 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  858 +// adapter2.setClickPosition(position);
  859 +// adapter2.notifyDataSetChanged();
  860 +// requestBody.setJobNature(zhiYeList.get(position).getPropId());
  861 +// yqBean.setSelectC(position);
  862 +// }
  863 +// });
  864 +//
  865 +// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom());
  866 +// popupWindow.setOutsideTouchable(true);
  867 +// popupWindow.setTouchable(true);
  868 +// popupWindow.setFocusable(true);
  869 +// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
  870 +// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
  871 +// popupWindow.showAsDropDown(linRequire);
  872 +//
  873 +// reset.setOnClickListener(new View.OnClickListener() {
  874 +// @Override
  875 +// public void onClick(View v) {
  876 +// yqBean.setSelectA(0);
  877 +// yqBean.setSelectB(0);
  878 +// yqBean.setSelectC(0);
  879 +//
  880 +// adapter.setClickPosition(0);
  881 +// adapter.notifyDataSetChanged();
  882 +// adapter1.setClickPosition(0);
  883 +// adapter1.notifyDataSetChanged();
  884 +// adapter2.setClickPosition(0);
  885 +// adapter2.notifyDataSetChanged();
  886 +//
  887 +// requestBody.setEducation(null);
  888 +// requestBody.setExprience(null);
  889 +// requestBody.setJobNature(null);
  890 +// }
  891 +// });
  892 +// sure.setOnClickListener(new View.OnClickListener() {
  893 +// @Override
  894 +// public void onClick(View v) {
  895 +// popupWindow.dismiss();
  896 +// chageAlpha(1f);
  897 +// doRequset(requestBody);
  898 +// }
  899 +// });
  900 +//
  901 +// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
  902 +// @Override
  903 +// public void onDismiss() {
  904 +// chageAlpha(1f);
  905 +// }
  906 +// });
  907 +// }
  908 +
  909 +
  910 + //职位->公司弹窗
  911 +// private void showCompanyPop(final List<AddressBean.PropListBean> xingzhiList, final List<AddressBean.PropListBean> guiMoList) {
  912 +//
  913 +// View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
  914 +// TextView textOne = (TextView) contentView.findViewById(R.id.title_one);
  915 +// TextView texttwo = (TextView) contentView.findViewById(R.id.title_two);
  916 +// GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
  917 +// GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
  918 +// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
  919 +// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
  920 +//
  921 +// textOne.setText("公司性质");
  922 +// texttwo.setText("团队规模");
  923 +//
  924 +// final GridViewAdapter adapter = new GridViewAdapter(xingzhiList, getActivity());
  925 +// gridOne.setAdapter(adapter);
  926 +// final GridViewAdapter adapter1 = new GridViewAdapter(guiMoList, getActivity());
  927 +// gridTwo.setAdapter(adapter1);
  928 +//
  929 +// adapter.setClickPosition(companyBean.getSelectA());
  930 +// adapter1.setClickPosition(companyBean.getSelectB());
  931 +//
  932 +// gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  933 +// @Override
  934 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  935 +// adapter.setClickPosition(position);
  936 +// adapter.notifyDataSetChanged();
  937 +// requestBody.setCompanyNature(xingzhiList.get(position).getPropId());
  938 +//
  939 +// companyBean.setSelectA(position);
  940 +// }
  941 +// });
  942 +//
  943 +// gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  944 +// @Override
  945 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  946 +// adapter1.setClickPosition(position);
  947 +// adapter1.notifyDataSetChanged();
  948 +// requestBody.setCompanySize(guiMoList.get(position).getPropId());
  949 +//
  950 +// companyBean.setSelectB(position);
  951 +// }
  952 +// });
  953 +//
  954 +// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCompany.getBottom());
  955 +// popupWindow.setOutsideTouchable(true);
  956 +// popupWindow.setTouchable(true);
  957 +// popupWindow.setFocusable(true);
  958 +// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
  959 +// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
  960 +// popupWindow.showAsDropDown(linCompany);
  961 +//
  962 +// reset.setOnClickListener(new View.OnClickListener() {
  963 +// @Override
  964 +// public void onClick(View v) {
  965 +//// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
  966 +//// reset.setTextColor(getResources().getColor(R.color.color_ffffff));
  967 +//// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
  968 +//// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
  969 +//
  970 +// companyBean.setSelectA(0);
  971 +// companyBean.setSelectB(0);
  972 +//
  973 +// adapter.setClickPosition(0);
  974 +// adapter.notifyDataSetChanged();
  975 +// adapter1.setClickPosition(0);
  976 +// adapter1.notifyDataSetChanged();
  977 +//
  978 +// requestBody.setCompanyNature(null);
  979 +// requestBody.setCompanySize(null);
  980 +// }
  981 +// });
  982 +// sure.setOnClickListener(new View.OnClickListener() {
  983 +// @Override
  984 +// public void onClick(View v) {
  985 +// popupWindow.dismiss();
  986 +// chageAlpha(1f);
  987 +//// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
  988 +//// sure.setTextColor(getResources().getColor(R.color.color_ffffff));
  989 +//// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
  990 +//// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
  991 +//
  992 +// doRequset(requestBody);
  993 +// }
  994 +// });
  995 +//
  996 +// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
  997 +// @Override
  998 +// public void onDismiss() {
  999 +// chageAlpha(1f);
  1000 +// }
  1001 +// });
  1002 +// }
  1003 +
  1004 +
  1005 + //职位->类别弹窗
  1006 +// private void showCategoryPop(final List<AddressBean.PropListBean> propList, final List<AddressBean.PropListBean> zhinengList) {
  1007 +//
  1008 +// View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
  1009 +// GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
  1010 +// GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
  1011 +// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
  1012 +// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
  1013 +//
  1014 +// final GridViewAdapter adapter = new GridViewAdapter(propList, getActivity());
  1015 +// gridOne.setAdapter(adapter);
  1016 +// adapter.setClickPosition(lbBean.getSelectA());
  1017 +//
  1018 +// final GridViewAdapter adapter1 = new GridViewAdapter(zhinengList, getActivity());
  1019 +// gridTwo.setAdapter(adapter1);
  1020 +// adapter1.setClickPosition(lbBean.getSelectB());
  1021 +//
  1022 +// gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  1023 +// @Override
  1024 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  1025 +// adapter.setClickPosition(position);
  1026 +// adapter.notifyDataSetChanged();
  1027 +// requestBody.setCompanyIndustry(propList.get(position).getPropId());
  1028 +//
  1029 +// lbBean.setSelectA(position);
  1030 +// }
  1031 +// });
  1032 +//
  1033 +//
  1034 +// gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  1035 +// @Override
  1036 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  1037 +// adapter1.setClickPosition(position);
  1038 +// adapter1.notifyDataSetChanged();
  1039 +// requestBody.setJobFunction(zhinengList.get(position).getPropId());
  1040 +//
  1041 +// lbBean.setSelectB(position);
  1042 +// }
  1043 +// });
  1044 +//
  1045 +// final PopupWindow popupWindow = new PopupWindow(contentView, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCategory.getBottom());
  1046 +// popupWindow.setOutsideTouchable(true);
  1047 +// popupWindow.setTouchable(true);
  1048 +// popupWindow.setFocusable(true);
  1049 +// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
  1050 +// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
  1051 +// popupWindow.showAsDropDown(linCategory);
  1052 +//
  1053 +// reset.setOnClickListener(new View.OnClickListener() {
  1054 +// @Override
  1055 +// public void onClick(View v) {
  1056 +//// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
  1057 +//// reset.setTextColor(getResources().getColor(R.color.color_ffffff));
  1058 +//// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
  1059 +//// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
  1060 +//
  1061 +// lbBean.setSelectA(0);
  1062 +// lbBean.setSelectB(0);
  1063 +//
  1064 +// adapter.setClickPosition(0);
  1065 +// adapter.notifyDataSetChanged();
  1066 +// adapter1.setClickPosition(0);
  1067 +// adapter1.notifyDataSetChanged();
  1068 +//
  1069 +// requestBody.setCompanyIndustry(null);
  1070 +// requestBody.setJobFunction(null);
  1071 +// }
  1072 +// });
  1073 +// sure.setOnClickListener(new View.OnClickListener() {
  1074 +// @Override
  1075 +// public void onClick(View v) {
  1076 +// popupWindow.dismiss();
  1077 +// chageAlpha(1f);
  1078 +//// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
  1079 +//// sure.setTextColor(getResources().getColor(R.color.color_ffffff));
  1080 +//// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
  1081 +//// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
  1082 +//
  1083 +// doRequset(requestBody);
  1084 +// }
  1085 +// });
  1086 +//
  1087 +// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
  1088 +// @Override
  1089 +// public void onDismiss() {
  1090 +// chageAlpha(1f);
  1091 +// }
  1092 +// });
  1093 +//
  1094 +// }
  1095 +
  1096 +
  1097 +
  1098 + //职位->要求弹窗
  1099 +// private void showRequirePop(final List<AddressBean.PropListBean> xueLiList, final List<AddressBean.PropListBean> jingYanList, final List<AddressBean.PropListBean> zhiYeList) {
  1100 +//
  1101 +// View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_require, null);
  1102 +// GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
  1103 +// GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
  1104 +// GridView gridThree = (GridView) contentView.findViewById(R.id.grid_three);
  1105 +// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
  1106 +// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
  1107 +//
  1108 +// final GridViewAdapter adapter = new GridViewAdapter(xueLiList, getActivity());
  1109 +// gridOne.setAdapter(adapter);
  1110 +// final GridViewAdapter adapter1 = new GridViewAdapter(jingYanList, getActivity());
  1111 +// gridTwo.setAdapter(adapter1);
  1112 +// final GridViewAdapter adapter2 = new GridViewAdapter(zhiYeList, getActivity());
  1113 +// gridThree.setAdapter(adapter2);
  1114 +//
  1115 +// adapter.setClickPosition(yqBean.getSelectA());
  1116 +// adapter1.setClickPosition(yqBean.getSelectB());
  1117 +// adapter2.setClickPosition(yqBean.getSelectC());
  1118 +//
  1119 +// gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  1120 +// @Override
  1121 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  1122 +// adapter.setClickPosition(position);
  1123 +// adapter.notifyDataSetChanged();
  1124 +// requestBody.setEducation(xueLiList.get(position).getPropId());
  1125 +// yqBean.setSelectA(position);
  1126 +// }
  1127 +// });
  1128 +//
  1129 +// gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  1130 +// @Override
  1131 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  1132 +// adapter1.setClickPosition(position);
  1133 +// adapter1.notifyDataSetChanged();
  1134 +// requestBody.setExprience(jingYanList.get(position).getPropId());
  1135 +// yqBean.setSelectB(position);
  1136 +// }
  1137 +// });
  1138 +//
  1139 +// gridThree.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  1140 +// @Override
  1141 +// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  1142 +// adapter2.setClickPosition(position);
  1143 +// adapter2.notifyDataSetChanged();
  1144 +// requestBody.setJobNature(zhiYeList.get(position).getPropId());
  1145 +// yqBean.setSelectC(position);
  1146 +// }
  1147 +// });
  1148 +//
  1149 +// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom());
  1150 +// popupWindow.setOutsideTouchable(true);
  1151 +// popupWindow.setTouchable(true);
  1152 +// popupWindow.setFocusable(true);
  1153 +// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
  1154 +// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
  1155 +// popupWindow.showAsDropDown(linRequire);
  1156 +//
  1157 +// reset.setOnClickListener(new View.OnClickListener() {
  1158 +// @Override
  1159 +// public void onClick(View v) {
  1160 +// yqBean.setSelectA(0);
  1161 +// yqBean.setSelectB(0);
  1162 +// yqBean.setSelectC(0);
  1163 +//
  1164 +// adapter.setClickPosition(0);
  1165 +// adapter.notifyDataSetChanged();
  1166 +// adapter1.setClickPosition(0);
  1167 +// adapter1.notifyDataSetChanged();
  1168 +// adapter2.setClickPosition(0);
  1169 +// adapter2.notifyDataSetChanged();
  1170 +//
  1171 +// requestBody.setEducation(null);
  1172 +// requestBody.setExprience(null);
  1173 +// requestBody.setJobNature(null);
  1174 +// }
  1175 +// });
  1176 +// sure.setOnClickListener(new View.OnClickListener() {
  1177 +// @Override
  1178 +// public void onClick(View v) {
  1179 +// popupWindow.dismiss();
  1180 +// chageAlpha(1f);
  1181 +// doRequset(requestBody);
  1182 +// }
  1183 +// });
  1184 +//
  1185 +// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
  1186 +// @Override
  1187 +// public void onDismiss() {
  1188 +// chageAlpha(1f);
  1189 +// }
  1190 +// });
  1191 +// }
  1192 +
709 private void chageAlpha(float color) { 1193 private void chageAlpha(float color) {
710 WindowManager.LayoutParams lp = getActivity().getWindow().getAttributes(); 1194 WindowManager.LayoutParams lp = getActivity().getWindow().getAttributes();
711 lp.alpha = color; 1195 lp.alpha = color;
  1 +package com.hh.xuetubao.stacklabel;
  2 +
  3 +import android.view.View;
  4 +
  5 +public interface OnLabelClickListener {
  6 + void onClick(int index, View v, String s);
  7 +}
  1 +package com.hh.xuetubao.stacklabel;
  2 +
  3 +import android.content.Context;
  4 +import android.content.res.Resources;
  5 +import android.content.res.TypedArray;
  6 +import android.graphics.Color;
  7 +import android.util.AttributeSet;
  8 +import android.util.Log;
  9 +import android.util.TypedValue;
  10 +import android.view.LayoutInflater;
  11 +import android.view.View;
  12 +import android.view.ViewGroup;
  13 +import android.widget.ImageView;
  14 +import android.widget.LinearLayout;
  15 +import android.widget.TextView;
  16 +
  17 +import com.hh.xuetubao.R;
  18 +
  19 +import java.util.ArrayList;
  20 +import java.util.List;
  21 +
  22 +public class StackLabel extends ViewGroup {
  23 +
  24 + private int textColor = 0;
  25 + private int textSize = 0;
  26 + private int paddingVertical = 0;
  27 + private int paddingHorizontal = 0;
  28 + private int itemMargin = 0;
  29 + private int itemMarginVertical = 0;
  30 + private int itemMarginHorizontal = 0;
  31 + private int maxLines = 0;
  32 + private boolean deleteButton = false;
  33 +
  34 + private int deleteButtonImage = -1;
  35 + private int labelBackground = -1;
  36 +
  37 + private boolean selectMode = false;
  38 + private int selectBackground = -1;
  39 + private int selectTextColor = -1;
  40 + private int maxSelectNum = 0;
  41 + private int minSelectNum = 0;
  42 +
  43 + private OnLabelClickListener onLabelClickListener;
  44 + private Context context;
  45 + private List<String> labels;
  46 +
  47 + private String loadLabelsArray;
  48 +
  49 + public StackLabel(Context context) {
  50 + super(context);
  51 + this.context = context;
  52 + }
  53 +
  54 + public StackLabel(Context context, AttributeSet attrs) {
  55 + super(context, attrs);
  56 + this.context = context;
  57 + loadAttrs(context, attrs);
  58 + }
  59 +
  60 + public StackLabel(Context context, AttributeSet attrs, int defStyleAttr) {
  61 + super(context, attrs, defStyleAttr);
  62 + this.context = context;
  63 + loadAttrs(context, attrs);
  64 + }
  65 +
  66 + private void loadAttrs(Context context, AttributeSet attrs) {
  67 + try {
  68 + //默认值
  69 + textColor = Color.argb(230, 0, 0, 0);
  70 + textSize = dp2px(12);
  71 + paddingVertical = dp2px(8);
  72 + paddingHorizontal = dp2px(12);
  73 + itemMargin = dp2px(4);
  74 + deleteButton = false;
  75 +
  76 + //加载值
  77 + TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.StackLabel);
  78 + textColor = typedArray.getColor(R.styleable.StackLabel_textColor, textColor);
  79 + textSize = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_textSize, textSize);
  80 + paddingVertical = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_paddingVertical, paddingVertical);
  81 + paddingHorizontal = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_paddingHorizontal, paddingHorizontal);
  82 + itemMargin = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_itemMargin, itemMargin);
  83 + itemMarginVertical = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_itemMarginVertical, itemMarginVertical);
  84 + itemMarginHorizontal = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_itemMarginHorizontal, itemMarginHorizontal);
  85 + deleteButton = typedArray.getBoolean(R.styleable.StackLabel_deleteButton, deleteButton);
  86 +
  87 + deleteButtonImage = typedArray.getResourceId(R.styleable.StackLabel_deleteButtonImage, deleteButtonImage);
  88 + labelBackground = typedArray.getResourceId(R.styleable.StackLabel_labelBackground, labelBackground);
  89 +
  90 + selectMode = typedArray.getBoolean(R.styleable.StackLabel_selectMode, selectMode);
  91 + selectBackground = typedArray.getResourceId(R.styleable.StackLabel_selectBackground, selectBackground);
  92 + selectTextColor = typedArray.getColor(R.styleable.StackLabel_selectTextColor, selectTextColor);
  93 + maxSelectNum = typedArray.getInt(R.styleable.StackLabel_maxSelectNum, maxSelectNum);
  94 + minSelectNum = typedArray.getInt(R.styleable.StackLabel_minSelectNum, minSelectNum);
  95 + maxLines = typedArray.getInt(R.styleable.StackLabel_maxLines, minSelectNum);
  96 + if (minSelectNum > maxSelectNum && maxSelectNum != 0) minSelectNum = 0;
  97 +
  98 + loadLabelsArray = typedArray.getString(R.styleable.StackLabel_labels);
  99 +
  100 + if (selectBackground == -1) selectBackground = R.drawable.rect_label_bkg_select_normal;
  101 + if (labelBackground == -1) labelBackground = R.drawable.rect_normal_label_button;
  102 + typedArray.recycle();
  103 + } catch (Exception e) {
  104 + }
  105 + }
  106 +
  107 + @Override
  108 + protected void onFinishInflate() {
  109 + super.onFinishInflate();
  110 + if (loadLabelsArray != null && !loadLabelsArray.isEmpty()) {
  111 + if (loadLabelsArray.contains(",")) {
  112 + setLabels(loadLabelsArray.split(","));
  113 + } else {
  114 + addLabel(loadLabelsArray);
  115 + }
  116 + }
  117 + }
  118 +
  119 + private int dp2px(float dpValue) {
  120 + return (int) (0.5f + dpValue * Resources.getSystem().getDisplayMetrics().density);
  121 + }
  122 +
  123 + private float px2dp(int pxValue) {
  124 + return (pxValue / Resources.getSystem().getDisplayMetrics().density);
  125 + }
  126 +
  127 + private List<View> items;
  128 + private int newHeight = 0;
  129 +
  130 + @Override
  131 + protected void onLayout(boolean changed, int l, int t, int r, int b) {
  132 +
  133 + }
  134 +
  135 + @Override
  136 + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  137 + super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  138 +
  139 + refreshViews();
  140 +
  141 + setMeasuredDimension(getMeasuredWidth(), newHeight);//设置宽高
  142 + }
  143 +
  144 + private void refreshViews() {
  145 + int maxWidth = getMeasuredWidth();
  146 +
  147 +
  148 + if (labels != null && !labels.isEmpty()) {
  149 + newHeight = 0;
  150 + if (items != null && !items.isEmpty()) {
  151 + int l = 0, t = 0, r = 0, b = 0, lines = 0;
  152 +
  153 + for (int i = 0; i < items.size(); i++) {
  154 + View item = items.get(i);
  155 +
  156 + int mWidth = MeasureSpec.makeMeasureSpec(maxWidth, MeasureSpec.AT_MOST); //AT_MOST:先按照最大宽度计算,如果小于则按实际值,如果大于,按最大宽度
  157 + int mHeight = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); //UNSPECIFIED:不确定,根据实际情况计算
  158 + item.measure(mWidth, mHeight);
  159 +
  160 + int childWidth = item.getMeasuredWidth();
  161 + int childHeight = item.getMeasuredHeight();
  162 +
  163 + if ((l + childWidth) > maxWidth) {
  164 + l = 0;
  165 + t = t + childHeight;
  166 + lines++;
  167 + }
  168 +
  169 + if (maxLines > 0 && lines >= maxLines) {
  170 + item.setVisibility(GONE);
  171 + } else {
  172 + r = l + childWidth;
  173 +
  174 + if (childWidth > maxWidth) {
  175 + r = maxWidth;
  176 + }
  177 +
  178 + b = t + childHeight;
  179 +
  180 + item.layout(l, t, r, b);
  181 +
  182 + l = l + childWidth;
  183 +
  184 + newHeight = t + childHeight;
  185 + }
  186 + }
  187 + }
  188 + }
  189 + }
  190 +
  191 + public List<String> getLabels() {
  192 + return labels;
  193 + }
  194 +
  195 + public StackLabel setLabels(List<String> l) {
  196 + labels = l;
  197 +
  198 + reloadViews();
  199 + return this;
  200 + }
  201 +
  202 + public boolean remove(int index) {
  203 + if (labels == null) {
  204 + return false;
  205 + }
  206 + labels.remove(index);
  207 + reloadViews();
  208 + return true;
  209 + }
  210 +
  211 + public boolean remove(String label) {
  212 + if (labels == null) {
  213 + return false;
  214 + }
  215 + boolean flag = labels.remove(label);
  216 + reloadViews();
  217 + return flag;
  218 + }
  219 +
  220 + public StackLabel setLabels(String[] arrays) {
  221 + labels = new ArrayList<>();
  222 + for (String s : arrays) {
  223 + labels.add(s);
  224 + }
  225 +
  226 + reloadViews();
  227 + return this;
  228 + }
  229 +
  230 + public boolean isHave(String label) {
  231 + if (labels == null) {
  232 + return false;
  233 + }
  234 + return labels.contains(label);
  235 + }
  236 +
  237 + public int count() {
  238 + if (labels == null) {
  239 + return 0;
  240 + } else {
  241 + return labels.size();
  242 + }
  243 + }
  244 +
  245 + public void reloadViews() {
  246 + removeAllViews();
  247 + items = new ArrayList<>();
  248 + if (labels != null && !labels.isEmpty()) {
  249 +
  250 + for (int i = 0; i < labels.size(); i++) {
  251 + View item = LayoutInflater.from(context).inflate(R.layout.layout_label, null, false);
  252 +
  253 + addView(item);
  254 + items.add(item);
  255 + }
  256 +
  257 + initItem();
  258 + }
  259 + }
  260 +
  261 + public StackLabel addLabel(String label) {
  262 + if (labels == null) labels = new ArrayList<>();
  263 + labels.add(label);
  264 +
  265 + reloadViews();
  266 + return this;
  267 + }
  268 +
  269 + private List<Integer> selectIndexs = new ArrayList<>();
  270 +
  271 + private void initItem() {
  272 + if (labels.size() != 0) {
  273 + selectIndexs = new ArrayList<>();
  274 + for (int i = 0; i < items.size(); i++) {
  275 + View item = items.get(i);
  276 +
  277 + String s = labels.get(i);
  278 + LinearLayout boxLabel = item.findViewById(R.id.box_label);
  279 + TextView txtLabel = item.findViewById(R.id.txt_label);
  280 + ImageView imgDelete = item.findViewById(R.id.img_delete);
  281 +
  282 + txtLabel.setText(s);
  283 + txtLabel.setTextColor(textColor);
  284 + txtLabel.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
  285 +
  286 + boxLabel.setPadding(paddingHorizontal, paddingVertical, paddingHorizontal, paddingVertical);
  287 + MarginLayoutParams p = (MarginLayoutParams) boxLabel.getLayoutParams();
  288 + if (itemMarginHorizontal == 0 && itemMarginVertical == 0) {
  289 + p.setMargins(itemMargin, itemMargin, itemMargin, itemMargin);
  290 + } else {
  291 + p.setMargins(itemMarginHorizontal, itemMarginVertical, itemMarginHorizontal, itemMarginVertical);
  292 + }
  293 + boxLabel.requestLayout();
  294 +
  295 + if (deleteButton) {
  296 + imgDelete.setVisibility(VISIBLE);
  297 + } else {
  298 + imgDelete.setVisibility(GONE);
  299 + }
  300 + if (deleteButtonImage != -1) imgDelete.setImageResource(deleteButtonImage);
  301 + boxLabel.setBackgroundResource(labelBackground);
  302 +
  303 + final int index = i;
  304 + boxLabel.setOnClickListener(new OnClickListener() {
  305 + @Override
  306 + public void onClick(View v) {
  307 + if (selectMode) {
  308 + for (View item : items) {
  309 + LinearLayout boxLabel = item.findViewById(R.id.box_label);
  310 + TextView txtLabel = item.findViewById(R.id.txt_label);
  311 + boxLabel.setBackgroundResource(labelBackground);
  312 +
  313 + txtLabel.setTextColor(textColor);
  314 + txtLabel.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
  315 + }
  316 + if (selectIndexs.contains(index)) {
  317 + if (selectIndexs.size() > minSelectNum) {
  318 + int ind = 0;
  319 + for (int i = 0; i < selectIndexs.size(); i++) {
  320 + if (selectIndexs.get(i) == index) {
  321 + ind = i;
  322 + break;
  323 + }
  324 + }
  325 + selectIndexs.remove(ind);
  326 + }
  327 + } else {
  328 + if (maxSelectNum == 1) selectIndexs.clear();
  329 + if (maxSelectNum <= 0 || (maxSelectNum > 0 && selectIndexs.size() < maxSelectNum)) {
  330 + selectIndexs.add(index);
  331 + }
  332 + }
  333 + for (int index : selectIndexs) {
  334 + View item = items.get(index);
  335 + LinearLayout boxLabel = item.findViewById(R.id.box_label);
  336 + TextView txtLabel = item.findViewById(R.id.txt_label);
  337 + boxLabel.setBackgroundResource(selectBackground);
  338 + txtLabel.setTextColor(selectTextColor);
  339 + }
  340 + }
  341 + if (onLabelClickListener != null)
  342 + onLabelClickListener.onClick(index, v, labels.get(index));
  343 + }
  344 + });
  345 +
  346 + if (whichIsSelected != null) {
  347 + for (String selectStr : whichIsSelected) {
  348 + if (s.equals(selectStr)) {
  349 + selectIndexs.add(index);
  350 + boxLabel.setBackgroundResource(selectBackground);
  351 + txtLabel.setTextColor(selectTextColor);
  352 + }
  353 + }
  354 + }
  355 + }
  356 + whichIsSelected = null;
  357 + }
  358 + }
  359 +
  360 + public OnLabelClickListener getOnLabelClickListener() {
  361 + return onLabelClickListener;
  362 + }
  363 +
  364 + public StackLabel setOnLabelClickListener(OnLabelClickListener onLabelClickListener) {
  365 + this.onLabelClickListener = onLabelClickListener;
  366 + return this;
  367 + }
  368 +
  369 + public boolean isDeleteButton() {
  370 + return deleteButton;
  371 + }
  372 +
  373 + public StackLabel setDeleteButton(boolean deleteButton) {
  374 + this.deleteButton = deleteButton;
  375 + initItem();
  376 + return this;
  377 + }
  378 +
  379 + public boolean isSelectMode() {
  380 + return selectMode;
  381 + }
  382 +
  383 + public StackLabel setSelectMode(boolean selectMode) {
  384 + this.selectMode = selectMode;
  385 + setLabels(labels);
  386 + return this;
  387 + }
  388 +
  389 + private List<String> whichIsSelected; //初始化已选择列表
  390 +
  391 + public StackLabel setSelectMode(boolean selectMode, List<String> whichIsSelected) {
  392 + this.selectMode = selectMode;
  393 + if (selectMode) {
  394 + this.whichIsSelected = whichIsSelected;
  395 + } else {
  396 + whichIsSelected = null;
  397 + }
  398 + setLabels(labels);
  399 + return this;
  400 + }
  401 +
  402 + public int getSelectBackground() {
  403 + return selectBackground;
  404 + }
  405 +
  406 + public StackLabel setSelectBackground(int selectBackground) {
  407 + this.selectBackground = selectBackground;
  408 + setLabels(labels);
  409 + return this;
  410 + }
  411 +
  412 + public int getSelectTextColor() {
  413 + return selectTextColor;
  414 + }
  415 +
  416 + public StackLabel setSelectTextColor(int selectTextColor) {
  417 + this.selectTextColor = selectTextColor;
  418 + return this;
  419 + }
  420 +
  421 + public int getMaxSelectNum() {
  422 + return maxSelectNum;
  423 + }
  424 +
  425 + public StackLabel setMaxSelectNum(int maxSelectNum) {
  426 + this.maxSelectNum = maxSelectNum;
  427 + setLabels(labels);
  428 + return this;
  429 + }
  430 +
  431 + public List<Integer> getSelectIndexList() {
  432 + return selectIndexs;
  433 + }
  434 +
  435 + public int[] getSelectIndexArray() {
  436 + int[] arrays = new int[selectIndexs.size()];
  437 + for (int i = 0; i < selectIndexs.size(); i++) {
  438 + arrays[i] = selectIndexs.get(i);
  439 + }
  440 + return arrays;
  441 + }
  442 +
  443 + public int getTextColor() {
  444 + return textColor;
  445 + }
  446 +
  447 + public StackLabel setTextColor(int textColor) {
  448 + this.textColor = textColor;
  449 + setLabels(labels);
  450 + return this;
  451 + }
  452 +
  453 + public int getTextSize() {
  454 + return textSize;
  455 + }
  456 +
  457 + public StackLabel setTextSize(int textSize) {
  458 + this.textSize = textSize;
  459 + setLabels(labels);
  460 + return this;
  461 + }
  462 +
  463 + public int getPaddingVertical() {
  464 + return paddingVertical;
  465 + }
  466 +
  467 + public StackLabel setPaddingVertical(int paddingVertical) {
  468 + this.paddingVertical = paddingVertical;
  469 + setLabels(labels);
  470 + return this;
  471 + }
  472 +
  473 + public int getPaddingHorizontal() {
  474 + return paddingHorizontal;
  475 + }
  476 +
  477 + public StackLabel setPaddingHorizontal(int paddingHorizontal) {
  478 + this.paddingHorizontal = paddingHorizontal;
  479 + setLabels(labels);
  480 + return this;
  481 + }
  482 +
  483 + public int getItemMargin() {
  484 + return itemMargin;
  485 + }
  486 +
  487 + public StackLabel setItemMargin(int itemMargin) {
  488 + this.itemMargin = itemMargin;
  489 + setLabels(labels);
  490 + return this;
  491 + }
  492 +
  493 + public int getItemMarginVertical() {
  494 + return itemMarginVertical;
  495 + }
  496 +
  497 + public StackLabel setItemMarginVertical(int itemMarginVertical) {
  498 + this.itemMarginVertical = itemMarginVertical;
  499 + setLabels(labels);
  500 + return this;
  501 + }
  502 +
  503 + public int getItemMarginHorizontal() {
  504 + return itemMarginHorizontal;
  505 + }
  506 +
  507 + public StackLabel setItemMarginHorizontal(int itemMarginHorizontal) {
  508 + this.itemMarginHorizontal = itemMarginHorizontal;
  509 + setLabels(labels);
  510 + return this;
  511 + }
  512 +
  513 + public int getMaxLines() {
  514 + return maxLines;
  515 + }
  516 +
  517 + public StackLabel setMaxLines(int maxLines) {
  518 + this.maxLines = maxLines;
  519 + return this;
  520 + }
  521 +
  522 + private void log(Object s) {
  523 + Log.i(">>>", s.toString());
  524 + }
  525 +}
  1 +package com.hh.xuetubao.stacklabel;
  2 +
  3 +import android.content.Context;
  4 +import android.content.res.Resources;
  5 +import android.content.res.TypedArray;
  6 +import android.graphics.Canvas;
  7 +import android.util.AttributeSet;
  8 +import android.view.View;
  9 +import android.view.ViewGroup;
  10 +
  11 +import com.hh.xuetubao.R;
  12 +
  13 +import java.util.ArrayList;
  14 +import java.util.List;
  15 +
  16 +public class StackLayout extends ViewGroup {
  17 +
  18 + private Context context;
  19 + private int itemMargin = 0;
  20 +
  21 + public StackLayout(Context context) {
  22 + super(context);
  23 + this.context = context;
  24 + }
  25 +
  26 + public StackLayout(Context context, AttributeSet attrs) {
  27 + super(context, attrs);
  28 + this.context = context;
  29 + loadAttrs(context, attrs);
  30 + }
  31 +
  32 + public StackLayout(Context context, AttributeSet attrs, int defStyleAttr) {
  33 + super(context, attrs, defStyleAttr);
  34 + this.context = context;
  35 + loadAttrs(context, attrs);
  36 + }
  37 +
  38 + @Override
  39 + protected void onLayout(boolean changed, int l, int t, int r, int b) {
  40 +
  41 + }
  42 +
  43 + private void loadAttrs(Context context, AttributeSet attrs) {
  44 + try {
  45 + //默认值
  46 + itemMargin = dp2px(4);
  47 +
  48 + //加载值
  49 + TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.StackLabel);
  50 + itemMargin = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_itemMargin, itemMargin);
  51 + typedArray.recycle();
  52 + } catch (Exception e) {
  53 + }
  54 + }
  55 +
  56 + private List<View> items;
  57 + private int newHeight = 0;
  58 +
  59 + @Override
  60 + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  61 + super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  62 +
  63 + refreshViews();
  64 +
  65 + setMeasuredDimension(getMeasuredWidth(), newHeight);//设置宽高
  66 + }
  67 +
  68 + private void refreshViews() {
  69 + int maxWidth = getMeasuredWidth();
  70 +
  71 + items = new ArrayList<>();
  72 + for (int i = 0; i < getChildCount(); i++) {
  73 + View child = getChildAt(i);
  74 + if (child.getVisibility() == VISIBLE) {
  75 + items.add(getChildAt(i));
  76 + }
  77 + }
  78 +
  79 + newHeight = 0;
  80 + if (items != null && !items.isEmpty()) {
  81 + int l = 0, t = 0, r = 0, b = 0;
  82 + for (int i = 0; i < items.size(); i++) {
  83 + View item = items.get(i);
  84 +
  85 + int mWidth = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); //AT_MOST:先按照最大宽度计算,如果小于则按实际值,如果大于,按最大宽度
  86 + int mHeight = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); //UNSPECIFIED:不确定,根据实际情况计算
  87 + item.measure(mWidth, mHeight);
  88 +
  89 + int childWidth = item.getMeasuredWidth();
  90 + int childHeight = item.getMeasuredHeight();
  91 +
  92 + if ((l + childWidth) > maxWidth) {
  93 + l = 0;
  94 + t = t + childHeight + itemMargin;
  95 + }
  96 +
  97 + r = l + childWidth ;
  98 +
  99 + if (childWidth > maxWidth) {
  100 + r = maxWidth;
  101 + }
  102 +
  103 + b = t + childHeight;
  104 +
  105 + item.layout(l, t, r, b);
  106 +
  107 + l = l + childWidth + itemMargin;
  108 +
  109 + newHeight = t + childHeight;
  110 + }
  111 + }
  112 + }
  113 +
  114 + @Override
  115 + protected void onDraw(Canvas canvas) {
  116 + super.onDraw(canvas);
  117 + }
  118 +
  119 + private int dp2px(float dpValue) {
  120 + return (int) (0.5f + dpValue * Resources.getSystem().getDisplayMetrics().density);
  121 + }
  122 +}
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle">
  4 + <!-- 填充颜色 -->
  5 + <solid android:color="#ff5400"></solid>
  6 +
  7 + <!-- 矩形的圆角半径 -->
  8 + <corners android:radius="@dimen/dp_5" />
  9 +
  10 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle">
  4 + <!-- 填充颜色 -->
  5 + <stroke android:width="@dimen/dp_1" android:color="#bebebe"/>
  6 + <solid android:color="#ffffff"></solid>
  7 +
  8 + <!-- 矩形的圆角半径 -->
  9 + <corners android:radius="@dimen/dp_5" />
  10 +
  11 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle">
  4 + <!-- 填充颜色 -->
  5 + <solid android:color="#ff5400"></solid>
  6 +
  7 + <!-- 矩形的圆角半径 -->
  8 + <corners android:radius="@dimen/dp_5" />
  9 +
  10 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle">
  4 + <!-- 填充颜色 -->
  5 + <solid android:color="#ff5400"></solid>
  6 +
  7 + <!-- 矩形的圆角半径 -->
  8 + <corners android:radius="@dimen/dp_5" />
  9 +
  10 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <item android:drawable="@drawable/rect_label_bkg_press" android:state_pressed="true" />
  4 + <item android:drawable="@drawable/rect_label_bkg_check" android:state_checked="true" />
  5 + <item android:drawable="@drawable/rect_label_bkg_normal" />
  6 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="wrap_content"
  4 + android:layout_height="wrap_content">
  5 +
  6 + <LinearLayout
  7 + android:id="@+id/box_label"
  8 + android:layout_width="wrap_content"
  9 + android:layout_height="wrap_content"
  10 + android:background="@drawable/rect_normal_label_button"
  11 + android:gravity="center_vertical"
  12 + android:orientation="horizontal"
  13 + android:paddingHorizontal="12dp"
  14 + android:paddingVertical="8dp">
  15 +
  16 + <TextView
  17 + android:id="@+id/txt_label"
  18 + android:layout_width="wrap_content"
  19 + android:layout_height="wrap_content"
  20 + android:layout_weight="1"
  21 + android:gravity="center"
  22 + android:singleLine="true"
  23 + android:text=""
  24 + android:textColor="#dc000000"
  25 + android:textSize="12dp" />
  26 +
  27 + <ImageView
  28 + android:id="@+id/img_delete"
  29 + android:layout_width="15dp"
  30 + android:layout_height="15dp"
  31 + android:layout_marginLeft="2dp"
  32 + android:layout_marginTop="0dp"
  33 + android:layout_marginRight="-3dp"
  34 + android:padding="2dp"
  35 + android:src="@mipmap/img_delete"
  36 + android:visibility="gone" />
  37 + </LinearLayout>
  38 +
  39 +</RelativeLayout>
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
3 android:layout_width="match_parent" 4 android:layout_width="match_parent"
4 android:layout_height="match_parent" 5 android:layout_height="match_parent"
5 - android:orientation="vertical"> 6 + android:orientation="vertical"
  7 + android:background="#ffffff"
  8 + >
6 9
7 - <LinearLayout 10 + <ScrollView
8 android:layout_width="match_parent" 11 android:layout_width="match_parent"
9 - android:layout_height="wrap_content"  
10 - android:orientation="vertical"  
11 - android:background="@color/color_ffffff"  
12 - > 12 + android:layout_height="@dimen/dp_370">
13 13
14 - <TextView  
15 - android:id="@+id/title_one"  
16 - android:layout_width="wrap_content"  
17 - android:layout_height="wrap_content"  
18 - android:layout_marginLeft="@dimen/dp_20"  
19 - android:layout_marginTop="@dimen/dp_20"  
20 - android:text="行业领域"  
21 - android:textColor="#6C6C6C"  
22 - android:textSize="12sp" />  
23 -  
24 - <GridView  
25 - android:id="@+id/grid_one" 14 + <LinearLayout
26 android:layout_width="match_parent" 15 android:layout_width="match_parent"
27 android:layout_height="wrap_content" 16 android:layout_height="wrap_content"
28 - android:layout_marginLeft="@dimen/dp_20"  
29 - android:layout_marginRight="@dimen/dp_20"  
30 - android:layout_marginTop="@dimen/dp_15"  
31 - android:horizontalSpacing="@dimen/dp_20"  
32 - android:numColumns="4"  
33 - android:scrollbars="none"  
34 - android:verticalSpacing="@dimen/dp_15" /> 17 + android:background="@color/color_ffffff"
  18 + android:orientation="vertical">
35 19
36 - <TextView  
37 - android:id="@+id/title_two"  
38 - android:layout_width="wrap_content"  
39 - android:layout_height="wrap_content"  
40 - android:layout_marginLeft="@dimen/dp_20"  
41 - android:layout_marginTop="@dimen/dp_30"  
42 - android:text="岗位职能"  
43 - android:textColor="#6C6C6C"  
44 - android:textSize="12sp" />  
45 -  
46 - <GridView  
47 - android:id="@+id/grid_two"  
48 - android:layout_width="match_parent"  
49 - android:layout_height="wrap_content"  
50 - android:layout_marginLeft="@dimen/dp_20"  
51 - android:layout_marginRight="@dimen/dp_20"  
52 - android:layout_marginTop="@dimen/dp_15"  
53 - android:layout_marginBottom="@dimen/dp_20"  
54 - android:horizontalSpacing="@dimen/dp_20"  
55 - android:numColumns="4"  
56 - android:scrollbars="none"  
57 - android:verticalSpacing="@dimen/dp_15" /> 20 + <TextView
  21 + android:id="@+id/title_one"
  22 + android:layout_width="wrap_content"
  23 + android:layout_height="wrap_content"
  24 + android:layout_marginLeft="@dimen/dp_20"
  25 + android:layout_marginTop="@dimen/dp_20"
  26 + android:text="行业领域"
  27 + android:textColor="#6C6C6C"
  28 + android:textSize="12sp" />
58 29
59 - <View  
60 - android:layout_width="match_parent"  
61 - android:layout_height="@dimen/dp_1"  
62 - android:background="#D6D6D6" /> 30 + <!--<GridView-->
  31 + <!--android:id="@+id/grid_one"-->
  32 + <!--android:layout_width="match_parent"-->
  33 + <!--android:layout_height="wrap_content"-->
  34 + <!--android:layout_marginLeft="@dimen/dp_20"-->
  35 + <!--android:layout_marginRight="@dimen/dp_20"-->
  36 + <!--android:layout_marginTop="@dimen/dp_15"-->
  37 + <!--android:horizontalSpacing="@dimen/dp_20"-->
  38 + <!--android:numColumns="4"-->
  39 + <!--android:scrollbars="none"-->
  40 + <!--android:verticalSpacing="@dimen/dp_15" />-->
63 41
64 - <LinearLayout  
65 - android:layout_width="match_parent"  
66 - android:layout_height="@dimen/dp_45"  
67 - android:orientation="horizontal"> 42 + <com.hh.xuetubao.stacklabel.StackLabel
  43 + android:id="@+id/stacklabel_a"
  44 + android:layout_width="match_parent"
  45 + android:layout_height="wrap_content"
  46 + android:layout_marginLeft="@dimen/dp_20"
  47 + android:layout_marginTop="@dimen/dp_15"
  48 + android:layout_marginRight="@dimen/dp_20"
  49 + app:deleteButton="false"
  50 + app:deleteButtonImage="@mipmap/img_delete"
  51 + app:itemMargin="@dimen/dp_5"
  52 + app:maxSelectNum="1"
  53 + app:paddingVertical="@dimen/dp_5"
  54 + app:selectMode="true"
  55 + app:selectTextColor="#ffffff"
  56 + app:textColor="#6c6c6c"
  57 + app:textSize="@dimen/sp_14" />
68 58
69 <TextView 59 <TextView
70 - android:id="@+id/tv_reset"  
71 - android:layout_width="0dp"  
72 - android:layout_height="match_parent"  
73 - android:layout_weight="1"  
74 - android:gravity="center"  
75 - android:text="重置"  
76 - android:textColor="#6F6F6F"  
77 - android:textSize="16sp" /> 60 + android:id="@+id/title_two"
  61 + android:layout_width="wrap_content"
  62 + android:layout_height="wrap_content"
  63 + android:layout_marginLeft="@dimen/dp_20"
  64 + android:layout_marginTop="@dimen/dp_30"
  65 + android:text="岗位职能"
  66 + android:textColor="#6C6C6C"
  67 + android:textSize="12sp" />
  68 +
  69 + <com.hh.xuetubao.stacklabel.StackLabel
  70 + android:id="@+id/stacklabel_b"
  71 + android:layout_width="match_parent"
  72 + android:layout_height="wrap_content"
  73 + android:layout_marginLeft="@dimen/dp_20"
  74 + android:layout_marginTop="@dimen/dp_15"
  75 + android:layout_marginRight="@dimen/dp_20"
  76 + app:deleteButton="false"
  77 + app:deleteButtonImage="@mipmap/img_delete"
  78 + app:itemMargin="@dimen/dp_5"
  79 + app:maxSelectNum="1"
  80 + app:paddingVertical="@dimen/dp_5"
  81 + app:selectMode="true"
  82 + app:selectTextColor="#ffffff"
  83 + app:textColor="#6c6c6c"
  84 + app:textSize="@dimen/sp_14" />
  85 +
  86 + <!--<GridView-->
  87 + <!--android:id="@+id/grid_two"-->
  88 + <!--android:layout_width="match_parent"-->
  89 + <!--android:layout_height="wrap_content"-->
  90 + <!--android:layout_marginLeft="@dimen/dp_20"-->
  91 + <!--android:layout_marginRight="@dimen/dp_20"-->
  92 + <!--android:layout_marginTop="@dimen/dp_15"-->
  93 + <!--android:layout_marginBottom="@dimen/dp_20"-->
  94 + <!--android:horizontalSpacing="@dimen/dp_20"-->
  95 + <!--android:numColumns="4"-->
  96 + <!--android:scrollbars="none"-->
  97 + <!--android:verticalSpacing="@dimen/dp_15" />-->
78 98
79 <View 99 <View
80 - android:layout_width="@dimen/dp_1"  
81 - android:layout_height="match_parent"  
82 - android:background="#D6D6D6" /> 100 + android:layout_width="match_parent"
  101 + android:layout_height="@dimen/dp_20"
  102 + />
83 103
84 - <TextView  
85 - android:id="@+id/tv_sure"  
86 - android:layout_width="0dp"  
87 - android:layout_height="match_parent"  
88 - android:layout_weight="1"  
89 - android:background="@color/color_ff5400"  
90 - android:gravity="center"  
91 - android:text="确定"  
92 - android:textColor="#ffffff"  
93 - android:textSize="16sp" />  
94 </LinearLayout> 104 </LinearLayout>
95 105
  106 + </ScrollView>
  107 +
  108 + <View
  109 + android:layout_width="match_parent"
  110 + android:layout_height="@dimen/dp_1"
  111 + android:background="#D6D6D6" />
  112 +
  113 + <LinearLayout
  114 + android:layout_width="match_parent"
  115 + android:layout_height="@dimen/dp_45"
  116 + android:orientation="horizontal"
  117 + android:background="#ffffff"
  118 + >
  119 +
  120 + <TextView
  121 + android:id="@+id/tv_reset"
  122 + android:layout_width="0dp"
  123 + android:layout_height="match_parent"
  124 + android:layout_weight="1"
  125 + android:gravity="center"
  126 + android:text="重置"
  127 + android:textColor="#6F6F6F"
  128 + android:textSize="16sp" />
  129 +
  130 + <View
  131 + android:layout_width="@dimen/dp_1"
  132 + android:layout_height="match_parent"
  133 + android:background="#D6D6D6" />
  134 +
  135 + <TextView
  136 + android:id="@+id/tv_sure"
  137 + android:layout_width="0dp"
  138 + android:layout_height="match_parent"
  139 + android:layout_weight="1"
  140 + android:background="@color/color_ff5400"
  141 + android:gravity="center"
  142 + android:text="确定"
  143 + android:textColor="#ffffff"
  144 + android:textSize="16sp" />
96 </LinearLayout> 145 </LinearLayout>
97 146
98 </LinearLayout> 147 </LinearLayout>
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
3 android:layout_width="match_parent" 4 android:layout_width="match_parent"
4 - android:layout_height="wrap_content" 5 + android:layout_height="match_parent"
5 android:orientation="vertical"> 6 android:orientation="vertical">
6 7
7 - <LinearLayout 8 + <ScrollView
8 android:layout_width="match_parent" 9 android:layout_width="match_parent"
9 - android:layout_height="wrap_content"  
10 - android:orientation="vertical"  
11 - android:background="#FFFFFF"  
12 - > 10 + android:layout_height="@dimen/dp_370">
13 11
14 - <TextView  
15 - android:id="@+id/title_one"  
16 - android:layout_width="wrap_content"  
17 - android:layout_height="wrap_content"  
18 - android:layout_marginLeft="@dimen/dp_20"  
19 - android:layout_marginTop="@dimen/dp_20"  
20 - android:text="学历要求"  
21 - android:textColor="#6C6C6C"  
22 - android:textSize="12sp" />  
23 -  
24 - <GridView  
25 - android:id="@+id/grid_one" 12 + <LinearLayout
26 android:layout_width="match_parent" 13 android:layout_width="match_parent"
27 - android:layout_height="wrap_content"  
28 - android:layout_marginLeft="@dimen/dp_20"  
29 - android:layout_marginRight="@dimen/dp_20"  
30 - android:layout_marginTop="@dimen/dp_15"  
31 - android:horizontalSpacing="@dimen/dp_20"  
32 - android:numColumns="4"  
33 - android:scrollbars="none"  
34 - android:verticalSpacing="@dimen/dp_15" /> 14 + android:layout_height="match_parent"
  15 + android:orientation="vertical">
35 16
36 - <TextView  
37 - android:id="@+id/title_two"  
38 - android:layout_width="wrap_content"  
39 - android:layout_height="wrap_content"  
40 - android:layout_marginLeft="@dimen/dp_20"  
41 - android:layout_marginTop="@dimen/dp_30"  
42 - android:text="经验"  
43 - android:textColor="#6C6C6C"  
44 - android:textSize="12sp" />  
45 -  
46 - <GridView  
47 - android:id="@+id/grid_two"  
48 - android:layout_width="match_parent"  
49 - android:layout_height="wrap_content"  
50 - android:layout_marginLeft="@dimen/dp_20"  
51 - android:layout_marginRight="@dimen/dp_20"  
52 - android:layout_marginTop="@dimen/dp_15"  
53 - android:horizontalSpacing="@dimen/dp_20"  
54 - android:numColumns="4"  
55 - android:scrollbars="none"  
56 - android:verticalSpacing="@dimen/dp_15" /> 17 + <LinearLayout
  18 + android:layout_width="match_parent"
  19 + android:layout_height="wrap_content"
  20 + android:background="#FFFFFF"
  21 + android:orientation="vertical">
57 22
58 - <TextView  
59 - android:id="@+id/title_three"  
60 - android:layout_width="wrap_content"  
61 - android:layout_height="wrap_content"  
62 - android:layout_marginLeft="@dimen/dp_20"  
63 - android:layout_marginTop="@dimen/dp_30"  
64 - android:text="职业类型"  
65 - android:textColor="#6C6C6C"  
66 - android:textSize="12sp" />  
67 -  
68 - <GridView  
69 - android:id="@+id/grid_three"  
70 - android:layout_width="match_parent"  
71 - android:layout_height="wrap_content"  
72 - android:layout_marginLeft="@dimen/dp_20"  
73 - android:layout_marginTop="@dimen/dp_15"  
74 - android:layout_marginBottom="@dimen/dp_20"  
75 - android:horizontalSpacing="@dimen/dp_20"  
76 - android:numColumns="4"  
77 - android:scrollbars="none"  
78 - android:verticalSpacing="@dimen/dp_15" /> 23 + <TextView
  24 + android:id="@+id/title_one"
  25 + android:layout_width="wrap_content"
  26 + android:layout_height="wrap_content"
  27 + android:layout_marginLeft="@dimen/dp_20"
  28 + android:layout_marginTop="@dimen/dp_20"
  29 + android:text="学历要求"
  30 + android:textColor="#6C6C6C"
  31 + android:textSize="12sp" />
79 32
80 - <View  
81 - android:layout_width="match_parent"  
82 - android:layout_height="@dimen/dp_1"  
83 - android:background="#D6D6D6" />  
84 33
85 - <LinearLayout  
86 - android:layout_width="match_parent"  
87 - android:layout_height="@dimen/dp_45"  
88 - android:orientation="horizontal">  
89 -  
90 - <TextView  
91 - android:id="@+id/tv_reset"  
92 - android:layout_width="0dp"  
93 - android:layout_height="match_parent"  
94 - android:layout_weight="1"  
95 - android:gravity="center"  
96 - android:text="重置"  
97 - android:textColor="#6F6F6F"  
98 - android:textSize="16sp" /> 34 + <com.hh.xuetubao.stacklabel.StackLabel
  35 + android:id="@+id/stack_req_a"
  36 + android:layout_width="match_parent"
  37 + android:layout_height="wrap_content"
  38 + android:layout_marginLeft="@dimen/dp_20"
  39 + android:layout_marginTop="@dimen/dp_15"
  40 + android:layout_marginRight="@dimen/dp_20"
  41 + app:deleteButton="false"
  42 + app:deleteButtonImage="@mipmap/img_delete"
  43 + app:itemMargin="@dimen/dp_5"
  44 + app:maxSelectNum="1"
  45 + app:paddingVertical="@dimen/dp_5"
  46 + app:selectMode="true"
  47 + app:selectTextColor="#ffffff"
  48 + app:textColor="#6c6c6c"
  49 + app:textSize="@dimen/sp_14" />
  50 + <!--<GridView-->
  51 + <!--android:id="@+id/grid_one"-->
  52 + <!--android:layout_width="match_parent"-->
  53 + <!--android:layout_height="wrap_content"-->
  54 + <!--android:layout_marginLeft="@dimen/dp_20"-->
  55 + <!--android:layout_marginTop="@dimen/dp_15"-->
  56 + <!--android:layout_marginRight="@dimen/dp_20"-->
  57 + <!--android:horizontalSpacing="@dimen/dp_20"-->
  58 + <!--android:numColumns="4"-->
  59 + <!--android:scrollbars="none"-->
  60 + <!--android:verticalSpacing="@dimen/dp_15" />-->
  61 +
  62 + <TextView
  63 + android:id="@+id/title_two"
  64 + android:layout_width="wrap_content"
  65 + android:layout_height="wrap_content"
  66 + android:layout_marginLeft="@dimen/dp_20"
  67 + android:layout_marginTop="@dimen/dp_30"
  68 + android:text="经验"
  69 + android:textColor="#6C6C6C"
  70 + android:textSize="12sp" />
  71 +
  72 + <com.hh.xuetubao.stacklabel.StackLabel
  73 + android:id="@+id/stack_req_b"
  74 + android:layout_width="match_parent"
  75 + android:layout_height="wrap_content"
  76 + android:layout_marginLeft="@dimen/dp_20"
  77 + android:layout_marginTop="@dimen/dp_15"
  78 + android:layout_marginRight="@dimen/dp_20"
  79 + app:deleteButton="false"
  80 + app:deleteButtonImage="@mipmap/img_delete"
  81 + app:itemMargin="@dimen/dp_5"
  82 + app:maxSelectNum="1"
  83 + app:paddingVertical="@dimen/dp_5"
  84 + app:selectMode="true"
  85 + app:selectTextColor="#ffffff"
  86 + app:textColor="#6c6c6c"
  87 + app:textSize="@dimen/sp_14" />
  88 +
  89 + <!--<GridView-->
  90 + <!--android:id="@+id/grid_two"-->
  91 + <!--android:layout_width="match_parent"-->
  92 + <!--android:layout_height="wrap_content"-->
  93 + <!--android:layout_marginLeft="@dimen/dp_20"-->
  94 + <!--android:layout_marginTop="@dimen/dp_15"-->
  95 + <!--android:layout_marginRight="@dimen/dp_20"-->
  96 + <!--android:horizontalSpacing="@dimen/dp_20"-->
  97 + <!--android:numColumns="4"-->
  98 + <!--android:scrollbars="none"-->
  99 + <!--android:verticalSpacing="@dimen/dp_15" />-->
  100 +
  101 + <TextView
  102 + android:id="@+id/title_three"
  103 + android:layout_width="wrap_content"
  104 + android:layout_height="wrap_content"
  105 + android:layout_marginLeft="@dimen/dp_20"
  106 + android:layout_marginTop="@dimen/dp_30"
  107 + android:text="职业类型"
  108 + android:textColor="#6C6C6C"
  109 + android:textSize="12sp" />
  110 +
  111 + <com.hh.xuetubao.stacklabel.StackLabel
  112 + android:id="@+id/stack_req_c"
  113 + android:layout_width="match_parent"
  114 + android:layout_height="wrap_content"
  115 + android:layout_marginLeft="@dimen/dp_20"
  116 + android:layout_marginTop="@dimen/dp_15"
  117 + android:layout_marginRight="@dimen/dp_20"
  118 + app:deleteButton="false"
  119 + app:deleteButtonImage="@mipmap/img_delete"
  120 + app:itemMargin="@dimen/dp_5"
  121 + app:maxSelectNum="1"
  122 + app:paddingVertical="@dimen/dp_5"
  123 + app:selectMode="true"
  124 + app:selectTextColor="#ffffff"
  125 + app:textColor="#6c6c6c"
  126 + app:textSize="@dimen/sp_14" />
  127 +
  128 + <!--<GridView-->
  129 + <!--android:id="@+id/grid_three"-->
  130 + <!--android:layout_width="match_parent"-->
  131 + <!--android:layout_height="wrap_content"-->
  132 + <!--android:layout_marginLeft="@dimen/dp_20"-->
  133 + <!--android:layout_marginTop="@dimen/dp_15"-->
  134 + <!--android:layout_marginBottom="@dimen/dp_20"-->
  135 + <!--android:horizontalSpacing="@dimen/dp_20"-->
  136 + <!--android:numColumns="4"-->
  137 + <!--android:scrollbars="none"-->
  138 + <!--android:verticalSpacing="@dimen/dp_15" />-->
  139 +
  140 + </LinearLayout>
99 141
100 <View 142 <View
101 - android:layout_width="@dimen/dp_1"  
102 - android:layout_height="match_parent"  
103 - android:background="#D6D6D6" />  
104 -  
105 - <TextView  
106 - android:id="@+id/tv_sure"  
107 - android:layout_width="0dp"  
108 - android:layout_height="match_parent"  
109 - android:layout_weight="1"  
110 - android:gravity="center"  
111 - android:text="确定"  
112 - android:textColor="#6F6F6F"  
113 - android:textSize="16sp" /> 143 + android:layout_width="match_parent"
  144 + android:layout_height="@dimen/dp_20"
  145 + android:background="#ffffff" />
  146 +
114 </LinearLayout> 147 </LinearLayout>
115 148
  149 + </ScrollView>
  150 +
  151 + <View
  152 + android:layout_width="match_parent"
  153 + android:layout_height="@dimen/dp_1"
  154 + android:background="#D6D6D6" />
  155 +
  156 + <LinearLayout
  157 + android:layout_width="match_parent"
  158 + android:layout_height="@dimen/dp_45"
  159 + android:background="#ffffff"
  160 + android:orientation="horizontal">
  161 +
  162 + <TextView
  163 + android:id="@+id/tv_reset"
  164 + android:layout_width="0dp"
  165 + android:layout_height="match_parent"
  166 + android:layout_weight="1"
  167 + android:gravity="center"
  168 + android:text="重置"
  169 + android:textColor="#6F6F6F"
  170 + android:textSize="16sp" />
  171 +
  172 + <View
  173 + android:layout_width="@dimen/dp_1"
  174 + android:layout_height="match_parent"
  175 + android:background="#D6D6D6" />
  176 +
  177 + <TextView
  178 + android:id="@+id/tv_sure"
  179 + android:layout_width="0dp"
  180 + android:layout_height="match_parent"
  181 + android:layout_weight="1"
  182 + android:background="@color/color_ff5400"
  183 + android:gravity="center"
  184 + android:text="确定"
  185 + android:textColor="#ffffff"
  186 + android:textSize="16sp" />
  187 +
116 </LinearLayout> 188 </LinearLayout>
117 189
  190 +
118 </LinearLayout> 191 </LinearLayout>
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <resources> 2 <resources>
  3 + <declare-styleable name="StackLabel">
  4 + <attr name="textColor" format="color" />
  5 + <attr name="textSize" format="dimension"/>
  6 + <attr name="paddingVertical" format="dimension"/>
  7 + <attr name="paddingHorizontal" format="dimension"/>
  8 + <attr name="itemMargin" format="dimension"/>
  9 + <attr name="itemMarginVertical" format="dimension"/>
  10 + <attr name="itemMarginHorizontal" format="dimension"/>
  11 + <attr name="deleteButton" format="boolean" />
3 12
  13 + <attr name="deleteButtonImage" format="reference" />
  14 + <attr name="labelBackground" format="reference" />
  15 +
  16 + <attr name="selectMode" format="boolean" />
  17 + <attr name="selectBackground" format="reference" />
  18 + <attr name="selectTextColor" format="color" />
  19 + <attr name="maxSelectNum" format="integer" />
  20 + <attr name="minSelectNum" format="integer" />
  21 + <attr name="maxLines" format="integer" />
  22 +
  23 + <attr name="labels" format="string" />
  24 + </declare-styleable>
4 </resources> 25 </resources>