|
|
@@ -2,7 +2,6 @@ package com.xzjmyk.pm.activity.ui.erp.activity.oa;
|
|
|
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
-import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.view.LayoutInflater;
|
|
|
@@ -11,7 +10,6 @@ import android.view.MenuItem;
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewConfiguration;
|
|
|
-import android.view.ViewGroup;
|
|
|
import android.view.WindowManager;
|
|
|
import android.view.animation.Animation;
|
|
|
import android.view.animation.AnimationUtils;
|
|
|
@@ -785,7 +783,7 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
if (popupWindow == null) {
|
|
|
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
view = layoutInflater.inflate(R.layout.pop_crm_list, null);
|
|
|
- ListView plist = (ListView) view.findViewById(R.id.mList);
|
|
|
+ ListView plist = view.findViewById(R.id.mList);
|
|
|
SimpleAdapter adapter = new SimpleAdapter(ct, getPopData(),
|
|
|
R.layout.item_pop_list, new String[]{"item_name"}, new int[]{R.id.tv_item_name});
|
|
|
plist.setAdapter(adapter);
|
|
|
@@ -825,8 +823,11 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
startActivityForResult(intent, 0x20);
|
|
|
}
|
|
|
});
|
|
|
- popupWindow = new PopupWindow(view, windowManager.getDefaultDisplay().getWidth() / 3, windowManager.getDefaultDisplay().getHeight() / 3);
|
|
|
- }
|
|
|
+ popupWindow =new PopupWindow(view);
|
|
|
+// new PopupWindow(view, windowManager.getDefaultDisplay().getWidth() / 3, windowManager.getDefaultDisplay().getHeight() / 3);
|
|
|
+ popupWindow.setWidth(DisplayUtil.dip2px(ct,140));
|
|
|
+ popupWindow.setHeight(DisplayUtil.dip2px(ct,150));
|
|
|
+ }
|
|
|
// 使其聚集
|
|
|
popupWindow.setFocusable(true);
|
|
|
// 设置允许在外点击消失
|
|
|
@@ -837,12 +838,12 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
DisplayUtil.backgroundAlpha(OAActivity.this, 1f);
|
|
|
}
|
|
|
});
|
|
|
- DisplayUtil.backgroundAlpha(this, 1f);
|
|
|
+ DisplayUtil.backgroundAlpha(this, 0.5f);
|
|
|
// 这个是为了点击“返回Back”也能使其消失,并且并不会影响你的背景
|
|
|
- popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
- popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
|
+ popupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.top_bubble));
|
|
|
+// popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
|
// 显示的位置为:屏幕的宽度的一半-PopupWindow的高度的一半
|
|
|
- popupWindow.showAsDropDown(parent, windowManager.getDefaultDisplay().getWidth(), 0);
|
|
|
+ popupWindow.showAsDropDown(parent, windowManager.getDefaultDisplay().getWidth()-DisplayUtil.dip2px(ct,10), 0);
|
|
|
}
|
|
|
|
|
|
private List<Map<String, Object>> getPopData() {
|