作者 liming

修改筛选弹窗

... ... @@ -9,3 +9,4 @@
/build
/captures
.externalNativeBuild
/.idea
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="10">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="7">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="6">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
</list>
</value>
</option>
</component>
=======
>>>>>>> liming
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="7">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="6">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitSharedSettings">
<option name="FORCE_PUSH_PROHIBITED_PATTERNS">
<list>
<option value="liming" />
</list>
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
... ... @@ -11,8 +11,6 @@ android {
}
}*/
compileSdkVersion 28
defaultConfig {
applicationId "com.hh.xuetubao"
... ...
不能预览此文件类型
... ... @@ -38,6 +38,8 @@ import com.hh.xuetubao.model.ZhaopinModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import com.hh.xuetubao.stacklabel.OnLabelClickListener;
import com.hh.xuetubao.stacklabel.StackLabel;
import java.util.ArrayList;
import java.util.List;
... ... @@ -86,7 +88,14 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
private PopCityListAdapter popCityListAdapter;
SelectBean beanA = new SelectBean();
SelectBean beanB = new SelectBean();
SelectBean cityBean = new SelectBean();
// 类别
List<String> lebeiA = new ArrayList<>(); // 数据
List<String> lebeiB = new ArrayList<>(); // 数据
List<String> lb_one = new ArrayList<>(); // 选中
List<String> lb_two = new ArrayList<>(); // 选中
@Override
public void initView() {
... ... @@ -142,7 +151,6 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
doRequset(requsetBody);
mPresenter.getPresenter(7, 1, String.valueOf(true));
mPresenter.getPresenter(8, 1, String.valueOf(0), String.valueOf(true));
mPresenter.getPresenter(8, 2, String.valueOf(1), String.valueOf(true));
mPresenter.getPresenter(8, 3, String.valueOf(3), String.valueOf(true));
... ... @@ -185,36 +193,21 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
hangyeList.addAll(propListBeans);
for (int i = 0; i < hangyeList.size(); i++) {
String propName = hangyeList.get(i).getPropName();
lebeiA.add(propName);
}
lb_one.add(hangyeList.get(0).getPropName());
}
if (api == 8 && intent == 2) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
zhinengList.addAll(propListBeans);
}
if (api == 8 && intent == 3) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
xingzhiList.addAll(propListBeans);
}
if (api == 8 && intent == 4) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
guiMoList.addAll(propListBeans);
}
if (api == 8 && intent == 5) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
xueLiList.addAll(propListBeans);
}
if (api == 8 && intent == 6) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
jingYanList.addAll(propListBeans);
}
if (api == 8 && intent == 7) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
zhiYeList.addAll(propListBeans);
for (int i = 0; i < zhinengList.size(); i++) {
String propName = zhinengList.get(i).getPropName();
lebeiB.add(propName);
}
lb_two.add(zhinengList.get(0).getPropName());
}
}
... ... @@ -241,17 +234,17 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
Intent intent = new Intent(this, CompanyDetailActivity.class);
intent.putExtra("CompanyOid", CompanyOid);
startActivity(intent);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.lin_leibie:
showCategoryPop(hangyeList, zhinengList);
showDrop1(lebeiA,lebeiB);
break;
case R.id.lin_city:
showCityPop(provinceList, cityList);
// showCityPop(provinceList, cityList);
showCityPop(CompanyActivity.this, provinceList, cityList);
break;
}
}
... ... @@ -268,7 +261,7 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
super.onNext(value);
CompanyBean bean = (CompanyBean) value;
List<CompanyBean.CompanyListBean> listBeans = bean.getCompanyList();
Log.e("listBeans",listBeans.toString().trim());
companyList.clear();
companyList.addAll(listBeans);
companyRecAdapter.notifyDataSetChanged();
... ... @@ -288,23 +281,23 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
}
//职位->城市弹窗
private void showCityPop(final List<AddressBean.ProvListBean> provinceList, final List<AddressBean.CityListBean> cityList) {
private void showCityPop(final CompanyActivity activity, final List<AddressBean.ProvListBean> provinceList, final List<AddressBean.CityListBean> cityList) {
View contentView = LayoutInflater.from(this).inflate(R.layout.pop_city, null);
View contentView = LayoutInflater.from(CompanyActivity.this).inflate(R.layout.pop_city, null);
final ListView listOne = (ListView) contentView.findViewById(R.id.list_one);
final ListView listTwo = (ListView) contentView.findViewById(R.id.list_two);
final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
final PopProvinceListAdapter popListAdapter = new PopProvinceListAdapter(provinceList, this);
final PopProvinceListAdapter popListAdapter = new PopProvinceListAdapter(provinceList, CompanyActivity.this);
listOne.setAdapter(popListAdapter);
popCityListAdapter = new PopCityListAdapter(cityList, this);
popCityListAdapter = new PopCityListAdapter(cityList, CompanyActivity.this);
listTwo.setAdapter(popCityListAdapter);
if (beanB.getSelectA() != 0) {
if (cityBean.getSelectA() != 0) {
listTwo.setVisibility(View.VISIBLE);
popListAdapter.change(beanB.getSelectA());
popCityListAdapter.change(beanB.getSelectB());
popListAdapter.change(cityBean.getSelectA());
popCityListAdapter.change(cityBean.getSelectB());
} else {
listTwo.setVisibility(View.INVISIBLE);
}
... ... @@ -312,30 +305,31 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
listOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
requsetBody.setProvinceId(provinceList.get(position).getProvOid());
// requsetBody.setProvinceId(provinceList.get(position).getProvOid());
Log.e("requestBodyA",requsetBody.toString());
if (position == 0) {
proviceId = provinceList.get(1).getProvOid();
listTwo.setVisibility(View.INVISIBLE);
beanB.setSelectB(0);
} else if (beanB.getSelectA() == position && beanB.getSelectA() != 0) {
cityBean.setSelectB(0);
requsetBody.setProvinceId(null); // 不限
requsetBody.setCityId(null); // 不限
} else if (cityBean.getSelectA() == position && cityBean.getSelectA() != 0) {
listTwo.setVisibility(View.VISIBLE);
popCityListAdapter.change(beanB.getSelectB());
beanB.setSelectB(beanB.getSelectB());
popCityListAdapter.change(cityBean.getSelectB());
cityBean.setSelectB(cityBean.getSelectB());
requsetBody.setProvinceId(provinceList.get(position).getProvOid());
} else {
proviceId = provinceList.get(position).getProvOid();
listTwo.setVisibility(View.VISIBLE);
popCityListAdapter.change(0);
requsetBody.setProvinceId(provinceList.get(position).getProvOid());
}
// if (position == 0) {
// proviceId = provinceList.get(1).getProvOid();
// } else {
// proviceId = provinceList.get(position).getProvOid();
// }
// model.getModel(activity, 7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
popListAdapter.change(position);
beanB.setSelectA(position);
cityBean.setSelectA(position);
}
});
... ... @@ -343,9 +337,14 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
requsetBody.setCityId(cityList.get(position).getCityId());
if(position == 0){
requsetBody.setCityId(null);
}else {
requsetBody.setCityId(cityList.get(position).getCityId());
}
Log.e("requestBodyB",requsetBody.toString());
popCityListAdapter.change(position); // 改
beanB.setSelectB(position);
cityBean.setSelectB(position);
}
});
... ... @@ -361,57 +360,175 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
@Override
public void onClick(View v) {
beanB.setSelectA(0);
beanB.setSelectB(0);
// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
// reset.setTextColor(getResources().getColor(R.color.color_ffffff));
// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
requsetBody.setProvinceId(null);
requsetBody.setCityId(null);
cityBean.setSelectA(0);
cityBean.setSelectB(0);
requsetBody.setProvinceId(provinceList.get(0).getProvOid());
proviceId = provinceList.get(1).getProvOid();
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
popListAdapter.change(0);
popCityListAdapter.change(0);
listTwo.setVisibility(View.INVISIBLE);
}
});
sure.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.e("requestBodyB",requsetBody.toString());
doRequset(requsetBody);
popupWindow.dismiss();
chageAlpha(1f);
// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
// sure.setTextColor(getResources().getColor(R.color.color_ffffff));
// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
doRequset(requsetBody);
}
});
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
chageAlpha(1f);
}
});
}
//职位->类别弹窗
private void showCategoryPop(final List<AddressBean.PropListBean> propList, final List<AddressBean.PropListBean> zhinengList) {
View contentView = LayoutInflater.from(this).inflate(R.layout.pop_category, null);
GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
final GridViewAdapter adapter = new GridViewAdapter(propList, this);
gridOne.setAdapter(adapter);
final GridViewAdapter adapter1 = new GridViewAdapter(zhinengList, this);
gridTwo.setAdapter(adapter1);
//职位->城市弹窗
// private void showCityPop(final List<AddressBean.ProvListBean> provinceList, final List<AddressBean.CityListBean> cityList) {
//
// View contentView = LayoutInflater.from(this).inflate(R.layout.pop_city, null);
// final ListView listOne = (ListView) contentView.findViewById(R.id.list_one);
// final ListView listTwo = (ListView) contentView.findViewById(R.id.list_two);
// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
//
// final PopProvinceListAdapter popListAdapter = new PopProvinceListAdapter(provinceList, this);
// listOne.setAdapter(popListAdapter);
// popCityListAdapter = new PopCityListAdapter(cityList, this);
// listTwo.setAdapter(popCityListAdapter);
//
// if (beanB.getSelectA() != 0) {
// listTwo.setVisibility(View.VISIBLE);
// popListAdapter.change(beanB.getSelectA());
// popCityListAdapter.change(beanB.getSelectB());
// } else {
// listTwo.setVisibility(View.INVISIBLE);
// }
//
// listOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// requsetBody.setProvinceId(provinceList.get(position).getProvOid());
//
// if (position == 0) {
// proviceId = provinceList.get(1).getProvOid();
// listTwo.setVisibility(View.INVISIBLE);
// beanB.setSelectB(0);
// } else if (beanB.getSelectA() == position && beanB.getSelectA() != 0) {
// listTwo.setVisibility(View.VISIBLE);
// popCityListAdapter.change(beanB.getSelectB());
// beanB.setSelectB(beanB.getSelectB());
// } else {
// proviceId = provinceList.get(position).getProvOid();
// listTwo.setVisibility(View.VISIBLE);
// popCityListAdapter.change(0);
// }
//
// mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
// popListAdapter.change(position);
// beanB.setSelectA(position);
//
// }
// });
//
// listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// requsetBody.setCityId(cityList.get(position).getCityId());
// popCityListAdapter.change(position); // 改
// beanB.setSelectB(position);
// }
// });
//
// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCity.getBottom());
// popupWindow.setOutsideTouchable(true);
// popupWindow.setTouchable(true);
// popupWindow.setFocusable(true);
// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
// popupWindow.showAsDropDown(linCity);
//
// reset.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
//
// beanB.setSelectA(0);
// beanB.setSelectB(0);
// requsetBody.setProvinceId(null);
// requsetBody.setCityId(null);
// }
// });
// sure.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// popupWindow.dismiss();
// chageAlpha(1f);
// doRequset(requsetBody);
// }
// });
// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
// @Override
// public void onDismiss() {
// chageAlpha(1f);
// }
// });
// }
/* 类别 */
private void showDrop1(final List<String> lebeiA, final List<String> lebeiB) {
View contentView = LayoutInflater.from(CompanyActivity.this).inflate(R.layout.pop_category, null);
final StackLabel stack1 = contentView.findViewById(R.id.stacklabel_a);
final StackLabel stack2 = contentView.findViewById(R.id.stacklabel_b);
View reset = contentView.findViewById(R.id.tv_reset);
View sure = contentView.findViewById(R.id.tv_sure);
stack1.setLabels(lebeiA);
stack2.setLabels(lebeiB);
stack1.setSelectMode(true, lb_one);
stack2.setSelectMode(true, lb_two);
stack1.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onClick(int index, View v, String s) {
if (lb_one.size() > 1) {
lb_one.remove(1);
}
lb_one.remove(0);
lb_one.add(lebeiA.get(index));
stack1.setSelectMode(true, lb_one);
lb_one.add(index + "");
Log.e("lb_one", lb_one.toString());
}
});
adapter.setClickPosition(beanA.getSelectA());
adapter1.setClickPosition(beanA.getSelectB());
stack2.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onClick(int index, View v, String s) {
if (lb_two.size() > 1) {
lb_two.remove(1);
}
lb_two.remove(0);
lb_two.add(lebeiB.get(index));
stack2.setSelectMode(true, lb_two);
lb_two.add(index + "");
Log.e("lb_two", lb_two.toString());
}
});
final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linLeibie.getBottom());
final PopupWindow popupWindow = new PopupWindow(contentView, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linLeibie.getBottom());
popupWindow.setOutsideTouchable(true);
popupWindow.setTouchable(true);
popupWindow.setFocusable(true);
... ... @@ -419,69 +536,113 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
popupWindow.showAsDropDown(linLeibie);
gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter.setClickPosition(position);
adapter.notifyDataSetChanged();
requsetBody.setCompanyIndustry(propList.get(position).getPropId());
beanA.setSelectA(position);
}
});
gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter1.setClickPosition(position);
adapter1.notifyDataSetChanged();
requsetBody.setJobFunction(zhinengList.get(position).getPropId());
beanA.setSelectB(position);
}
});
reset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
reset.setTextColor(getResources().getColor(R.color.color_ffffff));
sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
beanA.setSelectA(0);
beanB.setSelectB(0);
if (lb_one.size() > 0) {
lb_one.remove(0);
}
adapter.setClickPosition(0);
adapter.notifyDataSetChanged();
adapter1.setClickPosition(0);
adapter1.notifyDataSetChanged();
lb_one.add(lebeiA.get(0));
stack1.setSelectMode(true, lb_one);
requsetBody.setCompanyIndustry(null);
requsetBody.setJobFunction(null);
if (lb_two.size() > 0) {
lb_two.remove(0);
}
lb_two.add(lebeiB.get(0));
stack2.setSelectMode(true, lb_two);
}
});
sure.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
chageAlpha(1f);
sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
sure.setTextColor(getResources().getColor(R.color.color_ffffff));
reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
if (lb_one.size() > 0) {
if (!lb_one.get(0).equals("不限")) {
requsetBody.setCompanyIndustry(hangyeList.get(Integer.valueOf(lb_one.get(1))).getPropId());
} else {
requsetBody.setCompanyIndustry(null);
}
} else {
requsetBody.setCompanyIndustry(null);
}
if (lb_two.size() > 0) {
if (!lb_two.get(0).equals("不限")) {
requsetBody.setJobFunction(zhinengList.get(Integer.valueOf(lb_two.get(1))).getPropId());
} else {
requsetBody.setJobFunction(null);
}
} else {
requsetBody.setJobFunction(null);
}
doRequset(requsetBody);
}
});
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
chageAlpha(1f);
popupWindow.dismiss();
}
});
}
// //职位->类别弹窗
// private void showCategoryPop(final List<AddressBean.PropListBean> propList, final List<AddressBean.PropListBean> zhinengList) {
//
// View contentView = LayoutInflater.from(this).inflate(R.layout.pop_category, null);
//
// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
//
// final GridViewAdapter adapter = new GridViewAdapter(propList, this);
//// gridOne.setAdapter(adapter);
// final GridViewAdapter adapter1 = new GridViewAdapter(zhinengList, this);
//// gridTwo.setAdapter(adapter1);
//
// adapter.setClickPosition(beanA.getSelectA());
// adapter1.setClickPosition(beanA.getSelectB());
//
// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linLeibie.getBottom());
// popupWindow.setOutsideTouchable(true);
// popupWindow.setTouchable(true);
// popupWindow.setFocusable(true);
// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
// popupWindow.showAsDropDown(linLeibie);
//
// reset.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// beanA.setSelectA(0);
// beanB.setSelectB(0);
//
// adapter.setClickPosition(0);
// adapter.notifyDataSetChanged();
// adapter1.setClickPosition(0);
// adapter1.notifyDataSetChanged();
//
// requsetBody.setCompanyIndustry(null);
// requsetBody.setJobFunction(null);
// }
// });
// sure.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// popupWindow.dismiss();
// doRequset(requsetBody);
// }
// });
// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
// @Override
// public void onDismiss() {
// chageAlpha(1f);
// }
// });
//
// }
private void chageAlpha(float color) {
/*
WindowManager.LayoutParams lp = getWindow().getAttributes();
... ...
... ... @@ -80,7 +80,7 @@ public class JobHuntCompanyAdapter extends RecyclerView.Adapter<JobHuntCompanyAd
@Override
public int getItemCount() {
return 3;
return list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
... ...
... ... @@ -59,7 +59,7 @@ public class JobHuntWorkAdapter extends RecyclerView.Adapter<JobHuntWorkAdapter.
@Override
public int getItemCount() {
return 3;
return list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
... ...
... ... @@ -148,6 +148,37 @@ public class CompanyBean implements Serializable {
public void setIndustry(String Industry) {
this.Industry = Industry;
}
@Override
public String toString() {
return "IndustryListBean{" +
"Industry='" + Industry + '\'' +
'}';
}
}
@Override
public String toString() {
return "CompanyListBean{" +
"CompanyOid='" + CompanyOid + '\'' +
", CompanyLogo='" + CompanyLogo + '\'' +
", CompanName='" + CompanName + '\'' +
", Address='" + Address + '\'' +
", CompanyNature='" + CompanyNature + '\'' +
", CompanySize='" + CompanySize + '\'' +
", PopularJobName='" + PopularJobName + '\'' +
", PopularJobOid='" + PopularJobOid + '\'' +
", JobCount=" + JobCount +
", IndustryList=" + IndustryList +
'}';
}
}
@Override
public String toString() {
return "CompanyBean{" +
"IsSuccess=" + IsSuccess +
", CompanyList=" + CompanyList +
'}';
}
}
... ...
... ... @@ -21,6 +21,7 @@ import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.MyServer;
import com.hh.xuetubao.R;
... ... @@ -40,6 +41,8 @@ import com.hh.xuetubao.model.ZhaopinModel;
import com.hh.xuetubao.mvp.BaseMvpFragment;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import com.hh.xuetubao.stacklabel.OnLabelClickListener;
import com.hh.xuetubao.stacklabel.StackLabel;
import java.util.ArrayList;
import java.util.List;
... ... @@ -96,6 +99,26 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
SelectBean companyBean = new SelectBean();
SelectBean yqBean = new SelectBean();
// 类别
List<String> lebeiA = new ArrayList<>(); // 数据
List<String> lebeiB = new ArrayList<>(); // 数据
List<String> lb_one = new ArrayList<>(); // 选中
List<String> lb_two = new ArrayList<>(); // 选中
// 公司
List<String> gsA = new ArrayList<>(); // 数据
List<String> gsB = new ArrayList<>(); // 数据
List<String> gs_one = new ArrayList<>(); // 选中
List<String> gs_two = new ArrayList<>(); // 选中
// 公司
List<String> yqA = new ArrayList<>(); // 数据
List<String> yqB = new ArrayList<>(); // 数据
List<String> yqC = new ArrayList<>(); // 数据
List<String> yq_one = new ArrayList<>(); // 选中
List<String> yq_two = new ArrayList<>(); // 选中
List<String> yq_three = new ArrayList<>(); // 选中
@Override
public int getLayoutId() {
return R.layout.fragment_office;
... ... @@ -193,36 +216,71 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
hangyeList.addAll(propListBeans);
for (int i = 0; i < hangyeList.size(); i++) {
String propName = hangyeList.get(i).getPropName();
lebeiA.add(propName);
}
lb_one.add(hangyeList.get(0).getPropName());
}
if (api == 8 && intent == 2) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
zhinengList.addAll(propListBeans);
for (int i = 0; i < zhinengList.size(); i++) {
String propName = zhinengList.get(i).getPropName();
lebeiB.add(propName);
}
lb_two.add(zhinengList.get(0).getPropName());
}
if (api == 8 && intent == 3) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
xingzhiList.addAll(propListBeans);
for (int i = 0; i < xingzhiList.size(); i++) {
String propName = xingzhiList.get(i).getPropName();
gsA.add(propName);
}
gs_one.add(xingzhiList.get(0).getPropName());
}
if (api == 8 && intent == 4) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
guiMoList.addAll(propListBeans);
for (int i = 0; i < propListBeans.size(); i++) {
String propName = propListBeans.get(i).getPropName();
gsB.add(propName);
}
gs_two.add(propListBeans.get(0).getPropName());
}
if (api == 8 && intent == 5) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
xueLiList.addAll(propListBeans);
for (int i = 0; i < propListBeans.size(); i++) {
String propName = propListBeans.get(i).getPropName();
yqA.add(propName);
}
yq_one.add(propListBeans.get(0).getPropName());
}
if (api == 8 && intent == 6) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
jingYanList.addAll(propListBeans);
for (int i = 0; i < propListBeans.size(); i++) {
String propName = propListBeans.get(i).getPropName();
yqB.add(propName);
}
yq_two.add(propListBeans.get(0).getPropName());
}
if (api == 8 && intent == 7) {
AddressBean bean = (AddressBean) o;
List<AddressBean.PropListBean> propListBeans = bean.getPropList();
zhiYeList.addAll(propListBeans);
for (int i = 0; i < propListBeans.size(); i++) {
String propName = propListBeans.get(i).getPropName();
yqC.add(propName);
}
yq_three.add(propListBeans.get(0).getPropName());
}
}
... ... @@ -261,57 +319,61 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
public void onClick(View v) {
switch (v.getId()) {
case R.id.lin_category:
showCategoryPop(hangyeList, zhinengList);
showDrop1(lebeiA, lebeiB);
break;
case R.id.lin_city:
showCityPop(getActivity(), provinceList, cityList);
break;
case R.id.lin_company:
showCompanyPop(xingzhiList, guiMoList);
case R.id.lin_company: // 公司
showDrop2(gsA, gsB);
break;
case R.id.lin_require:
showRequirePop(xueLiList, jingYanList, zhiYeList);
case R.id.lin_require: // 要求
showDrop3(yqA, yqB, yqC);
break;
}
}
//职位->类别弹窗
private void showCategoryPop(final List<AddressBean.PropListBean> propList, final List<AddressBean.PropListBean> zhinengList) {
/* 类别 */
private void showDrop1(final List<String> lebeiA, final List<String> lebeiB) {
View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
final StackLabel stack1 = contentView.findViewById(R.id.stacklabel_a);
final StackLabel stack2 = contentView.findViewById(R.id.stacklabel_b);
final GridViewAdapter adapter = new GridViewAdapter(propList, getActivity());
gridOne.setAdapter(adapter);
adapter.setClickPosition(lbBean.getSelectA());
View reset = contentView.findViewById(R.id.tv_reset);
View sure = contentView.findViewById(R.id.tv_sure);
final GridViewAdapter adapter1 = new GridViewAdapter(zhinengList, getActivity());
gridTwo.setAdapter(adapter1);
adapter1.setClickPosition(lbBean.getSelectB());
stack1.setLabels(lebeiA);
stack2.setLabels(lebeiB);
gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter.setClickPosition(position);
adapter.notifyDataSetChanged();
requestBody.setCompanyIndustry(propList.get(position).getPropId());
stack1.setSelectMode(true, lb_one);
stack2.setSelectMode(true, lb_two);
lbBean.setSelectA(position);
stack1.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onClick(int index, View v, String s) {
if (lb_one.size() > 1) {
lb_one.remove(1);
}
lb_one.remove(0);
lb_one.add(lebeiA.get(index));
stack1.setSelectMode(true, lb_one);
lb_one.add(index + "");
Log.e("lb_one", lb_one.toString());
}
});
gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
stack2.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter1.setClickPosition(position);
adapter1.notifyDataSetChanged();
requestBody.setJobFunction(zhinengList.get(position).getPropId());
lbBean.setSelectB(position);
public void onClick(int index, View v, String s) {
if (lb_two.size() > 1) {
lb_two.remove(1);
}
lb_two.remove(0);
lb_two.add(lebeiB.get(index));
stack2.setSelectMode(true, lb_two);
lb_two.add(index + "");
Log.e("lb_two", lb_two.toString());
}
});
... ... @@ -326,277 +388,288 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
reset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
// reset.setTextColor(getResources().getColor(R.color.color_ffffff));
// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
lbBean.setSelectA(0);
lbBean.setSelectB(0);
if (lb_one.size() > 0) {
lb_one.remove(0);
}
adapter.setClickPosition(0);
adapter.notifyDataSetChanged();
adapter1.setClickPosition(0);
adapter1.notifyDataSetChanged();
lb_one.add(lebeiA.get(0));
stack1.setSelectMode(true, lb_one);
requestBody.setCompanyIndustry(null);
requestBody.setJobFunction(null);
if (lb_two.size() > 0) {
lb_two.remove(0);
}
lb_two.add(lebeiB.get(0));
stack2.setSelectMode(true, lb_two);
}
});
sure.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
chageAlpha(1f);
// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
// sure.setTextColor(getResources().getColor(R.color.color_ffffff));
// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
doRequset(requestBody);
}
});
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
chageAlpha(1f);
}
});
}
private void doRequset(JobSearchBody body) {
Log.e("zhangtao:request", body.toString());
Log.e("zhangtao", "=================================================");
MyServer myServer = HttpUtils.getInstance().getServer(NetConfig.zhaopinUrl);
myServer.JobSearch(body)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
@Override
public void onNext(Object value) {
super.onNext(value);
HotJobBean hotJobBean = (HotJobBean) value;
List<HotJobBean.JobListBean> jobListBeans = hotJobBean.getJobList();
jobList.clear();
jobList.addAll(jobListBeans);
jobHuntWorkAdapter.notifyDataSetChanged();
if (lb_one.size() > 0) {
if (!lb_one.get(0).equals("不限")) {
requestBody.setCompanyIndustry(hangyeList.get(Integer.valueOf(lb_one.get(1))).getPropId());
} else {
requestBody.setCompanyIndustry(null);
}
} else {
requestBody.setCompanyIndustry(null);
}
@Override
public void onError(Throwable e) {
super.onError(e);
if (lb_two.size() > 0) {
if (!lb_two.get(0).equals("不限")) {
requestBody.setJobFunction(zhinengList.get(Integer.valueOf(lb_two.get(1))).getPropId());
} else {
requestBody.setJobFunction(null);
}
} else {
requestBody.setJobFunction(null);
}
@Override
public void onComplete() {
super.onComplete();
}
});
doRequset(requestBody);
popupWindow.dismiss();
}
});
}
//职位->要求弹窗
private void showRequirePop(final List<AddressBean.PropListBean> xueLiList, final List<AddressBean.PropListBean> jingYanList, final List<AddressBean.PropListBean> zhiYeList) {
/* 公司 */
private void showDrop2(final List<String> gsA, final List<String> gsB) {
View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_require, null);
GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
GridView gridThree = (GridView) contentView.findViewById(R.id.grid_three);
final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
final StackLabel stack1 = contentView.findViewById(R.id.stacklabel_a);
final StackLabel stack2 = contentView.findViewById(R.id.stacklabel_b);
View reset = contentView.findViewById(R.id.tv_reset);
View sure = contentView.findViewById(R.id.tv_sure);
final GridViewAdapter adapter = new GridViewAdapter(xueLiList, getActivity());
gridOne.setAdapter(adapter);
final GridViewAdapter adapter1 = new GridViewAdapter(jingYanList, getActivity());
gridTwo.setAdapter(adapter1);
final GridViewAdapter adapter2 = new GridViewAdapter(zhiYeList, getActivity());
gridThree.setAdapter(adapter2);
TextView title_one = contentView.findViewById(R.id.title_one);
TextView title_two = contentView.findViewById(R.id.title_two);
title_one.setText("公司性质");
title_two.setText("团队规模");
adapter.setClickPosition(yqBean.getSelectA());
adapter1.setClickPosition(yqBean.getSelectB());
adapter2.setClickPosition(yqBean.getSelectC());
stack1.setLabels(gsA);
stack2.setLabels(gsB);
gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter.setClickPosition(position);
adapter.notifyDataSetChanged();
requestBody.setEducation(xueLiList.get(position).getPropId());
yqBean.setSelectA(position);
}
});
stack1.setSelectMode(true, gs_one);
stack2.setSelectMode(true, gs_two);
gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
stack1.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter1.setClickPosition(position);
adapter1.notifyDataSetChanged();
requestBody.setExprience(jingYanList.get(position).getPropId());
yqBean.setSelectB(position);
public void onClick(int index, View v, String s) {
if (gs_one.size() > 1) {
gs_one.remove(1);
}
gs_one.remove(0);
gs_one.add(gsA.get(index));
stack1.setSelectMode(true, gs_one);
gs_one.add(index + "");
Log.e("gs_one", gs_one.toString());
}
});
gridThree.setOnItemClickListener(new AdapterView.OnItemClickListener() {
stack2.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter2.setClickPosition(position);
adapter2.notifyDataSetChanged();
requestBody.setJobNature(zhiYeList.get(position).getPropId());
yqBean.setSelectC(position);
public void onClick(int index, View v, String s) {
if (gs_two.size() > 1) {
gs_two.remove(1);
}
gs_two.remove(0);
gs_two.add(gsB.get(index));
stack2.setSelectMode(true, gs_two);
gs_two.add(index + "");
Log.e("gs_two", gs_two.toString());
}
});
final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom());
final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCompany.getBottom());
popupWindow.setOutsideTouchable(true);
popupWindow.setTouchable(true);
popupWindow.setFocusable(true);
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
popupWindow.showAsDropDown(linRequire);
popupWindow.showAsDropDown(linCompany);
reset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
// reset.setTextColor(getResources().getColor(R.color.color_ffffff));
// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
yqBean.setSelectA(0);
yqBean.setSelectB(0);
yqBean.setSelectC(0);
adapter.setClickPosition(0);
adapter.notifyDataSetChanged();
adapter1.setClickPosition(0);
adapter1.notifyDataSetChanged();
adapter2.setClickPosition(0);
adapter2.notifyDataSetChanged();
requestBody.setEducation(null);
requestBody.setExprience(null);
requestBody.setJobNature(null);
if (gs_one.size() > 0) {
gs_one.remove(0);
}
gs_one.add(gsA.get(0));
stack1.setSelectMode(true, gs_one);
if (gs_two.size() > 0) {
gs_two.remove(0);
}
gs_two.add(gsB.get(0));
stack2.setSelectMode(true, gs_two);
}
});
sure.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
chageAlpha(1f);
// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
// sure.setTextColor(getResources().getColor(R.color.color_ffffff));
// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
if (gs_one.size() > 0) {
if (!gs_one.get(0).equals("不限")) {
requestBody.setCompanyNature(xingzhiList.get(Integer.valueOf(gs_one.get(1))).getPropId());
} else {
requestBody.setCompanyNature(null);
}
} else {
requestBody.setCompanyNature(null);
}
if (gs_two.size() > 0) {
if (!gs_two.get(0).equals("不限")) {
requestBody.setCompanySize(guiMoList.get(Integer.valueOf(gs_two.get(1))).getPropId());
} else {
requestBody.setCompanySize(null);
}
} else {
requestBody.setCompanySize(null);
}
doRequset(requestBody);
popupWindow.dismiss();
}
});
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
chageAlpha(1f);
}
});
}
//职位->公司弹窗
private void showCompanyPop(final List<AddressBean.PropListBean> xingzhiList, final List<AddressBean.PropListBean> guiMoList) {
/* 要求 */
private void showDrop3(final List<String> yqA, final List<String> yqB, final List<String> yqC) {
View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_require, null);
final StackLabel stack1 = contentView.findViewById(R.id.stack_req_a);
final StackLabel stack2 = contentView.findViewById(R.id.stack_req_b);
final StackLabel stack3 = contentView.findViewById(R.id.stack_req_c);
View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
TextView textOne = (TextView) contentView.findViewById(R.id.title_one);
TextView texttwo = (TextView) contentView.findViewById(R.id.title_two);
GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
textOne.setText("公司性质");
texttwo.setText("团队规模");
final GridViewAdapter adapter = new GridViewAdapter(xingzhiList, getActivity());
gridOne.setAdapter(adapter);
final GridViewAdapter adapter1 = new GridViewAdapter(guiMoList, getActivity());
gridTwo.setAdapter(adapter1);
stack1.setLabels(yqA);
stack2.setLabels(yqB);
stack3.setLabels(yqC);
adapter.setClickPosition(companyBean.getSelectA());
adapter1.setClickPosition(companyBean.getSelectB());
stack1.setSelectMode(true, yq_one);
stack2.setSelectMode(true, yq_two);
stack3.setSelectMode(true, yq_three);
gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
stack1.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter.setClickPosition(position);
adapter.notifyDataSetChanged();
requestBody.setCompanyNature(xingzhiList.get(position).getPropId());
companyBean.setSelectA(position);
public void onClick(int index, View v, String s) {
if (yq_one.size() > 1) {
yq_one.remove(1);
}
yq_one.remove(0);
yq_one.add(yqA.get(index));
stack1.setSelectMode(true, yq_one);
yq_one.add(index + "");
Log.e("yq_one", yq_one.toString());
}
});
gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
stack2.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter1.setClickPosition(position);
adapter1.notifyDataSetChanged();
requestBody.setCompanySize(guiMoList.get(position).getPropId());
public void onClick(int index, View v, String s) {
if (yq_two.size() > 1) {
yq_two.remove(1);
}
yq_two.remove(0);
yq_two.add(yqB.get(index));
stack2.setSelectMode(true, yq_two);
yq_two.add(index + "");
Log.e("yq_two", yq_two.toString());
}
});
companyBean.setSelectB(position);
stack3.setOnLabelClickListener(new OnLabelClickListener() {
@Override
public void onClick(int index, View v, String s) {
if (yq_three.size() > 1) {
yq_three.remove(1);
}
yq_three.remove(0);
yq_three.add(yqC.get(index));
stack3.setSelectMode(true, yq_three);
yq_three.add(index + "");
Log.e("yq_three", yq_three.toString());
}
});
final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCompany.getBottom());
final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom());
popupWindow.setOutsideTouchable(true);
popupWindow.setTouchable(true);
popupWindow.setFocusable(true);
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
popupWindow.showAsDropDown(linCompany);
popupWindow.showAsDropDown(linRequire);
reset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
// reset.setTextColor(getResources().getColor(R.color.color_ffffff));
// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
companyBean.setSelectA(0);
companyBean.setSelectB(0);
if (yq_one.size() > 0) {
yq_one.remove(0);
}
yq_one.add(gsA.get(0));
stack1.setSelectMode(true, yq_one);
adapter.setClickPosition(0);
adapter.notifyDataSetChanged();
adapter1.setClickPosition(0);
adapter1.notifyDataSetChanged();
if (yq_two.size() > 0) {
yq_two.remove(0);
}
yq_two.add(gsB.get(0));
stack2.setSelectMode(true, yq_two);
requestBody.setCompanyNature(null);
requestBody.setCompanySize(null);
if (yq_three.size() > 0) {
yq_three.remove(0);
}
yq_three.add(gsB.get(0));
stack3.setSelectMode(true, yq_three);
}
});
sure.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
chageAlpha(1f);
// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
// sure.setTextColor(getResources().getColor(R.color.color_ffffff));
// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
if (yq_one.size() > 0) {
if (!yq_one.get(0).equals("不限")) {
requestBody.setEducation(xueLiList.get(Integer.valueOf(yq_one.get(1))).getPropId());
} else {
requestBody.setEducation(null);
}
} else {
requestBody.setEducation(null);
}
if (yq_two.size() > 0) {
if (!yq_two.get(0).equals("不限")) {
requestBody.setExprience(jingYanList.get(Integer.valueOf(yq_two.get(1))).getPropId());
} else {
requestBody.setExprience(null);
}
} else {
requestBody.setExprience(null);
}
if (yq_three.size() > 0) {
if (!yq_three.get(0).equals("不限")) {
requestBody.setJobNature(zhiYeList.get(Integer.valueOf(yq_three.get(1))).getPropId());
} else {
requestBody.setJobNature(null);
}
} else {
requestBody.setJobNature(null);
}
doRequset(requestBody);
popupWindow.dismiss();
}
});
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
chageAlpha(1f);
}
});
}
//职位->城市弹窗
... ... @@ -624,20 +697,24 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
listOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
requestBody.setProvinceId(provinceList.get(position).getProvOid());
if (position == 0) {
proviceId = provinceList.get(1).getProvOid();
listTwo.setVisibility(View.INVISIBLE);
cityBean.setSelectB(0);
requestBody.setProvinceId(null); // 不限
requestBody.setCityIdId(null); // 不限
} else if (cityBean.getSelectA() == position && cityBean.getSelectA() != 0) {
listTwo.setVisibility(View.VISIBLE);
popCityListAdapter.change(cityBean.getSelectB());
cityBean.setSelectB(cityBean.getSelectB());
requestBody.setProvinceId(provinceList.get(position).getProvOid());
} else {
proviceId = provinceList.get(position).getProvOid();
listTwo.setVisibility(View.VISIBLE);
popCityListAdapter.change(0);
requestBody.setProvinceId(provinceList.get(position).getProvOid());
}
// model.getModel(activity, 7, 2, proviceId, String.valueOf(true));
... ... @@ -652,11 +729,13 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
requestBody.setCityIdId(cityList.get(position).getCityId());
if(position == 0){
requestBody.setCityIdId(null);
}else {
requestBody.setCityIdId(cityList.get(position).getCityId());
}
popCityListAdapter.change(position); // 改
cityBean.setSelectB(position);
}
});
... ... @@ -692,20 +771,425 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
@Override
public void onClick(View v) {
popupWindow.dismiss();
chageAlpha(1f);
Log.e("requestBody",requestBody.toString());
doRequset(requestBody);
}
});
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
chageAlpha(1f);
}
});
}
// 数据返回
private void doRequset(JobSearchBody body) {
Log.e("zhangtao:request", body.toString());
Log.e("zhangtao", "=================================================");
MyServer myServer = HttpUtils.getInstance().getServer(NetConfig.zhaopinUrl);
myServer.JobSearch(body)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
@Override
public void onNext(Object value) {
super.onNext(value);
HotJobBean hotJobBean = (HotJobBean) value;
List<HotJobBean.JobListBean> jobListBeans = hotJobBean.getJobList();
jobList.clear();
jobList.addAll(jobListBeans);
jobHuntWorkAdapter.notifyDataSetChanged();
}
@Override
public void onError(Throwable e) {
super.onError(e);
}
@Override
public void onComplete() {
super.onComplete();
}
});
}
// private void showRequirePop(final List<AddressBean.PropListBean> xueLiList, final List<AddressBean.PropListBean> jingYanList, final List<AddressBean.PropListBean> zhiYeList) {
//
// View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_require, null);
// GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
// GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
// GridView gridThree = (GridView) contentView.findViewById(R.id.grid_three);
// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
//
// final GridViewAdapter adapter = new GridViewAdapter(xueLiList, getActivity());
// gridOne.setAdapter(adapter);
// final GridViewAdapter adapter1 = new GridViewAdapter(jingYanList, getActivity());
// gridTwo.setAdapter(adapter1);
// final GridViewAdapter adapter2 = new GridViewAdapter(zhiYeList, getActivity());
// gridThree.setAdapter(adapter2);
//
// adapter.setClickPosition(yqBean.getSelectA());
// adapter1.setClickPosition(yqBean.getSelectB());
// adapter2.setClickPosition(yqBean.getSelectC());
//
// gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter.setClickPosition(position);
// adapter.notifyDataSetChanged();
// requestBody.setEducation(xueLiList.get(position).getPropId());
// yqBean.setSelectA(position);
// }
// });
//
// gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter1.setClickPosition(position);
// adapter1.notifyDataSetChanged();
// requestBody.setExprience(jingYanList.get(position).getPropId());
// yqBean.setSelectB(position);
// }
// });
//
// gridThree.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter2.setClickPosition(position);
// adapter2.notifyDataSetChanged();
// requestBody.setJobNature(zhiYeList.get(position).getPropId());
// yqBean.setSelectC(position);
// }
// });
//
// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom());
// popupWindow.setOutsideTouchable(true);
// popupWindow.setTouchable(true);
// popupWindow.setFocusable(true);
// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
// popupWindow.showAsDropDown(linRequire);
//
// reset.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// yqBean.setSelectA(0);
// yqBean.setSelectB(0);
// yqBean.setSelectC(0);
//
// adapter.setClickPosition(0);
// adapter.notifyDataSetChanged();
// adapter1.setClickPosition(0);
// adapter1.notifyDataSetChanged();
// adapter2.setClickPosition(0);
// adapter2.notifyDataSetChanged();
//
// requestBody.setEducation(null);
// requestBody.setExprience(null);
// requestBody.setJobNature(null);
// }
// });
// sure.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// popupWindow.dismiss();
// chageAlpha(1f);
// doRequset(requestBody);
// }
// });
//
// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
// @Override
// public void onDismiss() {
// chageAlpha(1f);
// }
// });
// }
//职位->公司弹窗
// private void showCompanyPop(final List<AddressBean.PropListBean> xingzhiList, final List<AddressBean.PropListBean> guiMoList) {
//
// View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
// TextView textOne = (TextView) contentView.findViewById(R.id.title_one);
// TextView texttwo = (TextView) contentView.findViewById(R.id.title_two);
// GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
// GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
//
// textOne.setText("公司性质");
// texttwo.setText("团队规模");
//
// final GridViewAdapter adapter = new GridViewAdapter(xingzhiList, getActivity());
// gridOne.setAdapter(adapter);
// final GridViewAdapter adapter1 = new GridViewAdapter(guiMoList, getActivity());
// gridTwo.setAdapter(adapter1);
//
// adapter.setClickPosition(companyBean.getSelectA());
// adapter1.setClickPosition(companyBean.getSelectB());
//
// gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter.setClickPosition(position);
// adapter.notifyDataSetChanged();
// requestBody.setCompanyNature(xingzhiList.get(position).getPropId());
//
// companyBean.setSelectA(position);
// }
// });
//
// gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter1.setClickPosition(position);
// adapter1.notifyDataSetChanged();
// requestBody.setCompanySize(guiMoList.get(position).getPropId());
//
// companyBean.setSelectB(position);
// }
// });
//
// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCompany.getBottom());
// popupWindow.setOutsideTouchable(true);
// popupWindow.setTouchable(true);
// popupWindow.setFocusable(true);
// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
// popupWindow.showAsDropDown(linCompany);
//
// reset.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
//// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
//// reset.setTextColor(getResources().getColor(R.color.color_ffffff));
//// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
//// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
//
// companyBean.setSelectA(0);
// companyBean.setSelectB(0);
//
// adapter.setClickPosition(0);
// adapter.notifyDataSetChanged();
// adapter1.setClickPosition(0);
// adapter1.notifyDataSetChanged();
//
// requestBody.setCompanyNature(null);
// requestBody.setCompanySize(null);
// }
// });
// sure.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// popupWindow.dismiss();
// chageAlpha(1f);
//// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
//// sure.setTextColor(getResources().getColor(R.color.color_ffffff));
//// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
//// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
//
// doRequset(requestBody);
// }
// });
//
// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
// @Override
// public void onDismiss() {
// chageAlpha(1f);
// }
// });
// }
//职位->类别弹窗
// private void showCategoryPop(final List<AddressBean.PropListBean> propList, final List<AddressBean.PropListBean> zhinengList) {
//
// View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_category, null);
// GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
// GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
//
// final GridViewAdapter adapter = new GridViewAdapter(propList, getActivity());
// gridOne.setAdapter(adapter);
// adapter.setClickPosition(lbBean.getSelectA());
//
// final GridViewAdapter adapter1 = new GridViewAdapter(zhinengList, getActivity());
// gridTwo.setAdapter(adapter1);
// adapter1.setClickPosition(lbBean.getSelectB());
//
// gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter.setClickPosition(position);
// adapter.notifyDataSetChanged();
// requestBody.setCompanyIndustry(propList.get(position).getPropId());
//
// lbBean.setSelectA(position);
// }
// });
//
//
// gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter1.setClickPosition(position);
// adapter1.notifyDataSetChanged();
// requestBody.setJobFunction(zhinengList.get(position).getPropId());
//
// lbBean.setSelectB(position);
// }
// });
//
// final PopupWindow popupWindow = new PopupWindow(contentView, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linCategory.getBottom());
// popupWindow.setOutsideTouchable(true);
// popupWindow.setTouchable(true);
// popupWindow.setFocusable(true);
// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
// popupWindow.showAsDropDown(linCategory);
//
// reset.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
//// reset.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
//// reset.setTextColor(getResources().getColor(R.color.color_ffffff));
//// sure.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
//// sure.setTextColor(getResources().getColor(R.color.color_6f6f6f));
//
// lbBean.setSelectA(0);
// lbBean.setSelectB(0);
//
// adapter.setClickPosition(0);
// adapter.notifyDataSetChanged();
// adapter1.setClickPosition(0);
// adapter1.notifyDataSetChanged();
//
// requestBody.setCompanyIndustry(null);
// requestBody.setJobFunction(null);
// }
// });
// sure.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// popupWindow.dismiss();
// chageAlpha(1f);
//// sure.setBackgroundColor(getResources().getColor(R.color.color_ff5400));
//// sure.setTextColor(getResources().getColor(R.color.color_ffffff));
//// reset.setBackgroundColor(getResources().getColor(R.color.color_ffffff));
//// reset.setTextColor(getResources().getColor(R.color.color_6f6f6f));
//
// doRequset(requestBody);
// }
// });
//
// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
// @Override
// public void onDismiss() {
// chageAlpha(1f);
// }
// });
//
// }
//职位->要求弹窗
// private void showRequirePop(final List<AddressBean.PropListBean> xueLiList, final List<AddressBean.PropListBean> jingYanList, final List<AddressBean.PropListBean> zhiYeList) {
//
// View contentView = LayoutInflater.from(getActivity()).inflate(R.layout.pop_require, null);
// GridView gridOne = (GridView) contentView.findViewById(R.id.grid_one);
// GridView gridTwo = (GridView) contentView.findViewById(R.id.grid_two);
// GridView gridThree = (GridView) contentView.findViewById(R.id.grid_three);
// final TextView sure = (TextView) contentView.findViewById(R.id.tv_sure);
// final TextView reset = (TextView) contentView.findViewById(R.id.tv_reset);
//
// final GridViewAdapter adapter = new GridViewAdapter(xueLiList, getActivity());
// gridOne.setAdapter(adapter);
// final GridViewAdapter adapter1 = new GridViewAdapter(jingYanList, getActivity());
// gridTwo.setAdapter(adapter1);
// final GridViewAdapter adapter2 = new GridViewAdapter(zhiYeList, getActivity());
// gridThree.setAdapter(adapter2);
//
// adapter.setClickPosition(yqBean.getSelectA());
// adapter1.setClickPosition(yqBean.getSelectB());
// adapter2.setClickPosition(yqBean.getSelectC());
//
// gridOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter.setClickPosition(position);
// adapter.notifyDataSetChanged();
// requestBody.setEducation(xueLiList.get(position).getPropId());
// yqBean.setSelectA(position);
// }
// });
//
// gridTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter1.setClickPosition(position);
// adapter1.notifyDataSetChanged();
// requestBody.setExprience(jingYanList.get(position).getPropId());
// yqBean.setSelectB(position);
// }
// });
//
// gridThree.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// adapter2.setClickPosition(position);
// adapter2.notifyDataSetChanged();
// requestBody.setJobNature(zhiYeList.get(position).getPropId());
// yqBean.setSelectC(position);
// }
// });
//
// final PopupWindow popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT - linRequire.getBottom());
// popupWindow.setOutsideTouchable(true);
// popupWindow.setTouchable(true);
// popupWindow.setFocusable(true);
// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
// popupWindow.showAsDropDown(linRequire);
//
// reset.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// yqBean.setSelectA(0);
// yqBean.setSelectB(0);
// yqBean.setSelectC(0);
//
// adapter.setClickPosition(0);
// adapter.notifyDataSetChanged();
// adapter1.setClickPosition(0);
// adapter1.notifyDataSetChanged();
// adapter2.setClickPosition(0);
// adapter2.notifyDataSetChanged();
//
// requestBody.setEducation(null);
// requestBody.setExprience(null);
// requestBody.setJobNature(null);
// }
// });
// sure.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// popupWindow.dismiss();
// chageAlpha(1f);
// doRequset(requestBody);
// }
// });
//
// popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
// @Override
// public void onDismiss() {
// chageAlpha(1f);
// }
// });
// }
private void chageAlpha(float color) {
WindowManager.LayoutParams lp = getActivity().getWindow().getAttributes();
lp.alpha = color;
... ...
package com.hh.xuetubao.stacklabel;
import android.view.View;
public interface OnLabelClickListener {
void onClick(int index, View v, String s);
}
... ...
package com.hh.xuetubao.stacklabel;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.hh.xuetubao.R;
import java.util.ArrayList;
import java.util.List;
public class StackLabel extends ViewGroup {
private int textColor = 0;
private int textSize = 0;
private int paddingVertical = 0;
private int paddingHorizontal = 0;
private int itemMargin = 0;
private int itemMarginVertical = 0;
private int itemMarginHorizontal = 0;
private int maxLines = 0;
private boolean deleteButton = false;
private int deleteButtonImage = -1;
private int labelBackground = -1;
private boolean selectMode = false;
private int selectBackground = -1;
private int selectTextColor = -1;
private int maxSelectNum = 0;
private int minSelectNum = 0;
private OnLabelClickListener onLabelClickListener;
private Context context;
private List<String> labels;
private String loadLabelsArray;
public StackLabel(Context context) {
super(context);
this.context = context;
}
public StackLabel(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
loadAttrs(context, attrs);
}
public StackLabel(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.context = context;
loadAttrs(context, attrs);
}
private void loadAttrs(Context context, AttributeSet attrs) {
try {
//默认值
textColor = Color.argb(230, 0, 0, 0);
textSize = dp2px(12);
paddingVertical = dp2px(8);
paddingHorizontal = dp2px(12);
itemMargin = dp2px(4);
deleteButton = false;
//加载值
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.StackLabel);
textColor = typedArray.getColor(R.styleable.StackLabel_textColor, textColor);
textSize = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_textSize, textSize);
paddingVertical = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_paddingVertical, paddingVertical);
paddingHorizontal = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_paddingHorizontal, paddingHorizontal);
itemMargin = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_itemMargin, itemMargin);
itemMarginVertical = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_itemMarginVertical, itemMarginVertical);
itemMarginHorizontal = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_itemMarginHorizontal, itemMarginHorizontal);
deleteButton = typedArray.getBoolean(R.styleable.StackLabel_deleteButton, deleteButton);
deleteButtonImage = typedArray.getResourceId(R.styleable.StackLabel_deleteButtonImage, deleteButtonImage);
labelBackground = typedArray.getResourceId(R.styleable.StackLabel_labelBackground, labelBackground);
selectMode = typedArray.getBoolean(R.styleable.StackLabel_selectMode, selectMode);
selectBackground = typedArray.getResourceId(R.styleable.StackLabel_selectBackground, selectBackground);
selectTextColor = typedArray.getColor(R.styleable.StackLabel_selectTextColor, selectTextColor);
maxSelectNum = typedArray.getInt(R.styleable.StackLabel_maxSelectNum, maxSelectNum);
minSelectNum = typedArray.getInt(R.styleable.StackLabel_minSelectNum, minSelectNum);
maxLines = typedArray.getInt(R.styleable.StackLabel_maxLines, minSelectNum);
if (minSelectNum > maxSelectNum && maxSelectNum != 0) minSelectNum = 0;
loadLabelsArray = typedArray.getString(R.styleable.StackLabel_labels);
if (selectBackground == -1) selectBackground = R.drawable.rect_label_bkg_select_normal;
if (labelBackground == -1) labelBackground = R.drawable.rect_normal_label_button;
typedArray.recycle();
} catch (Exception e) {
}
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (loadLabelsArray != null && !loadLabelsArray.isEmpty()) {
if (loadLabelsArray.contains(",")) {
setLabels(loadLabelsArray.split(","));
} else {
addLabel(loadLabelsArray);
}
}
}
private int dp2px(float dpValue) {
return (int) (0.5f + dpValue * Resources.getSystem().getDisplayMetrics().density);
}
private float px2dp(int pxValue) {
return (pxValue / Resources.getSystem().getDisplayMetrics().density);
}
private List<View> items;
private int newHeight = 0;
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
refreshViews();
setMeasuredDimension(getMeasuredWidth(), newHeight);//设置宽高
}
private void refreshViews() {
int maxWidth = getMeasuredWidth();
if (labels != null && !labels.isEmpty()) {
newHeight = 0;
if (items != null && !items.isEmpty()) {
int l = 0, t = 0, r = 0, b = 0, lines = 0;
for (int i = 0; i < items.size(); i++) {
View item = items.get(i);
int mWidth = MeasureSpec.makeMeasureSpec(maxWidth, MeasureSpec.AT_MOST); //AT_MOST:先按照最大宽度计算,如果小于则按实际值,如果大于,按最大宽度
int mHeight = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); //UNSPECIFIED:不确定,根据实际情况计算
item.measure(mWidth, mHeight);
int childWidth = item.getMeasuredWidth();
int childHeight = item.getMeasuredHeight();
if ((l + childWidth) > maxWidth) {
l = 0;
t = t + childHeight;
lines++;
}
if (maxLines > 0 && lines >= maxLines) {
item.setVisibility(GONE);
} else {
r = l + childWidth;
if (childWidth > maxWidth) {
r = maxWidth;
}
b = t + childHeight;
item.layout(l, t, r, b);
l = l + childWidth;
newHeight = t + childHeight;
}
}
}
}
}
public List<String> getLabels() {
return labels;
}
public StackLabel setLabels(List<String> l) {
labels = l;
reloadViews();
return this;
}
public boolean remove(int index) {
if (labels == null) {
return false;
}
labels.remove(index);
reloadViews();
return true;
}
public boolean remove(String label) {
if (labels == null) {
return false;
}
boolean flag = labels.remove(label);
reloadViews();
return flag;
}
public StackLabel setLabels(String[] arrays) {
labels = new ArrayList<>();
for (String s : arrays) {
labels.add(s);
}
reloadViews();
return this;
}
public boolean isHave(String label) {
if (labels == null) {
return false;
}
return labels.contains(label);
}
public int count() {
if (labels == null) {
return 0;
} else {
return labels.size();
}
}
public void reloadViews() {
removeAllViews();
items = new ArrayList<>();
if (labels != null && !labels.isEmpty()) {
for (int i = 0; i < labels.size(); i++) {
View item = LayoutInflater.from(context).inflate(R.layout.layout_label, null, false);
addView(item);
items.add(item);
}
initItem();
}
}
public StackLabel addLabel(String label) {
if (labels == null) labels = new ArrayList<>();
labels.add(label);
reloadViews();
return this;
}
private List<Integer> selectIndexs = new ArrayList<>();
private void initItem() {
if (labels.size() != 0) {
selectIndexs = new ArrayList<>();
for (int i = 0; i < items.size(); i++) {
View item = items.get(i);
String s = labels.get(i);
LinearLayout boxLabel = item.findViewById(R.id.box_label);
TextView txtLabel = item.findViewById(R.id.txt_label);
ImageView imgDelete = item.findViewById(R.id.img_delete);
txtLabel.setText(s);
txtLabel.setTextColor(textColor);
txtLabel.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
boxLabel.setPadding(paddingHorizontal, paddingVertical, paddingHorizontal, paddingVertical);
MarginLayoutParams p = (MarginLayoutParams) boxLabel.getLayoutParams();
if (itemMarginHorizontal == 0 && itemMarginVertical == 0) {
p.setMargins(itemMargin, itemMargin, itemMargin, itemMargin);
} else {
p.setMargins(itemMarginHorizontal, itemMarginVertical, itemMarginHorizontal, itemMarginVertical);
}
boxLabel.requestLayout();
if (deleteButton) {
imgDelete.setVisibility(VISIBLE);
} else {
imgDelete.setVisibility(GONE);
}
if (deleteButtonImage != -1) imgDelete.setImageResource(deleteButtonImage);
boxLabel.setBackgroundResource(labelBackground);
final int index = i;
boxLabel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (selectMode) {
for (View item : items) {
LinearLayout boxLabel = item.findViewById(R.id.box_label);
TextView txtLabel = item.findViewById(R.id.txt_label);
boxLabel.setBackgroundResource(labelBackground);
txtLabel.setTextColor(textColor);
txtLabel.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
}
if (selectIndexs.contains(index)) {
if (selectIndexs.size() > minSelectNum) {
int ind = 0;
for (int i = 0; i < selectIndexs.size(); i++) {
if (selectIndexs.get(i) == index) {
ind = i;
break;
}
}
selectIndexs.remove(ind);
}
} else {
if (maxSelectNum == 1) selectIndexs.clear();
if (maxSelectNum <= 0 || (maxSelectNum > 0 && selectIndexs.size() < maxSelectNum)) {
selectIndexs.add(index);
}
}
for (int index : selectIndexs) {
View item = items.get(index);
LinearLayout boxLabel = item.findViewById(R.id.box_label);
TextView txtLabel = item.findViewById(R.id.txt_label);
boxLabel.setBackgroundResource(selectBackground);
txtLabel.setTextColor(selectTextColor);
}
}
if (onLabelClickListener != null)
onLabelClickListener.onClick(index, v, labels.get(index));
}
});
if (whichIsSelected != null) {
for (String selectStr : whichIsSelected) {
if (s.equals(selectStr)) {
selectIndexs.add(index);
boxLabel.setBackgroundResource(selectBackground);
txtLabel.setTextColor(selectTextColor);
}
}
}
}
whichIsSelected = null;
}
}
public OnLabelClickListener getOnLabelClickListener() {
return onLabelClickListener;
}
public StackLabel setOnLabelClickListener(OnLabelClickListener onLabelClickListener) {
this.onLabelClickListener = onLabelClickListener;
return this;
}
public boolean isDeleteButton() {
return deleteButton;
}
public StackLabel setDeleteButton(boolean deleteButton) {
this.deleteButton = deleteButton;
initItem();
return this;
}
public boolean isSelectMode() {
return selectMode;
}
public StackLabel setSelectMode(boolean selectMode) {
this.selectMode = selectMode;
setLabels(labels);
return this;
}
private List<String> whichIsSelected; //初始化已选择列表
public StackLabel setSelectMode(boolean selectMode, List<String> whichIsSelected) {
this.selectMode = selectMode;
if (selectMode) {
this.whichIsSelected = whichIsSelected;
} else {
whichIsSelected = null;
}
setLabels(labels);
return this;
}
public int getSelectBackground() {
return selectBackground;
}
public StackLabel setSelectBackground(int selectBackground) {
this.selectBackground = selectBackground;
setLabels(labels);
return this;
}
public int getSelectTextColor() {
return selectTextColor;
}
public StackLabel setSelectTextColor(int selectTextColor) {
this.selectTextColor = selectTextColor;
return this;
}
public int getMaxSelectNum() {
return maxSelectNum;
}
public StackLabel setMaxSelectNum(int maxSelectNum) {
this.maxSelectNum = maxSelectNum;
setLabels(labels);
return this;
}
public List<Integer> getSelectIndexList() {
return selectIndexs;
}
public int[] getSelectIndexArray() {
int[] arrays = new int[selectIndexs.size()];
for (int i = 0; i < selectIndexs.size(); i++) {
arrays[i] = selectIndexs.get(i);
}
return arrays;
}
public int getTextColor() {
return textColor;
}
public StackLabel setTextColor(int textColor) {
this.textColor = textColor;
setLabels(labels);
return this;
}
public int getTextSize() {
return textSize;
}
public StackLabel setTextSize(int textSize) {
this.textSize = textSize;
setLabels(labels);
return this;
}
public int getPaddingVertical() {
return paddingVertical;
}
public StackLabel setPaddingVertical(int paddingVertical) {
this.paddingVertical = paddingVertical;
setLabels(labels);
return this;
}
public int getPaddingHorizontal() {
return paddingHorizontal;
}
public StackLabel setPaddingHorizontal(int paddingHorizontal) {
this.paddingHorizontal = paddingHorizontal;
setLabels(labels);
return this;
}
public int getItemMargin() {
return itemMargin;
}
public StackLabel setItemMargin(int itemMargin) {
this.itemMargin = itemMargin;
setLabels(labels);
return this;
}
public int getItemMarginVertical() {
return itemMarginVertical;
}
public StackLabel setItemMarginVertical(int itemMarginVertical) {
this.itemMarginVertical = itemMarginVertical;
setLabels(labels);
return this;
}
public int getItemMarginHorizontal() {
return itemMarginHorizontal;
}
public StackLabel setItemMarginHorizontal(int itemMarginHorizontal) {
this.itemMarginHorizontal = itemMarginHorizontal;
setLabels(labels);
return this;
}
public int getMaxLines() {
return maxLines;
}
public StackLabel setMaxLines(int maxLines) {
this.maxLines = maxLines;
return this;
}
private void log(Object s) {
Log.i(">>>", s.toString());
}
}
... ...
package com.hh.xuetubao.stacklabel;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.hh.xuetubao.R;
import java.util.ArrayList;
import java.util.List;
public class StackLayout extends ViewGroup {
private Context context;
private int itemMargin = 0;
public StackLayout(Context context) {
super(context);
this.context = context;
}
public StackLayout(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
loadAttrs(context, attrs);
}
public StackLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.context = context;
loadAttrs(context, attrs);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
}
private void loadAttrs(Context context, AttributeSet attrs) {
try {
//默认值
itemMargin = dp2px(4);
//加载值
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.StackLabel);
itemMargin = typedArray.getDimensionPixelOffset(R.styleable.StackLabel_itemMargin, itemMargin);
typedArray.recycle();
} catch (Exception e) {
}
}
private List<View> items;
private int newHeight = 0;
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
refreshViews();
setMeasuredDimension(getMeasuredWidth(), newHeight);//设置宽高
}
private void refreshViews() {
int maxWidth = getMeasuredWidth();
items = new ArrayList<>();
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child.getVisibility() == VISIBLE) {
items.add(getChildAt(i));
}
}
newHeight = 0;
if (items != null && !items.isEmpty()) {
int l = 0, t = 0, r = 0, b = 0;
for (int i = 0; i < items.size(); i++) {
View item = items.get(i);
int mWidth = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); //AT_MOST:先按照最大宽度计算,如果小于则按实际值,如果大于,按最大宽度
int mHeight = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); //UNSPECIFIED:不确定,根据实际情况计算
item.measure(mWidth, mHeight);
int childWidth = item.getMeasuredWidth();
int childHeight = item.getMeasuredHeight();
if ((l + childWidth) > maxWidth) {
l = 0;
t = t + childHeight + itemMargin;
}
r = l + childWidth ;
if (childWidth > maxWidth) {
r = maxWidth;
}
b = t + childHeight;
item.layout(l, t, r, b);
l = l + childWidth + itemMargin;
newHeight = t + childHeight;
}
}
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
}
private int dp2px(float dpValue) {
return (int) (0.5f + dpValue * Resources.getSystem().getDisplayMetrics().density);
}
}
... ...
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充颜色 -->
<solid android:color="#ff5400"></solid>
<!-- 矩形的圆角半径 -->
<corners android:radius="@dimen/dp_5" />
</shape>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充颜色 -->
<stroke android:width="@dimen/dp_1" android:color="#bebebe"/>
<solid android:color="#ffffff"></solid>
<!-- 矩形的圆角半径 -->
<corners android:radius="@dimen/dp_5" />
</shape>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充颜色 -->
<solid android:color="#ff5400"></solid>
<!-- 矩形的圆角半径 -->
<corners android:radius="@dimen/dp_5" />
</shape>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充颜色 -->
<solid android:color="#ff5400"></solid>
<!-- 矩形的圆角半径 -->
<corners android:radius="@dimen/dp_5" />
</shape>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/rect_label_bkg_press" android:state_pressed="true" />
<item android:drawable="@drawable/rect_label_bkg_check" android:state_checked="true" />
<item android:drawable="@drawable/rect_label_bkg_normal" />
</selector>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/box_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rect_normal_label_button"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp">
<TextView
android:id="@+id/txt_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:singleLine="true"
android:text=""
android:textColor="#dc000000"
android:textSize="12dp" />
<ImageView
android:id="@+id/img_delete"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginLeft="2dp"
android:layout_marginTop="0dp"
android:layout_marginRight="-3dp"
android:padding="2dp"
android:src="@mipmap/img_delete"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:background="#ffffff"
>
<LinearLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/color_ffffff"
>
android:layout_height="@dimen/dp_370">
<TextView
android:id="@+id/title_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="行业领域"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<GridView
android:id="@+id/grid_one"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:horizontalSpacing="@dimen/dp_20"
android:numColumns="4"
android:scrollbars="none"
android:verticalSpacing="@dimen/dp_15" />
android:background="@color/color_ffffff"
android:orientation="vertical">
<TextView
android:id="@+id/title_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:text="岗位职能"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<GridView
android:id="@+id/grid_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_20"
android:horizontalSpacing="@dimen/dp_20"
android:numColumns="4"
android:scrollbars="none"
android:verticalSpacing="@dimen/dp_15" />
<TextView
android:id="@+id/title_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="行业领域"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="#D6D6D6" />
<!--<GridView-->
<!--android:id="@+id/grid_one"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginLeft="@dimen/dp_20"-->
<!--android:layout_marginRight="@dimen/dp_20"-->
<!--android:layout_marginTop="@dimen/dp_15"-->
<!--android:horizontalSpacing="@dimen/dp_20"-->
<!--android:numColumns="4"-->
<!--android:scrollbars="none"-->
<!--android:verticalSpacing="@dimen/dp_15" />-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_45"
android:orientation="horizontal">
<com.hh.xuetubao.stacklabel.StackLabel
android:id="@+id/stacklabel_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20"
app:deleteButton="false"
app:deleteButtonImage="@mipmap/img_delete"
app:itemMargin="@dimen/dp_5"
app:maxSelectNum="1"
app:paddingVertical="@dimen/dp_5"
app:selectMode="true"
app:selectTextColor="#ffffff"
app:textColor="#6c6c6c"
app:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tv_reset"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="重置"
android:textColor="#6F6F6F"
android:textSize="16sp" />
android:id="@+id/title_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:text="岗位职能"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<com.hh.xuetubao.stacklabel.StackLabel
android:id="@+id/stacklabel_b"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20"
app:deleteButton="false"
app:deleteButtonImage="@mipmap/img_delete"
app:itemMargin="@dimen/dp_5"
app:maxSelectNum="1"
app:paddingVertical="@dimen/dp_5"
app:selectMode="true"
app:selectTextColor="#ffffff"
app:textColor="#6c6c6c"
app:textSize="@dimen/sp_14" />
<!--<GridView-->
<!--android:id="@+id/grid_two"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginLeft="@dimen/dp_20"-->
<!--android:layout_marginRight="@dimen/dp_20"-->
<!--android:layout_marginTop="@dimen/dp_15"-->
<!--android:layout_marginBottom="@dimen/dp_20"-->
<!--android:horizontalSpacing="@dimen/dp_20"-->
<!--android:numColumns="4"-->
<!--android:scrollbars="none"-->
<!--android:verticalSpacing="@dimen/dp_15" />-->
<View
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:background="#D6D6D6" />
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20"
/>
<TextView
android:id="@+id/tv_sure"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/color_ff5400"
android:gravity="center"
android:text="确定"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
</ScrollView>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="#D6D6D6" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_45"
android:orientation="horizontal"
android:background="#ffffff"
>
<TextView
android:id="@+id/tv_reset"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="重置"
android:textColor="#6F6F6F"
android:textSize="16sp" />
<View
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:background="#D6D6D6" />
<TextView
android:id="@+id/tv_sure"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/color_ff5400"
android:gravity="center"
android:text="确定"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#FFFFFF"
>
android:layout_height="@dimen/dp_370">
<TextView
android:id="@+id/title_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="学历要求"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<GridView
android:id="@+id/grid_one"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:horizontalSpacing="@dimen/dp_20"
android:numColumns="4"
android:scrollbars="none"
android:verticalSpacing="@dimen/dp_15" />
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/title_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:text="经验"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<GridView
android:id="@+id/grid_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:horizontalSpacing="@dimen/dp_20"
android:numColumns="4"
android:scrollbars="none"
android:verticalSpacing="@dimen/dp_15" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:orientation="vertical">
<TextView
android:id="@+id/title_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:text="职业类型"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<GridView
android:id="@+id/grid_three"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_20"
android:horizontalSpacing="@dimen/dp_20"
android:numColumns="4"
android:scrollbars="none"
android:verticalSpacing="@dimen/dp_15" />
<TextView
android:id="@+id/title_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="学历要求"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="#D6D6D6" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_45"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_reset"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="重置"
android:textColor="#6F6F6F"
android:textSize="16sp" />
<com.hh.xuetubao.stacklabel.StackLabel
android:id="@+id/stack_req_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20"
app:deleteButton="false"
app:deleteButtonImage="@mipmap/img_delete"
app:itemMargin="@dimen/dp_5"
app:maxSelectNum="1"
app:paddingVertical="@dimen/dp_5"
app:selectMode="true"
app:selectTextColor="#ffffff"
app:textColor="#6c6c6c"
app:textSize="@dimen/sp_14" />
<!--<GridView-->
<!--android:id="@+id/grid_one"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginLeft="@dimen/dp_20"-->
<!--android:layout_marginTop="@dimen/dp_15"-->
<!--android:layout_marginRight="@dimen/dp_20"-->
<!--android:horizontalSpacing="@dimen/dp_20"-->
<!--android:numColumns="4"-->
<!--android:scrollbars="none"-->
<!--android:verticalSpacing="@dimen/dp_15" />-->
<TextView
android:id="@+id/title_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:text="经验"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<com.hh.xuetubao.stacklabel.StackLabel
android:id="@+id/stack_req_b"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20"
app:deleteButton="false"
app:deleteButtonImage="@mipmap/img_delete"
app:itemMargin="@dimen/dp_5"
app:maxSelectNum="1"
app:paddingVertical="@dimen/dp_5"
app:selectMode="true"
app:selectTextColor="#ffffff"
app:textColor="#6c6c6c"
app:textSize="@dimen/sp_14" />
<!--<GridView-->
<!--android:id="@+id/grid_two"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginLeft="@dimen/dp_20"-->
<!--android:layout_marginTop="@dimen/dp_15"-->
<!--android:layout_marginRight="@dimen/dp_20"-->
<!--android:horizontalSpacing="@dimen/dp_20"-->
<!--android:numColumns="4"-->
<!--android:scrollbars="none"-->
<!--android:verticalSpacing="@dimen/dp_15" />-->
<TextView
android:id="@+id/title_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:text="职业类型"
android:textColor="#6C6C6C"
android:textSize="12sp" />
<com.hh.xuetubao.stacklabel.StackLabel
android:id="@+id/stack_req_c"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20"
app:deleteButton="false"
app:deleteButtonImage="@mipmap/img_delete"
app:itemMargin="@dimen/dp_5"
app:maxSelectNum="1"
app:paddingVertical="@dimen/dp_5"
app:selectMode="true"
app:selectTextColor="#ffffff"
app:textColor="#6c6c6c"
app:textSize="@dimen/sp_14" />
<!--<GridView-->
<!--android:id="@+id/grid_three"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginLeft="@dimen/dp_20"-->
<!--android:layout_marginTop="@dimen/dp_15"-->
<!--android:layout_marginBottom="@dimen/dp_20"-->
<!--android:horizontalSpacing="@dimen/dp_20"-->
<!--android:numColumns="4"-->
<!--android:scrollbars="none"-->
<!--android:verticalSpacing="@dimen/dp_15" />-->
</LinearLayout>
<View
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:background="#D6D6D6" />
<TextView
android:id="@+id/tv_sure"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="确定"
android:textColor="#6F6F6F"
android:textSize="16sp" />
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20"
android:background="#ffffff" />
</LinearLayout>
</ScrollView>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="#D6D6D6" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_45"
android:background="#ffffff"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_reset"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="重置"
android:textColor="#6F6F6F"
android:textSize="16sp" />
<View
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:background="#D6D6D6" />
<TextView
android:id="@+id/tv_sure"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/color_ff5400"
android:gravity="center"
android:text="确定"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
... ...
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="StackLabel">
<attr name="textColor" format="color" />
<attr name="textSize" format="dimension"/>
<attr name="paddingVertical" format="dimension"/>
<attr name="paddingHorizontal" format="dimension"/>
<attr name="itemMargin" format="dimension"/>
<attr name="itemMarginVertical" format="dimension"/>
<attr name="itemMarginHorizontal" format="dimension"/>
<attr name="deleteButton" format="boolean" />
<attr name="deleteButtonImage" format="reference" />
<attr name="labelBackground" format="reference" />
<attr name="selectMode" format="boolean" />
<attr name="selectBackground" format="reference" />
<attr name="selectTextColor" format="color" />
<attr name="maxSelectNum" format="integer" />
<attr name="minSelectNum" format="integer" />
<attr name="maxLines" format="integer" />
<attr name="labels" format="string" />
</declare-styleable>
</resources>
\ No newline at end of file
... ...