use of com.winsonchiu.reader.data.reddit.Sort in project Reader by TheKeeperOfPie.
the class FragmentComments method onMenuItemClick.
@Override
public boolean onMenuItemClick(MenuItem item) {
switch(item.getItemId()) {
case R.id.item_hide_youtube:
toggleYouTubeVisibility(View.GONE);
break;
case R.id.item_load_full_comments:
fragmentCurrent.loadLinkComments();
break;
case R.id.item_expand_post:
if (fragmentCurrent != null) {
fragmentCurrent.expandPost(!fragmentCurrent.getPostExpanded());
}
break;
}
item.setChecked(true);
Sort sort = Sort.fromMenuId(item.getItemId());
if (sort != null) {
fragmentCurrent.setSort(sort);
fragmentCurrent.scrollToPositionWithOffset(1, 0);
return true;
}
return true;
}
use of com.winsonchiu.reader.data.reddit.Sort in project Reader by TheKeeperOfPie.
the class FragmentProfile method onMenuItemClick.
@Override
public boolean onMenuItemClick(MenuItem item) {
int id = item.getItemId();
switch(id) {
case R.id.item_new_message:
FragmentNewMessage fragmentNewMessage = FragmentNewMessage.newInstance(controllerProfile.getUser().getName(), "", "");
getFragmentManager().beginTransaction().hide(FragmentProfile.this).add(R.id.frame_fragment, fragmentNewMessage, FragmentNewMessage.TAG).addToBackStack(null).commit();
break;
case R.id.item_search:
return true;
}
item.setChecked(true);
Sort sort = Sort.fromMenuId(item.getItemId());
if (sort != null) {
controllerProfile.setSort(sort).subscribe(getReloadObserver());
flashSearchView();
return true;
}
Time time = Time.fromMenuId(item.getItemId());
if (time != null) {
controllerProfile.setTime(time).subscribe(getReloadObserver());
itemSortTime.setTitle(getString(R.string.time_description, item.toString()));
flashSearchView();
return true;
}
return false;
}
Aggregations