// 初始化@界面 private void initAtView(LayoutInflater inflater, List<View> listViews) { View at_view = inflater.inflate(R.layout.msg_at, null); listViews.add(at_view); lv_msg_at = (PullToRefreshListView) at_view.findViewById(R.id.lv_msg_at); // 下拉刷新 lv_msg_at.setOnRefreshListener( new OnRefreshListener() { @Override public void onRefresh() { at_current_state = AT_MORE_NEW; newAtTask(at_current_state, at_max_id, true); } }); lv_msg_at.setOnLoadOldListener( new onLoadOldListener() { @Override public void onLoadOld() { at_current_state = AT_MORE_OLD; newAtTask(at_current_state, at_max_id, true); } }); pb_at = (ProgressBar) at_view.findViewById(R.id.pb_at); View popup_window_at = LayoutInflater.from(this).inflate(R.layout.popup_window_at, null); popupWindow_at = createPopupWindow(popup_window_at, 230, LayoutParams.WRAP_CONTENT); final LinearLayout ll_msg_at_wb_comment = (LinearLayout) at_view.findViewById(R.id.ll_msg_at_wb_comment); ll_msg_at_wb_comment.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { popupWindow_at.showAsDropDown(ll_msg_at_wb_comment, 10, -5); } }); btn_at_wb_all = (Button) popup_window_at.findViewById(R.id.btn_at_wb_all); btn_at_wb_friends = (Button) popup_window_at.findViewById(R.id.btn_at_wb_friends); btn_at_wb_original = (Button) popup_window_at.findViewById(R.id.btn_at_wb_original); btn_at_comment_all = (Button) popup_window_at.findViewById(R.id.btn_at_comment_all); btn_at_comment_friends = (Button) popup_window_at.findViewById(R.id.btn_at_comment_friends); btn_at_wb_all.setOnClickListener(this); btn_at_wb_friends.setOnClickListener(this); btn_at_wb_original.setOnClickListener(this); btn_at_comment_all.setOnClickListener(this); btn_at_comment_friends.setOnClickListener(this); }
// 初始化Comment界面 private void initCommentView(LayoutInflater inflater, List<View> listViews) { // Comment View View comment_view = inflater.inflate(R.layout.msg_comment, null); listViews.add(comment_view); lv_msg_comment = (PullToRefreshListView) comment_view.findViewById(R.id.lv_msg_comment); lv_msg_comment.setOnRefreshListener( new OnRefreshListener() { @Override public void onRefresh() {} }); lv_msg_comment.setOnLoadOldListener( new onLoadOldListener() { @Override public void onLoadOld() {} }); pb_comment = (ProgressBar) comment_view.findViewById(R.id.pb_comment); // PopupWindow View View popup_window_comment = LayoutInflater.from(this).inflate(R.layout.popup_window_comment, null); popupWindow_comment = createPopupWindow(popup_window_comment, 230, LayoutParams.WRAP_CONTENT); final LinearLayout ll_msg_comment_to_by = (LinearLayout) comment_view.findViewById(R.id.ll_msg_comment_to_by); ll_msg_comment_to_by.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { popupWindow_comment.showAsDropDown(ll_msg_comment_to_by, 10, -5); } }); btn_comment_to_me_all = (Button) popup_window_comment.findViewById(R.id.btn_comment_to_me_all); btn_comment_to_me_friends = (Button) popup_window_comment.findViewById(R.id.btn_comment_to_me_friends); btn_comment_by_me_all = (Button) popup_window_comment.findViewById(R.id.btn_comment_by_me_all); btn_comment_to_me_all.setOnClickListener(this); btn_comment_to_me_friends.setOnClickListener(this); btn_comment_by_me_all.setOnClickListener(this); }