|
|
@@ -18,8 +18,6 @@ import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.BaseAdapter;
|
|
|
-import android.widget.CompoundButton;
|
|
|
-import android.widget.DatePicker;
|
|
|
import android.widget.EditText;
|
|
|
import android.widget.Filter;
|
|
|
import android.widget.Filterable;
|
|
|
@@ -51,7 +49,6 @@ import com.xzjmyk.pm.activity.ui.erp.util.LogUtil;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.StringUtils;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.view.EmptyLayout;
|
|
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.HashMap;
|
|
|
@@ -611,6 +608,8 @@ public class FormListSelectActivity extends BaseActivity implements View.OnClick
|
|
|
if (i == cList.size() - 1) {
|
|
|
// l.height = CommonUtil.dip2px(ct, 30);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
// 创建两个TextView
|
|
|
TextView tView = new TextView(ct);
|
|
|
tView.setId(i + 1);
|
|
|
@@ -621,15 +620,18 @@ public class FormListSelectActivity extends BaseActivity implements View.OnClick
|
|
|
|
|
|
tView.setWidth(CommonUtil.dip2px(ct, 90));
|
|
|
tView.setMaxWidth(CommonUtil.dip2px(ct, 100));
|
|
|
+ tView.getPaint().setFakeBoldText(true);//加粗
|
|
|
tv.leftMargin = 10;
|
|
|
tv.rightMargin = 10;
|
|
|
tv.topMargin = 7;
|
|
|
tv.bottomMargin = 7;
|
|
|
tView.setTextSize(16);
|
|
|
tView.setGravity(Gravity.RIGHT);
|
|
|
- tView.setText(map.get("caption").toString() + ":");
|
|
|
+ tView.setText(map.get("caption").toString() + "");
|
|
|
tView.setLayoutParams(tv);
|
|
|
rLayout.addView(tView);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
TextView mView = new TextView(ct);
|
|
|
RelativeLayout.LayoutParams mv = new RelativeLayout.LayoutParams(
|
|
|
@@ -642,6 +644,7 @@ public class FormListSelectActivity extends BaseActivity implements View.OnClick
|
|
|
mv.topMargin = 8;
|
|
|
mv.bottomMargin = 8;
|
|
|
mView.setTextSize(16);
|
|
|
+ mView.setTextColor(mContext.getResources().getColor(R.color.light_gray));
|
|
|
// mView.setText();
|
|
|
mView.setLayoutParams(mv);
|
|
|
tViews[1][i] = mView;
|
|
|
@@ -667,11 +670,9 @@ public class FormListSelectActivity extends BaseActivity implements View.OnClick
|
|
|
} else {
|
|
|
tViews = (TextView[][]) convertView.getTag();
|
|
|
}
|
|
|
- if (position % 2 == 0) {
|
|
|
- convertView.setBackgroundColor(ct.getResources().getColor(R.color.item_color1));
|
|
|
- } else {
|
|
|
- convertView.setBackgroundColor(ct.getResources().getColor(R.color.item_color2));
|
|
|
- }
|
|
|
+
|
|
|
+ convertView.setBackgroundColor(ct.getResources().getColor(R.color.item_color2));
|
|
|
+
|
|
|
for (int j = 0; j < cList.size(); j++) {
|
|
|
map = (HashMap<String, Object>) cList.get(j);
|
|
|
// if ((Integer)map.get("width")==0)continue;
|
|
|
@@ -763,187 +764,133 @@ public class FormListSelectActivity extends BaseActivity implements View.OnClick
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- public void clearRightMenuStatus() {
|
|
|
- for (int i = 0; i < rdata.size(); i++) {
|
|
|
- @SuppressWarnings("rawtypes")
|
|
|
- Iterator iter = rdata.get(i).entrySet().iterator();
|
|
|
- while (iter.hasNext()) {
|
|
|
- @SuppressWarnings("rawtypes")
|
|
|
- Map.Entry entry = (Map.Entry) iter.next();
|
|
|
- String key = (String) entry.getKey();
|
|
|
- if (key.equals("selected")) {
|
|
|
- entry.setValue("所有");
|
|
|
- }
|
|
|
- if (key.equals("value")) {
|
|
|
- entry.setValue(null);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (radapter != null) {
|
|
|
- radapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public class CheckedChangeEvent implements CompoundButton.OnCheckedChangeListener {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onCheckedChanged(CompoundButton buttonView,
|
|
|
- boolean isChecked) {
|
|
|
- switch (buttonView.getId()) {
|
|
|
-// case R.id.cb_remember_condition:
|
|
|
-// isCheckedRightMenu(isChecked);
|
|
|
-// break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+// public void clearRightMenuStatus() {
|
|
|
+// for (int i = 0; i < rdata.size(); i++) {
|
|
|
+// @SuppressWarnings("rawtypes")
|
|
|
+// Iterator iter = rdata.get(i).entrySet().iterator();
|
|
|
+// while (iter.hasNext()) {
|
|
|
+// @SuppressWarnings("rawtypes")
|
|
|
+// Map.Entry entry = (Map.Entry) iter.next();
|
|
|
+// String key = (String) entry.getKey();
|
|
|
+// if (key.equals("selected")) {
|
|
|
+// entry.setValue("所有");
|
|
|
+// }
|
|
|
+// if (key.equals("value")) {
|
|
|
+// entry.setValue(null);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (radapter != null) {
|
|
|
+// radapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- }
|
|
|
+// public class CheckedChangeEvent implements CompoundButton.OnCheckedChangeListener {
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onCheckedChanged(CompoundButton buttonView,
|
|
|
+// boolean isChecked) {
|
|
|
+// switch (buttonView.getId()) {
|
|
|
+//// case R.id.cb_remember_condition:
|
|
|
+//// isCheckedRightMenu(isChecked);
|
|
|
+//// break;
|
|
|
+// default:
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @注释:日期选择监听
|
|
|
*/
|
|
|
- DatePickerDialog.OnDateSetListener DateSet = new DatePickerDialog.OnDateSetListener() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onDateSet(DatePicker view, int year, int monthOfYear,
|
|
|
- int dayOfMonth) {
|
|
|
- // 每次保存设置的日期
|
|
|
- calendar.set(Calendar.YEAR, year);
|
|
|
- calendar.set(Calendar.MONTH, monthOfYear);
|
|
|
- calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
|
|
|
- String date = new SimpleDateFormat("yyyy-MM-dd").format(calendar
|
|
|
- .getTime());
|
|
|
- // String str = year + "-" + (monthOfYear + 1) + "-" + dayOfMonth;
|
|
|
- // ViewUtil.ToastMessage(getApplicationContext(), str+":"+date);
|
|
|
- for (int i = 0; i < rdata.size(); i++) {
|
|
|
- if (rdata.get(i).get("type").equals("condatefield")) {
|
|
|
- rdata.get(i).put("selected", date);
|
|
|
- rdata.get(i).put("value", date);
|
|
|
- }
|
|
|
- }
|
|
|
- radapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
- public String getConditionForMap() {
|
|
|
- StringBuffer sBuffer = new StringBuffer();
|
|
|
- int size = 0;
|
|
|
- for (int j = 0; j < rdata.size(); j++) {
|
|
|
- if (rdata.get(j).get("value") != null) {
|
|
|
- if (!rdata.get(j).get("value").equals("所有")) {
|
|
|
- size++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- int count = 0;
|
|
|
- for (int i = 0; i < rdata.size(); i++) {
|
|
|
- if (!"所有".equals(rdata.get(i).get("value"))
|
|
|
- && rdata.get(i).get("value") != null) {
|
|
|
- /** @注释:想想为什么用size=count来判断是否属于最后一项 */
|
|
|
- count++;
|
|
|
- if (size == count) {
|
|
|
- if (rdata.get(i).get("type").equals("condatefield")) {
|
|
|
- /** @注释:日期格式 外面没有单引号 */
|
|
|
- sBuffer.append("to_char(" + rdata.get(i).get("dbfield")
|
|
|
- + ",'yyyy-mm-dd') =");
|
|
|
- sBuffer.append("'" + rdata.get(i).get("value") + "'");
|
|
|
- } else {
|
|
|
- sBuffer.append(rdata.get(i).get("dbfield") + "=");
|
|
|
- sBuffer.append("'" + rdata.get(i).get("value") + "'");
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- if (rdata.get(i).get("type").equals("condatefield")) {
|
|
|
- /** @注释:日期格式 外面没有单引号 */
|
|
|
- sBuffer.append("to_char(" + rdata.get(i).get("dbfield")
|
|
|
- + ",'yyyy-mm-dd') =");
|
|
|
- sBuffer.append("'" + rdata.get(i).get("value") + "'"
|
|
|
- + " and ");
|
|
|
- } else {
|
|
|
- sBuffer.append(rdata.get(i).get("dbfield") + "=");
|
|
|
- sBuffer.append("'" + rdata.get(i).get("value") + "'"
|
|
|
- + " and ");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- System.out.println("筛选字段:" + sBuffer.toString());
|
|
|
- return sBuffer.toString();
|
|
|
- }
|
|
|
-
|
|
|
- public Map<String, Object> getConditionKeyMap() {
|
|
|
- Map<String, Object> vMap = new HashMap<String, Object>();
|
|
|
- for (int i = 0; i < rdata.size(); i++) {
|
|
|
- if (!"所有".equals(rdata.get(i).get("value"))
|
|
|
- && rdata.get(i).get("value") != null) {
|
|
|
- /** @注释:想想为什么用size=count来判断是否属于最后一项 */
|
|
|
- vMap.put(rdata.get(i).get("dbfield").toString(), rdata.get(i)
|
|
|
- .get("value"));
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- return vMap;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @author LiuJie
|
|
|
- * @功能:根据Map集合值,恢复右边菜单
|
|
|
- */
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- public void initRightMenuStatus(Map<String, Object> kValue) {
|
|
|
- @SuppressWarnings("rawtypes")
|
|
|
- Iterator iter0 = kValue.entrySet().iterator();
|
|
|
- while (iter0.hasNext()) {
|
|
|
- @SuppressWarnings("rawtypes")
|
|
|
- Map.Entry entry0 = (Map.Entry) iter0.next();
|
|
|
- String keyFeild = entry0.getKey().toString();
|
|
|
- String valueFeild = entry0.getValue().toString();
|
|
|
- for (int i = 0; i < rdata.size(); i++) {
|
|
|
- String dbfield = (String) rdata.get(i).get("dbfield");
|
|
|
- if (dbfield.endsWith(keyFeild)) {
|
|
|
- @SuppressWarnings("rawtypes")
|
|
|
- Iterator iter = rdata.get(i).entrySet().iterator();
|
|
|
- while (iter.hasNext()) {
|
|
|
- @SuppressWarnings("rawtypes")
|
|
|
- Map.Entry entry = (Map.Entry) iter.next();
|
|
|
- String key = (String) entry.getKey();
|
|
|
- @SuppressWarnings("unused")
|
|
|
- String val = (String) entry.getValue();
|
|
|
- /** @注释:索引值 */
|
|
|
- if (key.equals("value")) {
|
|
|
- entry.setValue(valueFeild);
|
|
|
- }
|
|
|
- /** @注释:页面显示 */
|
|
|
- if (key.equals("selected")) {
|
|
|
- entry.setValue(valueFeild);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (radapter != null) {
|
|
|
- radapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @注释:获取筛选条件数据
|
|
|
- */
|
|
|
- public class GetConditionThread implements Runnable {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- getConditionData();
|
|
|
- }
|
|
|
- }
|
|
|
+// DatePickerDialog.OnDateSetListener DateSet = new DatePickerDialog.OnDateSetListener() {
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onDateSet(DatePicker view, int year, int monthOfYear,
|
|
|
+// int dayOfMonth) {
|
|
|
+// // 每次保存设置的日期
|
|
|
+// calendar.set(Calendar.YEAR, year);
|
|
|
+// calendar.set(Calendar.MONTH, monthOfYear);
|
|
|
+// calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
|
|
|
+// String date = new SimpleDateFormat("yyyy-MM-dd").format(calendar
|
|
|
+// .getTime());
|
|
|
+// // String str = year + "-" + (monthOfYear + 1) + "-" + dayOfMonth;
|
|
|
+// // ViewUtil.ToastMessage(getApplicationContext(), str+":"+date);
|
|
|
+// for (int i = 0; i < rdata.size(); i++) {
|
|
|
+// if (rdata.get(i).get("type").equals("condatefield")) {
|
|
|
+// rdata.get(i).put("selected", date);
|
|
|
+// rdata.get(i).put("value", date);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// radapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+//
|
|
|
+// };
|
|
|
+
|
|
|
+// public String getConditionForMap() {
|
|
|
+// StringBuffer sBuffer = new StringBuffer();
|
|
|
+// int size = 0;
|
|
|
+// for (int j = 0; j < rdata.size(); j++) {
|
|
|
+// if (rdata.get(j).get("value") != null) {
|
|
|
+// if (!rdata.get(j).get("value").equals("所有")) {
|
|
|
+// size++;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// int count = 0;
|
|
|
+// for (int i = 0; i < rdata.size(); i++) {
|
|
|
+// if (!"所有".equals(rdata.get(i).get("value"))
|
|
|
+// && rdata.get(i).get("value") != null) {
|
|
|
+// /** @注释:想想为什么用size=count来判断是否属于最后一项 */
|
|
|
+// count++;
|
|
|
+// if (size == count) {
|
|
|
+// if (rdata.get(i).get("type").equals("condatefield")) {
|
|
|
+// /** @注释:日期格式 外面没有单引号 */
|
|
|
+// sBuffer.append("to_char(" + rdata.get(i).get("dbfield")
|
|
|
+// + ",'yyyy-mm-dd') =");
|
|
|
+// sBuffer.append("'" + rdata.get(i).get("value") + "'");
|
|
|
+// } else {
|
|
|
+// sBuffer.append(rdata.get(i).get("dbfield") + "=");
|
|
|
+// sBuffer.append("'" + rdata.get(i).get("value") + "'");
|
|
|
+// }
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// if (rdata.get(i).get("type").equals("condatefield")) {
|
|
|
+// /** @注释:日期格式 外面没有单引号 */
|
|
|
+// sBuffer.append("to_char(" + rdata.get(i).get("dbfield")
|
|
|
+// + ",'yyyy-mm-dd') =");
|
|
|
+// sBuffer.append("'" + rdata.get(i).get("value") + "'"
|
|
|
+// + " and ");
|
|
|
+// } else {
|
|
|
+// sBuffer.append(rdata.get(i).get("dbfield") + "=");
|
|
|
+// sBuffer.append("'" + rdata.get(i).get("value") + "'"
|
|
|
+// + " and ");
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// System.out.println("筛选字段:" + sBuffer.toString());
|
|
|
+// return sBuffer.toString();
|
|
|
+// }
|
|
|
+//
|
|
|
+// public Map<String, Object> getConditionKeyMap() {
|
|
|
+// Map<String, Object> vMap = new HashMap<String, Object>();
|
|
|
+// for (int i = 0; i < rdata.size(); i++) {
|
|
|
+// if (!"所有".equals(rdata.get(i).get("value"))
|
|
|
+// && rdata.get(i).get("value") != null) {
|
|
|
+// /** @注释:想想为什么用size=count来判断是否属于最后一项 */
|
|
|
+// vMap.put(rdata.get(i).get("dbfield").toString(), rdata.get(i)
|
|
|
+// .get("value"));
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return vMap;
|
|
|
+// }
|
|
|
+//
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- public void getConditionData() {
|
|
|
- }
|
|
|
|
|
|
public class StateBroadcast extends BroadcastReceiver {
|
|
|
|
|
|
@@ -981,14 +928,4 @@ public class FormListSelectActivity extends BaseActivity implements View.OnClick
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// @Override
|
|
|
-// public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
-// if (keyCode == KeyEvent.KEYCODE_BACK) {
|
|
|
-// if (mDrawer.isMenuVisible()) {
|
|
|
-// mDrawer.closeMenu();
|
|
|
-// return true;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return super.onKeyDown(keyCode, event);
|
|
|
-// }
|
|
|
}
|