|
@@ -9,6 +9,9 @@ import android.content.Intent;
|
|
|
import android.net.Uri;
|
|
import android.net.Uri;
|
|
|
import android.os.Build;
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
|
|
+import android.os.Handler;
|
|
|
|
|
+import android.text.Editable;
|
|
|
|
|
+import android.text.TextWatcher;
|
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
import android.view.Gravity;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
@@ -36,6 +39,7 @@ import com.xzjmyk.pm.activity.ui.erp.view.NScrollerGridView;
|
|
|
import com.xzjmyk.pm.activity.ui.tool.MultiImagePreviewActivity;
|
|
import com.xzjmyk.pm.activity.ui.tool.MultiImagePreviewActivity;
|
|
|
import com.xzjmyk.pm.activity.util.CameraUtil;
|
|
import com.xzjmyk.pm.activity.util.CameraUtil;
|
|
|
import com.xzjmyk.pm.activity.util.DisplayUtil;
|
|
import com.xzjmyk.pm.activity.util.DisplayUtil;
|
|
|
|
|
+import com.xzjmyk.pm.activity.util.StringUtils;
|
|
|
import com.xzjmyk.pm.activity.util.ToastUtil;
|
|
import com.xzjmyk.pm.activity.util.ToastUtil;
|
|
|
import com.xzjmyk.pm.activity.view.MyGridView;
|
|
import com.xzjmyk.pm.activity.view.MyGridView;
|
|
|
import com.xzjmyk.pm.activity.view.MyListView;
|
|
import com.xzjmyk.pm.activity.view.MyListView;
|
|
@@ -237,7 +241,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
detailsData.remove(selected_detailsData.get(i));
|
|
detailsData.remove(selected_detailsData.get(i));
|
|
|
if (i == (selected_detailsData.size()-1)){
|
|
if (i == (selected_detailsData.size()-1)){
|
|
|
dtAdapter.setTable_list_type(table_list_type);
|
|
dtAdapter.setTable_list_type(table_list_type);
|
|
|
-// dtAdapter.setTable_list_money(table_list_money);
|
|
|
|
|
|
|
+ dtAdapter.setTable_list_money(table_list_money);
|
|
|
dtAdapter.notifyDataSetChanged();
|
|
dtAdapter.notifyDataSetChanged();
|
|
|
detail_table_ll.setVisibility(View.VISIBLE);
|
|
detail_table_ll.setVisibility(View.VISIBLE);
|
|
|
Log.i("selected_detailsData",selected_detailsData.toString()+"se");
|
|
Log.i("selected_detailsData",selected_detailsData.toString()+"se");
|
|
@@ -382,9 +386,9 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
table_list_type.remove(position);
|
|
table_list_type.remove(position);
|
|
|
-// if (!ListUtils.isEmpty(table_list_money) && table_list_money.get(position) != null){
|
|
|
|
|
-// table_list_money.remove(position);
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ if (!ListUtils.isEmpty(table_list_money) && table_list_money.get(position) != null){
|
|
|
|
|
+ table_list_money.remove(position);
|
|
|
|
|
+ }
|
|
|
if (ListUtils.isEmpty(table_list_type)){
|
|
if (ListUtils.isEmpty(table_list_type)){
|
|
|
detail_table_ll.setVisibility(View.GONE);
|
|
detail_table_ll.setVisibility(View.GONE);
|
|
|
}else {
|
|
}else {
|
|
@@ -405,23 +409,35 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
}
|
|
|
}*/
|
|
}*/
|
|
|
|
|
|
|
|
-// viewHolder.details_money.addTextChangedListener(new TextWatcher() {
|
|
|
|
|
-// @Override
|
|
|
|
|
-// public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
|
|
|
|
-// @Override
|
|
|
|
|
-// public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
|
|
|
|
-// @Override
|
|
|
|
|
-// public void afterTextChanged(Editable s) {
|
|
|
|
|
-// if (StringUtils.isEmpty(s.toString())) return;
|
|
|
|
|
-// double numberstrChche = Double.parseDouble(s.toString());
|
|
|
|
|
-// if (table_list_money == null){
|
|
|
|
|
-// table_list_money.add(position, CommonUtil.getTwoPointDouble(numberstrChche));
|
|
|
|
|
-// }else {
|
|
|
|
|
-// table_list_money.remove(position);
|
|
|
|
|
-// table_list_money.add(position,CommonUtil.getTwoPointDouble(numberstrChche));
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// });
|
|
|
|
|
|
|
+ viewHolder.details_money.addTextChangedListener(new TextWatcher() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void afterTextChanged(Editable s) {
|
|
|
|
|
+ if (StringUtils.isEmpty(s.toString())) return;
|
|
|
|
|
+ double numberstrChche = Double.parseDouble(s.toString());
|
|
|
|
|
+ money_edit_position = position;
|
|
|
|
|
+ /*if (table_list_money == null ){
|
|
|
|
|
+ table_list_money.add(position, CommonUtil.getTwoPointDouble(numberstrChche));
|
|
|
|
|
+ }else if (table_list_money.get(position) == null){
|
|
|
|
|
+ table_list_money.add(position, CommonUtil.getTwoPointDouble(numberstrChche));
|
|
|
|
|
+ }else {
|
|
|
|
|
+ table_list_money.remove(position);
|
|
|
|
|
+ table_list_money.add(position,CommonUtil.getTwoPointDouble(numberstrChche));
|
|
|
|
|
+ }*/
|
|
|
|
|
+
|
|
|
|
|
+ if(delayRun!=null){
|
|
|
|
|
+ //每次editText有变化的时候,则移除上次发出的延迟线程
|
|
|
|
|
+ dthandler.removeCallbacks(delayRun);
|
|
|
|
|
+ }
|
|
|
|
|
+ money_editString = s.toString();
|
|
|
|
|
+
|
|
|
|
|
+ //延迟800ms,如果不再输入字符,则执行该线程的run方法
|
|
|
|
|
+ dthandler.postDelayed(delayRun, 1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
return convertView;
|
|
return convertView;
|
|
|
}
|
|
}
|
|
|
class ViewHolder{
|
|
class ViewHolder{
|
|
@@ -430,8 +446,27 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
ImageView details_delete;
|
|
ImageView details_delete;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+ private Runnable delayRun = new Runnable() {
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ if (table_list_money == null ) {
|
|
|
|
|
+ table_list_money.add(CommonUtil.getTwoPointDouble(Double.valueOf(money_editString)));
|
|
|
|
|
+ }else {
|
|
|
|
|
+ if (money_edit_position < table_list_money.size()){
|
|
|
|
|
+ table_list_money.remove(money_edit_position);
|
|
|
|
|
+ table_list_money.add(money_edit_position,CommonUtil.getTwoPointDouble(Double.valueOf(money_editString)));
|
|
|
|
|
+ }else if (money_edit_position == table_list_money.size()){
|
|
|
|
|
+ table_list_money.add(CommonUtil.getTwoPointDouble(Double.valueOf(money_editString)));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ private int money_edit_position;
|
|
|
|
|
+ private String money_editString = "";
|
|
|
|
|
+ private Handler dthandler = new Handler();
|
|
|
/**
|
|
/**
|
|
|
*新增弹出PopupWindow表格适配器
|
|
*新增弹出PopupWindow表格适配器
|
|
|
*/
|
|
*/
|