Got rid of DisposableTaskListFragment, it was causing crashes :(

pull/14/head
Sam Bosley 12 years ago
parent f6be6998cc
commit ff5d592785

@ -26,7 +26,7 @@ import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.activity.AstridActivity;
import com.todoroo.astrid.activity.DisposableTaskListFragment;
import com.todoroo.astrid.activity.TaskListFragment;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.repeats.RepeatControlSet;
import com.todoroo.astrid.service.StatisticsConstants;
@ -40,7 +40,7 @@ import com.todoroo.astrid.ui.NumberPicker;
* @author timsu
*
*/
public class NotificationFragment extends DisposableTaskListFragment {
public class NotificationFragment extends TaskListFragment {
// --- constants

@ -12,10 +12,10 @@ import android.view.ViewGroup;
import android.widget.TextView;
import com.timsu.astrid.R;
import com.todoroo.astrid.activity.DisposableTaskListFragment;
import com.todoroo.astrid.activity.TaskListFragment;
import com.todoroo.astrid.service.ThemeService;
public class ReengagementFragment extends DisposableTaskListFragment {
public class ReengagementFragment extends TaskListFragment {
public static final String EXTRA_TEXT = "dialogText"; //$NON-NLS-1$

@ -1,36 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.activity;
import android.app.Activity;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.adapter.TaskListFragmentPagerAdapter;
/**
* Task list fragment that will remove itself from the filterlist/fragment pager when it is detached
* @author Sam
*
*/
public class DisposableTaskListFragment extends TaskListFragment {
@Override
public void onDetach() {
Activity activity = getActivity();
if (activity instanceof TaskListActivity &&
Preferences.getBoolean(R.string.p_swipe_lists_enabled, false)) {
TaskListActivity tla = (TaskListActivity) activity;
if (tla.getFragmentLayout() == AstridActivity.LAYOUT_SINGLE) {
TaskListFragmentPagerAdapter adapter = tla.getFragmentPagerAdapter();
if (adapter != null && adapter.getPosition(filter) >= 0)
adapter.remove(filter);
}
}
super.onDetach();
}
}

@ -402,10 +402,6 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
setCommentsCount(0);
if (swipeIsEnabled()) {
TaskListFragment currentFragment = getTaskListFragment();
if (currentFragment instanceof DisposableTaskListFragment) {
tlfPagerAdapter.remove(currentFragment.filter);
}
TaskListFragmentPager.showSwipeBetweenHelper(this);
tlfPager.showFilter((Filter) item);
return true;

Loading…
Cancel
Save