コード例 #1
0
 private boolean isInMyprivacyCircle(String circleid) {
   if (mUser.uid != AccountServiceUtils.getBorqsAccountID()) {
     String[] ids = circleid.split(",");
     for (int i = 0; i < ids.length; i++) {
       if (QiupuConfig.ADDRESS_BOOK_CIRCLE == Long.parseLong(ids[i])) {
         return true;
       }
     }
   }
   return false;
 }
コード例 #2
0
 private void setDisplayNameUi() {
   if (AccountServiceUtils.getBorqsAccountID() == mUser.uid) {
     tv_user_name.setText(mUser.nick_name);
     tv_user_name.setOnClickListener(null);
   } else {
     if (StringUtil.isValidString(mUser.circleId)) {
       tv_user_name.setText(StringUtil.formatRemarkHtmlString(mUser.nick_name, showRemarkName()));
     } else {
       tv_user_name.setText(mUser.nick_name);
       tv_user_name.setOnClickListener(null);
     }
   }
 }
コード例 #3
0
 private void refreshUserInfoUI() {
   if (mUser != null) {
     setrequestStatusUi();
     initImageUI(mUser.profile_image_url);
     initUserInfoUI();
     setCircleUI();
     if (mUser.uid == AccountServiceUtils.getBorqsAccountID()) {
       profile_control.setVisibility(View.VISIBLE);
     } else {
       profile_control.setVisibility(View.GONE);
     }
   }
 }
コード例 #4
0
  private void invitePeopleInPublicCircle(
      final String circleId,
      final String toids,
      final String toNames,
      final String message,
      final boolean sendEmail,
      final boolean sendSms) {
    if (inInvitePeople == true) {
      ToastUtil.showShortToast(this, mHandler, R.string.string_in_processing);
      return;
    }

    synchronized (mLockInvitePeople) {
      inInvitePeople = true;
    }

    mprogressDialog =
        DialogUtils.showProgressDialog(
            this, -1, getString(R.string.invite_progress_dialog_message));

    asyncQiupu.publicInvitePeople(
        AccountServiceUtils.getSessionID(),
        circleId,
        toids,
        toNames,
        message,
        sendEmail,
        sendSms,
        new TwitterAdapter() {
          public void publicInvitePeople(ArrayList<Long> joinIds) {
            Log.d(TAG, "finish invitePeopleInPublicCircle=" + joinIds.size());
            invitePeopleCallback(joinIds);

            Message msg = mHandler.obtainMessage(INVIT_PEOPLE_END);
            msg.getData().putBoolean(RESULT, true);
            msg.sendToTarget();
            synchronized (mLockInvitePeople) {
              inInvitePeople = false;
            }
          }

          public void onException(TwitterException ex, TwitterMethod method) {
            synchronized (mLockInvitePeople) {
              inInvitePeople = false;
            }
            Message msg = mHandler.obtainMessage(INVIT_PEOPLE_END);
            msg.getData().putBoolean(RESULT, false);
            msg.sendToTarget();
          }
        });
  }
コード例 #5
0
    private void chooseDialog(String requst_change_str, final int type, final String url) {
      if (AccountServiceUtils.getBorqsAccountID() == mUser.uid) {
        return;
      }
      String[] items = new String[] {requst_change_str, url};
      AlertDialog builder =
          new AlertDialog.Builder(mActivity)
              .setItems(
                  items,
                  new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      if (which == 0) {
                        switchChangeRequest(type, url);
                      } else {
                        if (type == BasicActivity.DISPLAY_EMAIL1
                            || type == BasicActivity.DISPLAY_EMAIL2
                            || type == BasicActivity.DISPLAY_EMAIL3) {
                          try {
                            String new_url = new StringBuilder("mailto:").append(url).toString();
                            Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(new_url));
                            intent.setFlags(
                                Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
                            startActivity(intent);
                          } catch (ActivityNotFoundException e) {
                            e.printStackTrace();
                          }
                        } else {
                          try {
                            String new_url = new StringBuilder("tel:").append(url).toString();
                            Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(new_url));
                            intent.setFlags(
                                Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
                            startActivity(intent);
                          } catch (ActivityNotFoundException e) {
                            e.printStackTrace();
                          }
                        }
                      }
                    }
                  })
              .show();
    }
コード例 #6
0
  private void sendchangeRequest(HashMap<String, String> map) {
    synchronized (mSendRequestLock) {
      if (insendRequestProcess == true) {
        Log.d(TAG, "in loading info data");
        return;
      }
    }
    showProcessDialog(R.string.request_process_title, false, true, true);

    synchronized (mSendRequestLock) {
      insendRequestProcess = true;
    }
    asyncQiupu.sendChangeRequest(
        AccountServiceUtils.getSessionID(),
        map,
        new TwitterAdapter() {
          public void sendChangeRequest(boolean result) {
            Log.d(TAG, "finish edit user profile");
            Message msg = mHandler.obtainMessage(CHANGE_REQUEST_END);
            msg.getData().putBoolean(BasicActivity.RESULT, result);
            msg.sendToTarget();
            synchronized (mSendRequestLock) {
              insendRequestProcess = false;
            }
          }

          public void onException(TwitterException ex, TwitterMethod method) {

            synchronized (mSendRequestLock) {
              insendRequestProcess = false;
            }
            TwitterExceptionUtils.printException(
                TAG, "sendchangeRequest, server exception:", ex, method);

            Message msg = mHandler.obtainMessage(CHANGE_REQUEST_END);
            msg.getData().putString(BasicActivity.ERROR_MSG, ex.getMessage());
            msg.getData().putBoolean(BasicActivity.RESULT, false);
            msg.sendToTarget();
          }
        });
  }
コード例 #7
0
 private void setrequestStatusUi() {
   // set attention
   if (mUser.uid == AccountServiceUtils.getBorqsAccountID()) {
     //			request_concern.setVisibility(View.GONE);
   } else {
     if (StringUtil.isValidString(mUser.circleId)) {
       if (mUser.his_friend) {
         if (mUser.profile_privacy
             && (!StringUtil.isValidString(mUser.pedding_requests)
                 || !BpcFriendsItemView.isalreadyRequestProfile(mUser.pedding_requests))) {
           //						request_concern.setVisibility(View.VISIBLE);
           //						request_concern.setText(R.string.request_see_user_profile);
         } else {
           //						request_concern.setVisibility(View.GONE);
         }
       } else {
         //					request_concern.setText(R.string.request_concern);
         //					request_concern.setVisibility(View.VISIBLE);
       }
     } else {
       //				request_concern.setVisibility(View.GONE);
     }
   }
 }