use of org.wordpress.android.ui.stats.adapters.PostsAndPagesAdapter in project WordPress-Android by wordpress-mobile.
the class StatsCommentsFragment method updateUI.
@Override
protected void updateUI() {
if (!isAdded()) {
return;
}
if (mCommentsModel == null && mCommentFollowersModel == null) {
showHideNoResultsUI(true);
mTotalsLabel.setVisibility(View.GONE);
mTopPagerContainer.setVisibility(View.GONE);
return;
}
mTopPagerContainer.setVisibility(View.VISIBLE);
if (mCommentFollowersModel != null) {
// check if comment-followers is already here
mTotalsLabel.setVisibility(View.VISIBLE);
int totalNumberOfFollowers = mCommentFollowersModel.getTotal();
String totalCommentsFollowers = getString(R.string.stats_comments_total_comments_followers);
mTotalsLabel.setText(String.format(totalCommentsFollowers, FormatUtils.formatDecimal(totalNumberOfFollowers)));
}
ArrayAdapter adapter = null;
if (mTopPagerSelectedButtonIndex == 0 && hasAuthors()) {
adapter = new AuthorsAdapter(getActivity(), getAuthors());
} else if (mTopPagerSelectedButtonIndex == 1 && hasPosts()) {
adapter = new PostsAndPagesAdapter(getActivity(), getPosts());
}
if (adapter != null) {
StatsUIHelper.reloadLinearLayout(getActivity(), adapter, mList, getMaxNumberOfItemsToShowInList());
showHideNoResultsUI(false);
} else {
showHideNoResultsUI(true);
}
}
use of org.wordpress.android.ui.stats.adapters.PostsAndPagesAdapter in project WordPress-Android by wordpress-mobile.
the class StatsTopPostsAndPagesFragment method updateUI.
@Override
protected void updateUI() {
if (!isAdded()) {
return;
}
if (hasTopPostsAndPages()) {
List<StatsPostModel> postViews = mTopPostsAndPagesModel.getTopPostsAndPages();
ArrayAdapter adapter = new PostsAndPagesAdapter(getActivity(), postViews);
StatsUIHelper.reloadLinearLayout(getActivity(), adapter, mList, getMaxNumberOfItemsToShowInList());
showHideNoResultsUI(false);
} else {
showHideNoResultsUI(true);
}
}
Aggregations