Exemple #1
0
  @Override
  protected void initLayout() {
    adapteScreent();

    _getView(R.id.frame_main_one_myspace).setOnClickListener(this);

    _getView(R.id.frame_main_one_setting).setOnClickListener(this);

    _getView(R.id.frame_main_one_message).setOnClickListener(this);

    _getView(R.id.frame_main_one_allmember).setOnClickListener(this);

    _getView(R.id.frame_main_one_communication).setOnClickListener(this);

    _getView(R.id.frame_main_one_activities).setOnClickListener(this);

    _getView(R.id.frame_main_one_group).setOnClickListener(this);

    _getView(R.id.frame_main_one_business).setOnClickListener(this);

    _getView(R.id.frame_main_one_allactivity).setOnClickListener(this);
    tv_unreadCount = (TextView) _getView(R.id.tv_unreadcount);
    iv_backgroud = (ImageView) _getView(R.id.iv_main_bg);
    if (AppInfo.getBackgroudPath(getContext()) != null) {
      iv_backgroud.setImageBitmap(BitmapFactory.decodeFile(AppInfo.getBackgroudPath(getContext())));
    }
    initWebView();
  }
Exemple #2
0
 @Override
 public void onReceive(Context context, Intent intent) {
   if (intent.getAction().equals(Constants.Action_Receive_UnreadCount)) { // got unread
     tv_unreadCount.setVisibility(View.INVISIBLE);
     if (MessageCache.getUnreadCount(getContext()) > 0) {
       tv_unreadCount.setText(MessageCache.getUnreadCount(getContext()) + "");
       tv_unreadCount.setVisibility(View.VISIBLE);
     }
   } else if (intent.getAction().equals(Constants.Action_Backgroud_switch)) {
     if (AppInfo.getBackgroudPath(getContext()) != null) {
       iv_backgroud.setImageBitmap(
           BitmapFactory.decodeFile(AppInfo.getBackgroudPath(getContext())));
     }
   } else if (intent.getAction().equals(Constants.Action_User_Login_Out)) {
     closeActivity();
   }
 }
 @Override
 protected void initData() {
   issue = (Issue) getSerializableExtra("issue");
   activity = (MActivity) getSerializableExtra("activity");
   user = AppInfo.getUser(getContext());
   if (user == null) {
     toast("无用户信息,请重新登录");
     closeActivity();
   }
   api = new IssuesAPI();
   data_commet = new ArrayList<Comment>();
 }
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.acty_head_btn_back:
        closeActivity();
        break;
      case R.id.acty_communicationdetail_btn_space:
        // 去个人空间
        Intent intent = null;
        if (issue.getUser().getId() == AppInfo.getUser(getContext()).getId()) {
          intent = new Intent(this, SpacePersonal.class);
        } else {
          intent = new Intent(this, SpaceOther.class);
        }
        intent.putExtra("user", issue.getUser());
        openActivity(intent);
        break;
      case R.id.acty_communicationdetail_footer_share:
        // 分享到圈子
        // toast("share");
        break;
      case R.id.acty_communicationdetail_footer_comment:
        // 评论
        Intent comIntent = new Intent(this, CommunicationComment.class);
        comIntent.putExtra("issue", issue);
        openActivity(comIntent);
        break;
      case R.id.acty_communicationdetail_footer_favourite:
        // 收藏
        faviourite();
        break;

      case R.id.btn_delete:
        delete();
        break;
      case R.id.btn_edit:
        edit();
        break;
      default:
        break;
    }
  }