Hide list comments button when editing a task in tablet mode

pull/14/head
Sam Bosley 12 years ago
parent 6a4446cca6
commit 7f17ab4eaa

@ -361,6 +361,9 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
overrideFinishAnim = activity.getIntent().getBooleanExtra( overrideFinishAnim = activity.getIntent().getBooleanExtra(
OVERRIDE_FINISH_ANIM, true); OVERRIDE_FINISH_ANIM, true);
} }
if (activity instanceof TaskListActivity)
((TaskListActivity) activity).setCommentsButtonVisibility(false);
} }
private void instantiateEditNotes() { private void instantiateEditNotes() {
@ -989,16 +992,18 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
// abandon editing and delete the newly created task if // abandon editing and delete the newly created task if
// no title was entered // no title was entered
Activity activity = getActivity();
if (overrideFinishAnim) { if (overrideFinishAnim) {
AndroidUtilities.callOverridePendingTransition(getActivity(), AndroidUtilities.callOverridePendingTransition(activity,
R.anim.slide_right_in, R.anim.slide_right_out); R.anim.slide_right_in, R.anim.slide_right_out);
} }
if (getActivity() instanceof TaskListActivity) { if (activity instanceof TaskListActivity) {
if (title.getText().length() == 0 && isNewTask if (title.getText().length() == 0 && isNewTask
&& model != null && model.isSaved()) { && model != null && model.isSaved()) {
taskService.delete(model); taskService.delete(model);
} }
((TaskListActivity) activity).setCommentsButtonVisibility(true);
} }
} }

@ -434,6 +434,10 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
} }
} }
public void setCommentsButtonVisibility(boolean visible) {
commentsButton.setVisibility(visible && filterModeSpec.showComments() && fragmentLayout != LAYOUT_TRIPLE ? View.VISIBLE : View.GONE);
}
private void setListsDropdownSelected(boolean selected) { private void setListsDropdownSelected(boolean selected) {
int oldTextColor = lists.getTextColors().getDefaultColor(); int oldTextColor = lists.getTextColors().getDefaultColor();
int textStyle = (selected ? R.style.TextAppearance_ActionBar_ListsHeader_Selected : int textStyle = (selected ? R.style.TextAppearance_ActionBar_ListsHeader_Selected :

@ -117,7 +117,7 @@ public class MainMenuPopover extends FragmentPopover implements InterceptTouchLi
ThemeService.getDrawable(R.drawable.icn_menu_lists, themeFlags), ThemeService.getDrawable(R.drawable.icn_menu_lists, themeFlags),
MAIN_MENU_ITEM_LISTS, null, topFixed); // Lists item MAIN_MENU_ITEM_LISTS, null, topFixed); // Lists item
if (Preferences.getBoolean(R.string.p_show_friends_view, false)) if (Preferences.getBoolean(R.string.p_show_friends_view, false) && Preferences.getBoolean(R.string.p_show_menu_friends, true))
addMenuItem(R.string.TLA_menu_friends, addMenuItem(R.string.TLA_menu_friends,
ThemeService.getDrawable(R.drawable.icn_menu_friends, themeFlags), ThemeService.getDrawable(R.drawable.icn_menu_friends, themeFlags),
MAIN_MENU_ITEM_FRIENDS, null, topFixed); MAIN_MENU_ITEM_FRIENDS, null, topFixed);

Loading…
Cancel
Save