예제 #1
0
        @Override
        public void handleMessage(Message msg) {
          super.handleMessage(msg);
          if (msg.what == 0) {
            if (tmz_Cur_Num == 1) {
              tmzGoodses = (ArrayList<TMZGoods>) msg.obj;
              if (tmzGoodses != null) {
                setAdapterForTMZ();
              }
            } else {
              ArrayList<TMZGoods> newtmzGoodses = (ArrayList<TMZGoods>) msg.obj;
              if (newtmzGoodses != null) {
                tmzGoodses.addAll(newtmzGoodses);
                customTMZListViewAdapter.notifyDataSetChanged();
              }
              listViewTMZ.onRefreshComplete();
            }

          } else if (msg.what == 1) {
            if (jjks_Cur_Num == 1) {
              jjksGoodses = (ArrayList<JJKSGoods>) msg.obj;
              if (jjksGoodses != null) {
                setAdapterForJJKS();
              }
            } else {
              ArrayList<JJKSGoods> newjjksGoodses = (ArrayList<JJKSGoods>) msg.obj;
              if (newjjksGoodses != null) {
                jjksGoodses.addAll(newjjksGoodses);
                customJSKSListViewAdapter.notifyDataSetChanged();
              }
              listViewJJKS.onRefreshComplete();
            }
          }
        }
예제 #2
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case StringUtils.START_GET_BILL_COMMENT_SUCCESSFULLY:
       // App.dismissDialog();
       commentList = BillCommentUtils.getBillCommentList(StringUtils.FRAGMENT_BILL_COMMENT);
       commentAdapter.refresh(commentList);
       srlComment.setRefreshing(false);
       isRefreshing = false;
       break;
     case StringUtils.START_GET_BILL_COMMENT_FAILED:
       Snackbar.make(rvComment, R.string.please_check_your_network, Snackbar.LENGTH_SHORT)
           .show();
       srlComment.setRefreshing(false);
       isRefreshing = false;
       break;
     case StringUtils.START_POST_BILL_COMMENT_SUCCESSFULLY:
       BillCommentUtils.clearList(StringUtils.FRAGMENT_BILL_COMMENT);
       BillCommentUtils.startGetBillCommentTransaction(
           StringUtils.FRAGMENT_BILL_COMMENT, handler, bill.getObjectId());
       App.dismissDialog();
       break;
     case StringUtils.START_POST_BILL_COMMENT_FAILED:
       App.dismissDialog();
       Snackbar.make(rvComment, R.string.please_check_your_network, Snackbar.LENGTH_SHORT)
           .show();
       break;
   }
 }
예제 #3
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case 0: // 刷新业务
       updataData();
       break;
   }
 }
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case DATACHANGED:
       progressDialog.dismiss();
       simpleAdapter.notifyDataSetChanged();
   }
 }
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case 0:
       if (!mListView.isRefreshing()) {
         mListView.setRefreshing();
       }
       break;
   }
 }
예제 #6
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case 0:
       if (mSwipeLayout.isRefreshing()) {
         mSwipeLayout.setRefreshing(false);
       }
       break;
   }
 }
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   dissmissProgressDialog();
   BadgeView badgeView = new BadgeView(getActivity(), iv_receiver_onway);
   int onwayNum = msg.what;
   //            int onwayNum = 100;
   if (onwayNum > 99) {
     badgeView.setText("99+");
   } else {
     badgeView.setText(onwayNum + "");
   }
   badgeView.show();
 }
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   List<String> list = new ArrayList<>();
   for (int i = 0; i < 10; i++) {
     list.add("这是一个测试 page = " + mPage + " i = " + i);
   }
   if (mPage == 0) {
     mAdapter.resetList(list);
   } else {
     mAdapter.addList(list);
   }
   isPullRefresh = false;
   mRefreshView.refreshComplete();
   mRefreshView.setLoadMoreEnable(mPage < 4);
 }
예제 #9
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case 0:
       if (dialog != null) {
         dialog.dismiss();
       }
       LinearLayoutManager manager = new LinearLayoutManager(getActivity());
       information_collection_recycle.setLayoutManager(manager);
       information_collection_recycle.setAdapter(adapter);
       break;
     case 1:
       ((InformationCollectionActivity) getActivity()).showToast("数据请求失败");
       break;
     case 2:
       Log.e("error", "网络请求失败");
       break;
   }
 }
예제 #10
0
 @Override
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case 2:
       if (smsTime == 0) {
         smsCodeView.setText("再次发送");
         smsCodeView.setTextColor(getResources().getColor(R.color.white));
         smsCodeView.setTextColor(getResources().getColor(R.color.sms_code));
         smsCodeView.setBackgroundResource(R.drawable.bg_sms_enable_corners);
         smsCodeView.setClickable(true);
       } else {
         smsTime--;
         smsCodeView.setText("发送中 " + smsTime + "s");
         handler.sendEmptyMessageDelayed(2, 1000);
       }
       break;
     default:
       break;
   }
   super.handleMessage(msg);
 }
        @Override
        public void handleMessage(Message msg) {
          super.handleMessage(msg);
          Bundle bundle = msg.getData();
          if (bundle.getInt("code") == 0) {
            if (dialogDefine != null) {
              dialogDefine.dismiss();
            }
            if (bundle.getString("msg").trim().length() == 0) {
              Toast.makeText(FragmentSetting.this.getActivity(), "网络错误!", Toast.LENGTH_SHORT)
                  .show();
              return;
            }

            exitSuccess();

            /*                Toast.makeText(FragmentSetting.this.getActivity(),
            bundle.getString("msg"), Toast.LENGTH_SHORT).show();*/

            Intent intent = new Intent();
            intent.setClass(FragmentSetting.this.getActivity(), MainActivity.class);
            MyApplication.USER_OR_NOT = 0;
            MyApplication.currentFragment = MainActivity.MAIN_FRAGMENT;
            FragmentSetting.this.getActivity().finish();
            startActivity(intent);
          } else {
            if (dialogDefine != null) {
              dialogDefine.dismiss();
            }
            if (bundle.getString("msg").trim().length() == 0) {
              Toast.makeText(FragmentSetting.this.getActivity(), "网络错误!", Toast.LENGTH_SHORT)
                  .show();
              return;
            }
            Toast.makeText(
                    FragmentSetting.this.getActivity(), bundle.getString("msg"), Toast.LENGTH_SHORT)
                .show();
          }
        }
예제 #12
0
        @Override
        public void handleMessage(Message msg) {
          switch (msg.what) {
            case Constant.SHOW_RESPONSE:
              String response = (String) msg.obj;
              try {
                gymList.clear();
                gymList.addAll(JsonParse.ParseBriefGymInfo(response));
                gymAdapter.notifyDataSetChanged();

                if (progressBar.getVisibility() == View.VISIBLE) {
                  progressBar.setVisibility(View.GONE);
                }

              } catch (JSONException e) {
                e.printStackTrace();
              }

              break;
            default:
              homeViewPager.setCurrentItem(msg.what);
              super.handleMessage(msg);
          }
        }
예제 #13
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   String icon_url = (String) msg.obj;
   int photoId = 0;
   if (editor.get("userType", "").equals("1")) {
     photos.setBackgroundResource(R.drawable.photo_primary);
     photoId = R.drawable.photo_primary;
   } else if (editor.get("userType", "").equals("2")) {
     photos.setBackgroundResource(R.drawable.photo_expert);
     photoId = R.drawable.photo_expert;
   } else if (editor.get("userType", "").equals("0")) {
     photos.setBackgroundResource(R.drawable.photo_patient);
     photoId = R.drawable.photo_patient;
   }
   if (!"null".equals(icon_url) && !"".equals(icon_url) && null != icon_url) {
     ImageListener listener = ImageLoader.getImageListener(photos, photoId, photoId);
     mImageLoader.get(icon_url, listener);
   }
   if (!"null".equals(userTo.getUser_name())
       && !"".equals(userTo.getUser_name())
       && userTo.getUser_name() != null) {
     userName.setVisibility(View.VISIBLE);
     phone.setVisibility(View.VISIBLE);
     userName.setText(userTo.getUser_name());
     phone.setText(editor.get("phone", ""));
   } else {
     userName.setVisibility(View.GONE);
     phone.setVisibility(View.GONE);
     myInfo_text.setText("请填写个人信息");
   }
   if (!editor.get("userType", "").equals("0")) {
     line.setVisibility(View.GONE);
     jion_layout.setVisibility(View.GONE);
   } else {
     line.setVisibility(View.VISIBLE);
     jion_layout.setVisibility(View.VISIBLE);
   }
   if (editor.get("userType", "").equals("0")) {
     invitation_layout.setVisibility(View.GONE);
   } else {
     invitation_layout.setVisibility(View.VISIBLE);
   }
   blance_text.setText("余额" + (float) blance / 100 + "元");
   if (null != doctorInfo && !"null".equals(doctorInfo) && !"".equals(doctorInfo)) {
     doctor_layout.setVisibility(View.VISIBLE);
     line.setVisibility(View.GONE);
     jion_layout.setVisibility(View.GONE);
     try {
       JSONObject jsonObject = new JSONObject(doctorInfo);
       title.setText(
           jsonObject.getString("depart_name") + "|" + jsonObject.getString("title"));
       hospital.setText(jsonObject.getString("hospital_name"));
       if (jsonObject.getString("grade").equals("1")) {
         status.setVisibility(View.INVISIBLE);
         if (jsonObject.getString("approve_status").equals("0")) {
           grade.setText("待认证");
           grade.setTextColor(Color.parseColor("#990000"));
           description.setVisibility(View.GONE);
         } else if (jsonObject.getString("approve_status").equals("1")) {
           grade.setText("已认证");
           grade.setTextColor(Color.parseColor("#006633"));
           description.setVisibility(View.GONE);
         } else if (jsonObject.getString("approve_status").equals("2")) {
           grade.setText("未认证通过");
           grade.setTextColor(Color.parseColor("#990000"));
           description.setText(jsonObject.getString("approve_desc"));
         }
       } else {
         grade.setText(jsonObject.getString("expert_grade"));
         if (jsonObject.getString("approve_status").equals("0")) {
           status.setText("待认证");
           description.setVisibility(View.GONE);
         } else if (jsonObject.getString("approve_status").equals("1")) {
           status.setText("已认证");
           status.setTextColor(Color.parseColor("#006633"));
           description.setVisibility(View.GONE);
         } else if (jsonObject.getString("approve_status").equals("2")) {
           status.setText("未认证通过");
           description.setText(jsonObject.getString("approve_desc"));
         }
       }
     } catch (JSONException e) {
       e.printStackTrace();
     }
   } else {
     doctor_layout.setVisibility(View.GONE);
     line.setVisibility(View.VISIBLE);
     jion_layout.setVisibility(View.VISIBLE);
   }
 }
        @Override
        public void handleMessage(Message msg) {
          // TODO Auto-generated method stub
          super.handleMessage(msg);
          switch (msg.what) {
            case 0:
              dialog.setMessage("加载中...");
              dialog.setCanceledOnTouchOutside(false);
              dialog.show();
              break;
            case 1:
              dialog.dismiss();
              Toast.makeText(getActivity(), "加载成功!", Toast.LENGTH_SHORT).show();
              try {
                JSONObject jsonObject = new JSONObject(result);
                sex = jsonObject.getString("sex");
                mobilePhone = jsonObject.getString("mobilephone");
                phone = jsonObject.getString("phone");
                org = jsonObject.getString("org");
                postion = jsonObject.getString("postion");

                showSex.setText(sex);
                showOrg.setText(org);
                showMobliePhone.setText(mobilePhone);
                showPhone.setText(phone == null ? "" : phone);
                showPostion.setText(postion);
                editOrg.setText(org);
                if (sex.equals("男")) {
                  rb1.setChecked(true);
                } else {
                  rb2.setChecked(true);
                }
                editPhone.setText(phone == null ? "" : phone);
                editPostion.setText(postion);
                editMobilePhone.setText(mobilePhone);
              } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
              }

              break;
            case -1:
              dialog.dismiss();
              AlertDialog.Builder builder = new Builder(getActivity());
              builder.setTitle("请选择操作");
              builder.setMessage("加载失败,是否重试!");
              builder.setPositiveButton(
                  "是",
                  new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      // TODO Auto-generated method stub
                      getData();
                    }
                  });
              builder.setNegativeButton(
                  "否",
                  new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      // TODO Auto-generated method stub
                      getActivity().finish();
                    }
                  });
              builder.create().show();
              break;
            case 2:
              dialog.dismiss();
              Toast.makeText(getActivity(), "无相关数据!", Toast.LENGTH_SHORT).show();
              break;

            case 3:
              dialog.setMessage("提交中...");
              dialog.setCanceledOnTouchOutside(false);
              dialog.show();
              break;
            case 4:
              dialog.dismiss();
              Toast.makeText(getActivity(), "提交成功!", Toast.LENGTH_SHORT).show();
              getActivity().finish();
              break;
            case 5:
              dialog.dismiss();
              Toast.makeText(getActivity(), "提交失败,请重试!", Toast.LENGTH_SHORT).show();
              break;
          }
        }
 @Override
 public void handleMessage(Message msg) {
   // TODO Auto-generated method stub
   super.handleMessage(msg);
   loadingAdapter.notifyDataSetChanged();
 }
 @Override
 public void handleMessage(Message msg) {
   mVp.setCurrentItem(msg.arg1);
   super.handleMessage(msg);
 }