@AfterViews protected void init() { super.init(); myImageGetter = new MyImageGetter(getActivity()); mData = AccountInfo.loadMessageUsers(getActivity()); initHead(); mFootUpdate.init(listView, mInflater, this); listView.setAdapter(adapter); listView.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Message.MessageObject user = mData.get((int) id); Intent intent = new Intent(getActivity(), MessageListActivity_.class); intent.putExtra("mUserObject", user.friend); startActivity(intent); String url = String.format(HOST_MARK_MESSAGE, user.friend.global_key); postNetwork(url, new RequestParams(), HOST_MARK_MESSAGE, (int) id, null); } }); listView.setOnItemLongClickListener( new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { final Message.MessageObject msg = mData.get((int) id); final String format = "删除你和%s之间的所有私信?"; String title = String.format(format, msg.friend.name); showDialog( title, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { final String hostDeleteAll = Global.HOST + "/api/message/conversations/%s"; String url = String.format(hostDeleteAll, msg.friend.id); deleteNetwork(url, TAG_DELETE_MESSAGE, msg); } }); return true; } }); initData(); }
@AfterViews protected void init() { super.init(); showDialogLoading(); // HOST_GIT_TREEINFO = String.format(HOST_GIT_TREEINFO, mProjectObject.owner_user_name); listView.setAdapter(adapter); listView.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { GitFileInfoObject selectedFile = mData.get(position); if (selectedFile.isTree()) { GitTreeActivity_.intent(getActivity()) .mProjectObject(mProjectObject) .mGitFileInfoObject(selectedFile) .start(); } else { GitViewActivity_.intent(getActivity()) .mProjectObject(mProjectObject) .mGitFileInfoObject(selectedFile) .start(); } // AttachmentsActivity_.intent(getActivity()).mAttachmentFolderObject(mData.get(position)).mProjectObjectId(mProjectObject.id).startForResult(RESULT_REQUEST_FILES); } }); /*listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { //showButtomToast("rename"); doRename(position, mData.get(position)); return true; } });*/ if (mGitFileInfoObject == null) { pathStack.push(""); } else { pathStack.push(mGitFileInfoObject.path); getActivity().getActionBar().setTitle(mGitFileInfoObject.name); } host_git_tree_url = String.format( HOST_GIT_TREE, mProjectObject.owner_user_name, mProjectObject.name, pathStack.peek()); getNetwork(host_git_tree_url, HOST_GIT_TREE); }