Commit f9a1cad3 by chengxiuhong

test main

parent f140af3e
......@@ -90,6 +90,7 @@ public class MorePeopleTestActivity extends BaseActivity {
private boolean isAll = true;//是否是全部学校
private List<PopuBean> mAreaList = new ArrayList<>();
private List<PopuBean> mClassList = new ArrayList<>();
private PopupWindow mPopupWindow;
@Override
protected int getLayoutId() {
......@@ -282,12 +283,12 @@ public class MorePeopleTestActivity extends BaseActivity {
}
try {
View conview = View.inflate(this, R.layout.popu_list, null);
PopupWindow popupWindow = new PopupWindow(conview, RelativeLayout.LayoutParams.WRAP_CONTENT,
mPopupWindow = new PopupWindow(conview, RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
popupWindow.setFocusable(true);
popupWindow.setOutsideTouchable(true);
mPopupWindow.setFocusable(true);
mPopupWindow.setOutsideTouchable(true);
ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明
popupWindow.setBackgroundDrawable(cd);
mPopupWindow.setBackgroundDrawable(cd);
ListView listView = (ListView) conview.findViewById(R.id.list_view);
mPopuAdapter = new PopuAdapter(this, popuBeans);
listView.setAdapter(mPopuAdapter);
......@@ -296,11 +297,12 @@ public class MorePeopleTestActivity extends BaseActivity {
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
conview.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int xoff = -(conview.getMeasuredWidth() / 2 - view.getWidth() / 2);
popupWindow.showAsDropDown(view, xoff, 0);
mPopupWindow.showAsDropDown(view, xoff, 0);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
itemClick(position);
mPopupWindow.dismiss();
}
});
} catch (Exception e) {
......
......@@ -65,6 +65,7 @@ public class SinglePeopleTestActivity extends BaseActivity {
private SchoolBean mSchoolBean;
private PopuAdapter mPopuAdapter;
private List<PopuBean> mAreaList = new ArrayList<>();
private PopupWindow mPopupWindow;
@Override
protected int getLayoutId() {
......@@ -161,12 +162,12 @@ public class SinglePeopleTestActivity extends BaseActivity {
private void showPopWindow(final List<PopuBean> popuBeans) {
try {
View conview = View.inflate(this, R.layout.popu_list, null);
PopupWindow popupWindow = new PopupWindow(conview, RelativeLayout.LayoutParams.WRAP_CONTENT,
mPopupWindow = new PopupWindow(conview, RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
popupWindow.setFocusable(true);
popupWindow.setOutsideTouchable(true);
mPopupWindow.setFocusable(true);
mPopupWindow.setOutsideTouchable(true);
ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明
popupWindow.setBackgroundDrawable(cd);
mPopupWindow.setBackgroundDrawable(cd);
ListView listView = (ListView) conview.findViewById(R.id.list_view);
mPopuAdapter = new PopuAdapter(this, popuBeans);
listView.setAdapter(mPopuAdapter);
......@@ -175,10 +176,11 @@ public class SinglePeopleTestActivity extends BaseActivity {
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
conview.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int xoff = -(conview.getMeasuredWidth() / 2 - mSeleteAreaLay.getWidth() / 2);
popupWindow.showAsDropDown(mSeleteAreaLay, xoff, 0);
mPopupWindow.showAsDropDown(mSeleteAreaLay, xoff, 0);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
mPopupWindow.dismiss();
for (PopuBean popuBean : popuBeans) {
popuBean.setChick(false);
}
......
......@@ -103,6 +103,7 @@ public class TestResurtListActivity extends BaseActivity {
private PopuAdapter mPopuAdapter;
private int popuPosition;//1学校,2小组
private SchoolBean mSchoolBean;
private PopupWindow mPopupWindow;
@Override
protected int getLayoutId() {
......@@ -320,12 +321,12 @@ public class TestResurtListActivity extends BaseActivity {
}
try {
View conview = View.inflate(this, R.layout.popu_list, null);
PopupWindow popupWindow = new PopupWindow(conview, RelativeLayout.LayoutParams.WRAP_CONTENT,
mPopupWindow = new PopupWindow(conview, RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
popupWindow.setFocusable(true);
popupWindow.setOutsideTouchable(true);
mPopupWindow.setFocusable(true);
mPopupWindow.setOutsideTouchable(true);
ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明
popupWindow.setBackgroundDrawable(cd);
mPopupWindow.setBackgroundDrawable(cd);
ListView listView = (ListView) conview.findViewById(R.id.list_view);
mPopuAdapter = new PopuAdapter(this, popuBeans);
listView.setAdapter(mPopuAdapter);
......@@ -334,11 +335,12 @@ public class TestResurtListActivity extends BaseActivity {
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
conview.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int xoff = -(conview.getMeasuredWidth() / 2 - view.getWidth() / 2);
popupWindow.showAsDropDown(view, xoff, 0);
mPopupWindow.showAsDropDown(view, xoff, 0);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
itemClick(position);
mPopupWindow.dismiss();
}
});
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment