@Override
  protected void preLoadData(Bundle savedInstanceState) {
    super.preLoadData(savedInstanceState);

    account = AccountProxy.getInstance().getCurrentAccount();

    /** 获取身体状况资料 */
    mBodyStateTask =
        new EditQAHealthTask(account.getAccessToken(), null, null, null, true, "sick_");
    mBodyStateTask.setProgress(
        new CustomDialogProgress(this, getString(string.punlic_personal_loading)));
    mBodyStateTask.setTaskHost(
        new TaskHost() {
          @Override
          public void onPostExecute(int requestCode, BaseResult result) {
            super.onPostExecute(requestCode, result);
            switch (result.getErrorCode()) {
              case LocalCode.CODE_SUCCESS:
                bodyStates = QAHealth.createQAHealthList((NetworkClientResult) result);
                AccountPreference.getInstance().saveBodyState(bodyStates);
                fillView();
                break;
              default:
                ErrorDialogUtil.showErrorToast(
                    SettingChangeBodyStateActivity.this,
                    CloudStatusCodeProxy.TYPE_SETTING,
                    result.getErrorCode());
                finish();
                break;
            }
          }
        });
    mBodyStateTask.execute();
  }
Exemplo n.º 2
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    account = AccountProxy.getInstance().getCurrentAccount();
    if (account != null) {
      initAdapter();
      initController();
      adapter.setCache(controller.getCache());
      mGridView.setAdapter(adapter);
      mGridView.setOnItemClickListener(
          new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
              Subscribe subscribe = adapter.getItem(position);

              switch (subscribe.getType()) {
                case Subscribe.TYPE_BUILT_IN_ALARM:
                  AlarmListActivity.callMe(getActivity());
                  break;
                case Subscribe.TYPE_BUILT_IN_HEALTH:
                  jumpToWebSite(NetworkClient.URL_DOWNLOAD_APK);
                  break;
                case Subscribe.TYPE_BUILT_IN_STORE:
                  jumpToWebSite(null);
                  break;
                case Subscribe.TYPE_BUILT_IN_HEALTH_ASSESSMENT:
                  HealthAssessmentActivity.jump2AQHealth(getActivity());
                  break;
                case Subscribe.TYPE_BUILT_IN_APPLY_SERVICE:
                  ActivityWebViewContainer.toApplyService(getActivity());
                  break;
                case Subscribe.TYPE_NET:
                  if (subscribe.isAdmin()) {
                    SubscribeAdminActivity.callMe(getActivity(), subscribe);
                  } else {
                    ChatRoomActivity.callMe(getActivity(), subscribe);
                  }
                  break;
              }
            }
          });
    } else {
      AccountProxy.getInstance().doLogout(getActivity(), true);
    }
  }
Exemplo n.º 3
0
  @Override
  public void doShareWithUrl(TaskHost taskHost) {

    String accessToken = AccountProxy.getInstance().getCurrentAccount().getAccessToken();
    String type = MCloudDevice.OXY.getTag();

    // XXX 临时方案,解决分享中出现41904错误,待缓存这块重构
    String uid = mBloodOxygen.getMeasureUID();

    BloodOxygenModule oxyModule =
        (BloodOxygenModule)
            CloudMeasureModuleCentreRoot.getInstance()
                .create(
                    AccountProxy.getInstance().getCurrentAccount(),
                    BloodOxygenModule.class.getCanonicalName(),
                    true);

    BloodOxygen tmpOxygen = oxyModule.getCacheController().getMeasureBloodOxygen(uid);

    Integer recordID = tmpOxygen.getRecordID();
    GroupHelper.doShareUrlRecordTask(context, accessToken, type, recordID, null, null, taskHost);
  }
Exemplo n.º 4
0
  private void markAllMessage() {

    TaskPool.doMarkNotificationProcessTask(
        AccountProxy.getInstance().getCurrentAccount().getAccessToken(),
        null,
        true,
        new TaskHost() {
          public void onPostExecute(int requestCode, BaseResult result) {

            switch (result.getErrorCode()) {
              case LocalCode.CODE_SUCCESS:
                UnreadMessageCenter.removeAllNotification();
                break;

              default:
                break;
            }
          };
        });
  }
Exemplo n.º 5
0
 @Override
 public void onClick(View v) {
   switch (v.getId()) {
     case id.actionbar_right:
       Account account = AccountProxy.getInstance().getCurrentAccount();
       String url =
           NetworkClient.getWebSitePath(
               NetworkClient.URL_SUBSCRIBE_WEB_CENTRE, account.getAccessToken());
       Log.v("SubscribeController", url);
       TemporaryData.save(Constants.TEMPORARYDATA_KEY_URL, url);
       TemporaryData.save(
           Constants.TEMPORARYDATA_KEY_TITLE, getResources().getString(R.string.indicator_number));
       ActivityWebViewContainer.callMe(getActivity());
       break;
     case R.id.actionbar_title:
       break;
     default:
       break;
   }
 }
Exemplo n.º 6
0
  @Override
  public void doSendShareMessage(TaskHost taskHost, IChat iChat, String shareURL) {

    JSONObject jo = new JSONObject();
    try {
      jo.put("type", MCloudDevice.OXY.getTag());
      jo.put("value1", mBloodOxygen.getOxygen().toString());
      jo.put("value2", mBloodOxygen.getRate().toString());
      jo.put("time", mBloodOxygen.getMeasureTime().longValue());
      jo.put("state", mBloodOxygen.getAbnormal());
      jo.put("url", shareURL);
      jo.put("report_type", Message.TYPE_RECORD);
    } catch (JSONException e) {
      e.printStackTrace();
    }
    MessageController.doPostItemFromServer(
        context,
        AccountProxy.getInstance().getCurrentAccount(),
        iChat.getIChatInterlocutorIdServer(),
        jo.toString(),
        Message.TYPE_RECORD,
        taskHost);
  }
Exemplo n.º 7
0
 @Override
 protected void preLoadData(Bundle savedInstanceState) {
   super.preLoadData(savedInstanceState);
   currentAccount = AccountProxy.getInstance().getCurrentAccount();
   agent = new FeedbackAgent(this);
 }
 @Override
 protected FetalMovementCache createCache() {
   FetalMovementCache cache = new FetalMovementCache();
   cache.setAccountAttached(AccountProxy.getInstance().getCurrentAccount());
   return cache;
 }
 public FetalMovementResultDetailsController() {
   setAccountAttached(AccountProxy.getInstance().getCurrentAccount());
 }