mirror of https://github.com/tasks/tasks
Got rid of DisposableTaskListFragment, it was causing crashes :(
parent
f6be6998cc
commit
ff5d592785
@ -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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue