@Override
 public void onClick(View v) {
   final int id = v.getId();
   switch (id) {
     case R.id.rl_loading_img:
       mTbLoadImg.toggle();
       break;
     case R.id.rl_notification_settings:
       UIHelper.showSettingNotification(getActivity());
       break;
     case R.id.rl_clean_cache:
       onClickCleanCache();
       break;
     case R.id.rl_double_click_exit:
       mTbDoubleClickExit.toggle();
       break;
     case R.id.rl_about:
       UIHelper.showAboutOSC(getActivity());
       break;
     case R.id.rl_exit:
       onClickExit();
       break;
     default:
       break;
   }
 }
Пример #2
0
 /**
  * 处理传进来的intent
  *
  * @author 火蚁 2015-1-28 下午3:48:44
  * @return void
  * @param intent
  */
 private void handleIntent(Intent intent) {
   if (intent == null) return;
   String action = intent.getAction();
   if (action != null && action.equals(Intent.ACTION_VIEW)) {
     UIHelper.showUrlRedirect(this, intent.getDataString());
   } else if (intent.getBooleanExtra("NOTICE", false)) {
     notifitcationBarClick(intent);
   }
 }
Пример #3
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    switch (id) {
      case R.id.search:
        UIHelper.showSimpleBack(this, SimpleBackPage.SEARCH);
        break;

      default:
        break;
    }
    return super.onOptionsItemSelected(item);
  }
Пример #4
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case R.id.team_new_active:
       showCreateNewActive();
       break;
     case R.id.team_new_issue:
       UIHelper.showCreateNewIssue(getActivity(), mTeam, null, null);
       break;
     default:
       break;
   }
   return super.onOptionsItemSelected(item);
 }
Пример #5
0
  /** 显示活动报名对话框 */
  private void showEventApply() {

    if (mDetail.getEvent().getCategory() == 4) {
      UIHelper.openSysBrowser(getActivity(), mDetail.getEvent().getUrl());
      return;
    }

    if (!AppContext.getInstance().isLogin()) {
      UIHelper.showLoginActivity(getActivity());
      return;
    }
    if (mEventApplyDialog == null) {
      mEventApplyDialog = new EventApplyDialog(getActivity());
      mEventApplyDialog.setCanceledOnTouchOutside(true);
      mEventApplyDialog.setCancelable(true);
      mEventApplyDialog.setTitle("活动报名");
      mEventApplyDialog.setCanceledOnTouchOutside(true);
      mEventApplyDialog.setNegativeButton(R.string.cancle, null);
      mEventApplyDialog.setPositiveButton(
          R.string.ok,
          new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface d, int which) {
              EventApplyData data = null;
              if ((data = mEventApplyDialog.getApplyData()) != null) {
                data.setEvent(mId);
                data.setUser(AppContext.getInstance().getLoginUid());
                showWaitDialog(R.string.progress_submit);
                VGTimeApi.eventApply(data, mApplyHandler);
              }
            }
          });
    }

    mEventApplyDialog.show();
  }
Пример #6
0
 @Override
 public void onClick(View v) {
   int id = v.getId();
   switch (id) {
     case R.id.rl_event_location:
       UIHelper.showEventLocation(
           getActivity(), mDetail.getEvent().getCity(), mDetail.getEvent().getSpot());
       break;
     case R.id.bt_event_attend:
       showEventApplies();
       break;
     case R.id.bt_event_apply:
       showEventApply();
       break;
     default:
       break;
   }
 }
Пример #7
0
 @Override
 protected String getWebViewBody(Post detail) {
   StringBuffer body = new StringBuffer();
   body.append(UIHelper.WEB_STYLE).append(UIHelper.WEB_LOAD_IMAGES);
   body.append(ThemeSwitchUtils.getWebViewBodyString());
   // 添加title
   body.append(String.format("<div class='title'>%s</div>", mDetail.getTitle()));
   // 添加作者和时间
   String time = StringUtils.friendly_time(mDetail.getPubDate());
   String author =
       String.format(
           "<a class='author' href='http://my.oschina.net/u/%s'>%s</a>",
           mDetail.getAuthorId(), mDetail.getAuthor());
   body.append(
       String.format("<div class='authortime'>%s&nbsp;&nbsp;&nbsp;&nbsp;%s</div>", author, time));
   // 添加图片点击放大支持
   body.append(UIHelper.setHtmlCotentSupportImagePreview(mDetail.getBody()));
   // 封尾
   body.append("</div></body>");
   return body.toString();
 }
Пример #8
0
 private void showEventApplies() {
   Bundle args = new Bundle();
   args.putInt(BaseListFragment.BUNDLE_KEY_CATALOG, mDetail.getEvent().getId());
   UIHelper.showSimpleBack(getActivity(), SimpleBackPage.EVENT_APPLY, args);
 }
Пример #9
0
 @Override
 protected void showCommentView() {
   if (mDetail != null) {
     UIHelper.showComment(getActivity(), mId, CommentList.CATALOG_POST);
   }
 }