protected boolean isCurrentTaskListFragment() { AstridActivity activity = (AstridActivity) getActivity(); if (activity != null) { return activity.getTaskListFragment() == this; } return false; }
protected void addMenuItem(Menu menu, int title, int imageRes, int id, boolean showAsAction) { AstridActivity activity = (AstridActivity) getActivity(); if ((activity.getFragmentLayout() != AstridActivity.LAYOUT_SINGLE && showAsAction) || !(activity instanceof TaskListActivity)) { MenuItem item = menu.add(Menu.NONE, id, Menu.NONE, title); item.setIcon(imageRes); if (activity instanceof TaskListActivity) item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); } else { ((TaskListActivity) activity).getMainMenuPopover().addMenuItem(title, imageRes, id); } }
protected void onTaskDelete(Task task) { Activity a = getActivity(); if (a instanceof AstridActivity) { AstridActivity activity = (AstridActivity) a; TaskEditFragment tef = activity.getTaskEditFragment(); if (tef != null) { if (task.getId() == tef.model.getId()) { tef.discardButtonClick(); } } } TimerPlugin.updateTimer(notificationManager, taskService, context, task, false); }
protected void onTaskDelete(Task task) { decrementFilterCount(); Activity a = getActivity(); if (a instanceof AstridActivity) { AstridActivity activity = (AstridActivity) a; TaskEditFragment tef = activity.getTaskEditFragment(); if (tef != null) { if (task.getId() == tef.model.getId()) tef.discardButtonClick(); } } TimerPlugin.updateTimer(getActivity(), task, false); }
private void showListsHelp() { if (!AstridPreferences.canShowPopover()) return; if (!Preferences.getBoolean(R.string.p_showed_lists_help, false)) { AstridActivity activity = (AstridActivity) getActivity(); if (activity != null) { if (AstridPreferences.useTabletLayout(activity)) { FilterListFragment flf = activity.getFilterListFragment(); if (flf != null) flf.showAddListPopover(); } else { ActionBar ab = activity.getSupportActionBar(); View anchor = ab.getCustomView().findViewById(R.id.lists_nav); HelpInfoPopover.showPopover(activity, anchor, R.string.help_popover_switch_lists, null); } Preferences.setBoolean(R.string.p_showed_lists_help, true); } } }
/* (non-Javadoc) * @see android.support.v4.app.FragmentActivity#onResume() */ @Override protected void onResume() { super.onResume(); Fragment frag = getSupportFragmentManager().findFragmentByTag(TaskListFragment.TAG_TASKLIST_FRAGMENT); if (frag == null) { fragmentLayout = LAYOUT_SINGLE; } }
/** @see android.app.Activity#onCreate(Bundle) */ @Override protected void onCreate(Bundle savedInstanceState) { ThemeService.applyTheme(this); super.onCreate(savedInstanceState); setContentView(R.layout.task_edit_wrapper_activity); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar.setCustomView(R.layout.header_title_view); ((TextView) actionBar.getCustomView().findViewById(R.id.title)) .setText(R.string.TAd_contextEditTask); }
/** @see android.app.Activity#onCreate(Bundle) */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); preferences.applyThemeAndStatusBarColor(); setContentView(R.layout.task_edit_wrapper_activity); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowTitleEnabled(false); toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp); } }
@Override public void finish() { super.finish(); AndroidUtilities.callOverridePendingTransition( this, R.anim.slide_right_in, R.anim.slide_right_out); }