Fix some two pane layout issues

pull/281/head
Alex Baker 11 years ago
parent 06d5d47700
commit 0fec8c9252

@ -273,7 +273,7 @@ public class TaskListFragment extends InjectingListFragment implements OnSortSel
parent.findViewById(R.id.fab).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (ActivityPreferences.isTabletSized(context)) {
if (getResources().getBoolean(R.bool.two_pane_layout)) {
Task task = quickAddBar.quickAddTask();
onTaskListItemClicked(task.getId());
} else {

@ -52,7 +52,7 @@ public class TasksWidget extends InjectingAppWidgetProvider {
broadcaster.toggleCompletedState(intent.getLongExtra(TaskEditFragment.TOKEN_ID, 0));
break;
case EDIT_TASK:
if(ActivityPreferences.isTabletSized(context)) {
if (context.getResources().getBoolean(R.bool.two_pane_layout)) {
intent.setClass(context, TaskListActivity.class);
} else {
intent.setClass(context, TaskEditActivity.class);

@ -14,14 +14,14 @@ import com.todoroo.astrid.activity.TaskListFragment;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterWithCustomIntent;
import org.tasks.preferences.ActivityPreferences;
import org.tasks.R;
public class TaskIntents {
public static Intent getNewTaskIntent(Context context, Filter filter) {
Intent intent;
boolean tablet = ActivityPreferences.isTabletSized(context);
if (tablet) {
boolean twoPaneLayout = context.getResources().getBoolean(R.bool.two_pane_layout);
if (twoPaneLayout) {
intent = new Intent(context, TaskListActivity.class);
intent.putExtra(TaskListActivity.OPEN_TASK, 0L);
} else {
@ -36,7 +36,7 @@ public class TaskIntents {
intent.putExtra(TaskEditFragment.TOKEN_VALUES, values);
intent.setAction("E" + values);
}
if (tablet) {
if (twoPaneLayout) {
if (filter instanceof FilterWithCustomIntent) {
Bundle customExtras = ((FilterWithCustomIntent) filter).customExtras;
intent.putExtras(customExtras);
@ -49,8 +49,8 @@ public class TaskIntents {
}
public static PendingIntent getEditTaskPendingIntent(Context context, final Filter filter, final long taskId) {
boolean tablet = ActivityPreferences.isTabletSized(context);
if (tablet) {
boolean twoPaneLayout = context.getResources().getBoolean(R.bool.two_pane_layout);
if (twoPaneLayout) {
Intent intent = new Intent(context, TaskListActivity.class) {{
putExtra(TaskListActivity.OPEN_TASK, taskId);
if (filter != null && filter instanceof FilterWithCustomIntent) {

@ -122,7 +122,7 @@ public class WidgetHelper {
private PendingIntent getEditTaskIntent(Context context, Filter filter, int widgetId) {
Intent intent = new Intent(context, TasksWidget.class);
if (ActivityPreferences.isTabletSized(context)) {
if (context.getResources().getBoolean(R.bool.two_pane_layout)) {
if (filter != null && filter instanceof FilterWithCustomIntent) {
Bundle customExtras = ((FilterWithCustomIntent) filter).customExtras;
intent.putExtras(customExtras);

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="two_pane_layout">true</bool>
</resources>

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="two_pane_layout">false</bool>
<bool name="at_most_honeycomb">true</bool>
<bool name="at_least_honeycomb_mr1">false</bool>
<bool name="billing_enabled">false</bool>

Loading…
Cancel
Save