|
@@ -316,6 +316,11 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
oa_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
oa_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
|
|
|
|
+ String master = CommonUtil.getMaster();
|
|
|
|
|
+ if ("DATACENTER".equals(master) || "N_SHYZ".equals(master) || "N_AJC".equals(master)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (adapter == null || ListUtils.isEmpty(adapter.getModels()) || adapter.getModels().size() <= i)
|
|
if (adapter == null || ListUtils.isEmpty(adapter.getModels()) || adapter.getModels().size() <= i)
|
|
|
return;
|
|
return;
|
|
|
OAModel e = adapter.getModels().get(i);
|
|
OAModel e = adapter.getModels().get(i);
|
|
@@ -436,7 +441,7 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
emptyLayout.setShowLoadingButton(false);
|
|
emptyLayout.setShowLoadingButton(false);
|
|
|
emptyLayout.setShowEmptyButton(false);
|
|
emptyLayout.setShowEmptyButton(false);
|
|
|
emptyLayout.setShowErrorButton(false);
|
|
emptyLayout.setShowErrorButton(false);
|
|
|
- ViewGroup view= (ViewGroup) LayoutInflater.from(ct).inflate(R.layout.oa_empty_list,null);
|
|
|
|
|
|
|
+ ViewGroup view = (ViewGroup) LayoutInflater.from(ct).inflate(R.layout.oa_empty_list, null);
|
|
|
otherEmptyView = view.findViewById(R.id.otherView);
|
|
otherEmptyView = view.findViewById(R.id.otherView);
|
|
|
meEmptyEView = view.findViewById(R.id.meView);
|
|
meEmptyEView = view.findViewById(R.id.meView);
|
|
|
emptyLayout.setEmptyView(view);
|
|
emptyLayout.setEmptyView(view);
|
|
@@ -745,16 +750,17 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
setAdapterBeans(isMe ? meModels : otherModels);
|
|
setAdapterBeans(isMe ? meModels : otherModels);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void showEmpty(){
|
|
|
|
|
- if (isMe){
|
|
|
|
|
|
|
+ private void showEmpty() {
|
|
|
|
|
+ if (isMe) {
|
|
|
meEmptyEView.setVisibility(View.VISIBLE);
|
|
meEmptyEView.setVisibility(View.VISIBLE);
|
|
|
otherEmptyView.setVisibility(View.GONE);
|
|
otherEmptyView.setVisibility(View.GONE);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
meEmptyEView.setVisibility(View.GONE);
|
|
meEmptyEView.setVisibility(View.GONE);
|
|
|
otherEmptyView.setVisibility(View.VISIBLE);
|
|
otherEmptyView.setVisibility(View.VISIBLE);
|
|
|
}
|
|
}
|
|
|
emptyLayout.showEmpty();
|
|
emptyLayout.showEmpty();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
private void setAdapterBeans(List<OAModel> showModel) {
|
|
private void setAdapterBeans(List<OAModel> showModel) {
|
|
|
if (ListUtils.isEmpty(showModel)) {
|
|
if (ListUtils.isEmpty(showModel)) {
|
|
|
adapter.setModels(showModel);
|
|
adapter.setModels(showModel);
|
|
@@ -775,7 +781,7 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
ok++;
|
|
ok++;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (ListUtils.isEmpty(filterModels)){
|
|
|
|
|
|
|
+ if (ListUtils.isEmpty(filterModels)) {
|
|
|
showEmpty();
|
|
showEmpty();
|
|
|
}
|
|
}
|
|
|
CommonUtil.textSpanForStyle(all_task_num, getString(R.string.work_calender) + " " + size, size + "", getResources().getColor(R.color.approval_select_tab));
|
|
CommonUtil.textSpanForStyle(all_task_num, getString(R.string.work_calender) + " " + size, size + "", getResources().getColor(R.color.approval_select_tab));
|
|
@@ -800,7 +806,7 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
if (popupWindow == null) {
|
|
if (popupWindow == null) {
|
|
|
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
view = layoutInflater.inflate(R.layout.pop_crm_list, null);
|
|
view = layoutInflater.inflate(R.layout.pop_crm_list, null);
|
|
|
- ListView plist = view.findViewById(R.id.mList);
|
|
|
|
|
|
|
+ ListView plist = view.findViewById(R.id.mList);
|
|
|
SimpleAdapter adapter = new SimpleAdapter(ct, getPopData(),
|
|
SimpleAdapter adapter = new SimpleAdapter(ct, getPopData(),
|
|
|
R.layout.item_pop_list, new String[]{"item_name"}, new int[]{R.id.tv_item_name});
|
|
R.layout.item_pop_list, new String[]{"item_name"}, new int[]{R.id.tv_item_name});
|
|
|
plist.setAdapter(adapter);
|
|
plist.setAdapter(adapter);
|
|
@@ -837,16 +843,16 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
.putExtra("title", name);
|
|
.putExtra("title", name);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- if (intent != null){
|
|
|
|
|
|
|
+ if (intent != null) {
|
|
|
startActivityForResult(intent, 0x20);
|
|
startActivityForResult(intent, 0x20);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- popupWindow =new PopupWindow(view);
|
|
|
|
|
|
|
+ popupWindow = new PopupWindow(view);
|
|
|
// new PopupWindow(view, windowManager.getDefaultDisplay().getWidth() / 3, windowManager.getDefaultDisplay().getHeight() / 3);
|
|
// new PopupWindow(view, windowManager.getDefaultDisplay().getWidth() / 3, windowManager.getDefaultDisplay().getHeight() / 3);
|
|
|
- popupWindow.setWidth(DisplayUtil.dip2px(ct,140));
|
|
|
|
|
- popupWindow.setHeight(DisplayUtil.dip2px(ct,135));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ popupWindow.setWidth(DisplayUtil.dip2px(ct, 140));
|
|
|
|
|
+ popupWindow.setHeight(DisplayUtil.dip2px(ct, 135));
|
|
|
|
|
+ }
|
|
|
// 使其聚集
|
|
// 使其聚集
|
|
|
popupWindow.setFocusable(true);
|
|
popupWindow.setFocusable(true);
|
|
|
// 设置允许在外点击消失
|
|
// 设置允许在外点击消失
|
|
@@ -862,7 +868,7 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.top_bubble));
|
|
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.top_bubble));
|
|
|
// popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
// popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
|
// 显示的位置为:屏幕的宽度的一半-PopupWindow的高度的一半
|
|
// 显示的位置为:屏幕的宽度的一半-PopupWindow的高度的一半
|
|
|
- popupWindow.showAsDropDown(parent, -DisplayUtil.dip2px(ct,50), 0);
|
|
|
|
|
|
|
+ popupWindow.showAsDropDown(parent, -DisplayUtil.dip2px(ct, 50), 0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private List<Map<String, Object>> getPopData() {
|
|
private List<Map<String, Object>> getPopData() {
|