|
@@ -2,7 +2,6 @@ package com.xzjmyk.pm.activity.ui.erp.activity.oa;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
-import android.graphics.drawable.BitmapDrawable;
|
|
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
import android.support.v4.view.ViewPager;
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
@@ -192,6 +191,8 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
private TextView oamain_more_menu_hd_tv;
|
|
private TextView oamain_more_menu_hd_tv;
|
|
|
private TextView mWorkReport;
|
|
private TextView mWorkReport;
|
|
|
boolean isPlatform = ApiUtils.getApiModel() instanceof ApiPlatform;
|
|
boolean isPlatform = ApiUtils.getApiModel() instanceof ApiPlatform;
|
|
|
|
|
+ private View otherEmptyView;
|
|
|
|
|
+ private View meEmptyEView;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
@@ -435,7 +436,10 @@ 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);
|
|
|
- emptyLayout.setEmptyViewRes(R.layout.oa_empty_list);
|
|
|
|
|
|
|
+ ViewGroup view= (ViewGroup) LayoutInflater.from(ct).inflate(R.layout.oa_empty_list,null);
|
|
|
|
|
+ otherEmptyView = view.findViewById(R.id.otherView);
|
|
|
|
|
+ meEmptyEView = view.findViewById(R.id.meView);
|
|
|
|
|
+ emptyLayout.setEmptyView(view);
|
|
|
adapter = new OAAdapter(ct, util, new ArrayList<OAModel>());
|
|
adapter = new OAAdapter(ct, util, new ArrayList<OAModel>());
|
|
|
oa_listview.setAdapter(adapter);
|
|
oa_listview.setAdapter(adapter);
|
|
|
curDate = new Date(System.currentTimeMillis());
|
|
curDate = new Date(System.currentTimeMillis());
|
|
@@ -741,11 +745,21 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
setAdapterBeans(isMe ? meModels : otherModels);
|
|
setAdapterBeans(isMe ? meModels : otherModels);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void showEmpty(){
|
|
|
|
|
+ if (isMe){
|
|
|
|
|
+ meEmptyEView.setVisibility(View.VISIBLE);
|
|
|
|
|
+ otherEmptyView.setVisibility(View.GONE);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ meEmptyEView.setVisibility(View.GONE);
|
|
|
|
|
+ otherEmptyView.setVisibility(View.VISIBLE);
|
|
|
|
|
+ }
|
|
|
|
|
+ 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);
|
|
|
adapter.notifyDataSetChanged();
|
|
adapter.notifyDataSetChanged();
|
|
|
- emptyLayout.showEmpty();
|
|
|
|
|
|
|
+ showEmpty();
|
|
|
CommonUtil.textSpanForStyle(all_task_num, getString(R.string.work_calender) + " " + 0, 0 + "", getResources().getColor(R.color.approval_select_tab));
|
|
CommonUtil.textSpanForStyle(all_task_num, getString(R.string.work_calender) + " " + 0, 0 + "", getResources().getColor(R.color.approval_select_tab));
|
|
|
CommonUtil.textSpanForStyle(ok_task_num, getString(R.string.done) + " " + 0, 0 + "", getResources().getColor(R.color.approval_select_tab));
|
|
CommonUtil.textSpanForStyle(ok_task_num, getString(R.string.done) + " " + 0, 0 + "", getResources().getColor(R.color.approval_select_tab));
|
|
|
CommonUtil.textSpanForStyle(uok_task_num, getString(R.string.undone) + " " + 0, 0 + "", getResources().getColor(R.color.approval_select_tab));
|
|
CommonUtil.textSpanForStyle(uok_task_num, getString(R.string.undone) + " " + 0, 0 + "", getResources().getColor(R.color.approval_select_tab));
|
|
@@ -761,8 +775,9 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
ok++;
|
|
ok++;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (ListUtils.isEmpty(filterModels))
|
|
|
|
|
- emptyLayout.showEmpty();
|
|
|
|
|
|
|
+ if (ListUtils.isEmpty(filterModels)){
|
|
|
|
|
+ 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));
|
|
|
CommonUtil.textSpanForStyle(ok_task_num, getString(R.string.done) + " " + ok, ok + "", getResources().getColor(R.color.approval_select_tab));
|
|
CommonUtil.textSpanForStyle(ok_task_num, getString(R.string.done) + " " + ok, ok + "", getResources().getColor(R.color.approval_select_tab));
|
|
|
CommonUtil.textSpanForStyle(uok_task_num, getString(R.string.undone) + " " + (size - ok), (size - ok) + "", getResources().getColor(R.color.approval_select_tab));
|
|
CommonUtil.textSpanForStyle(uok_task_num, getString(R.string.undone) + " " + (size - ok), (size - ok) + "", getResources().getColor(R.color.approval_select_tab));
|
|
@@ -785,7 +800,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 = (ListView) 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);
|
|
@@ -825,8 +840,11 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
startActivityForResult(intent, 0x20);
|
|
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);
|
|
popupWindow.setFocusable(true);
|
|
|
// 设置允许在外点击消失
|
|
// 设置允许在外点击消失
|
|
@@ -837,12 +855,12 @@ public class OAActivity extends SupportToolBarActivity implements View.OnClickLi
|
|
|
DisplayUtil.backgroundAlpha(OAActivity.this, 1f);
|
|
DisplayUtil.backgroundAlpha(OAActivity.this, 1f);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- DisplayUtil.backgroundAlpha(this, 1f);
|
|
|
|
|
|
|
+ DisplayUtil.backgroundAlpha(this, 0.5f);
|
|
|
// 这个是为了点击“返回Back”也能使其消失,并且并不会影响你的背景
|
|
// 这个是为了点击“返回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的高度的一半
|
|
|
- popupWindow.showAsDropDown(parent, windowManager.getDefaultDisplay().getWidth(), 0);
|
|
|
|
|
|
|
+ popupWindow.showAsDropDown(parent, windowManager.getDefaultDisplay().getWidth()-DisplayUtil.dip2px(ct,10), 0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private List<Map<String, Object>> getPopData() {
|
|
private List<Map<String, Object>> getPopData() {
|