@Subscribe public void onGetDeletedCommentEvent(CommentsEvent event) { if (event.comments.size() != 0) { // if(GlobalVariables.onDeleteComment) { for (int i = 0; i < postsList.size(); i++) { if (postsList.get(i).id == event.comments.get(event.comments.size() - 1).postId) { // if(postsList.get(i).id == event.comment.postId) { // for(int j=0; j<postsList.get(i).comments.size(); i++) { // if(postsList.get(i).comments.get(j).id == event.comment.id) { // postsList.get(i).comments.remove(j); // break; // } postsList.get(i).comments.remove(event.comments.size()); break; // } } } // GlobalVariables.onDeleteComment = false; // if(PostsAdapter.lastClickedPosts.contains(event.comment.postId)) // // if(PostsAdapter.lastClickedPosts.contains(event.comments.get(event.comments.size()-1).postId)) { // for(int i=0; i<PostsAdapter.lastClickedPosts.size(); i++) { // if(PostsAdapter.lastClickedPosts.get(i) == // event.comments.get(event.comments.size()-1).postId) { // PostsAdapter.lastClickedPosts.remove(i); // break; // } // } // } // PostsAdapter.lastClickedPosts = new ArrayList<Integer>(); PostsAdapter adapter = new PostsAdapter( inflater, this.getActivity(), postsMarket, Post.orderDescPost(postsList), accessToken, currentUser); adapter.makeList(); } }
@Subscribe public void onGetListPostsEvent(PostsEvent event) { // spinner.setVisibility(View.GONE); postsList = event.posts; // ArrayList<HashMap<String, String>> posts = Post.postsInfoForItem(postsList); GlobalVariables.replyFromMyMarket = true; PostsAdapterOneProfile adapter = new PostsAdapterOneProfile( inflater, this.getActivity(), postsMarket, Post.orderDescPost(postsList), accessToken, currentUser); adapter.makeList(); loading.setVisibility(View.INVISIBLE); if (postsList.isEmpty()) emptySearch.setVisibility(View.VISIBLE); else emptySearch.setVisibility(View.INVISIBLE); }
@Subscribe public void onGetDeletedPostEvent(PostEvent event) { for (int i = 0; i < postsList.size(); i++) { if (postsList.get(i).id == event.post.id) { postsList.remove(i); break; } } PostsAdapterOneProfile adapter = new PostsAdapterOneProfile( inflater, this.getActivity(), postsMarket, Post.orderDescPost(postsList), accessToken, currentUser); adapter.makeList(); loading.setVisibility(View.INVISIBLE); if (postsList.isEmpty()) emptySearch.setVisibility(View.VISIBLE); else emptySearch.setVisibility(View.INVISIBLE); }