Update tablet layout

* Remove triple column layout
* Remove static menu drawer
pull/73/head
Alex Baker 12 years ago
parent 017cceeff9
commit 3e16830ae8

@ -62,7 +62,6 @@ public class AstridActivity extends ActionBarActivity
public static final int LAYOUT_SINGLE = 0;
public static final int LAYOUT_DOUBLE = 1;
public static final int LAYOUT_TRIPLE = 2;
public static final int RESULT_RESTART_ACTIVITY = 50;
@ -135,7 +134,7 @@ public class AstridActivity extends ActionBarActivity
Filter filter = (Filter)item;
Bundle extras = configureIntentAndExtrasWithFilter(intent, filter);
if (fragmentLayout == LAYOUT_TRIPLE && getTaskEditFragment() != null) {
if (fragmentLayout == LAYOUT_DOUBLE && getTaskEditFragment() != null) {
onBackPressed(); // remove the task edit fragment when switching between lists
}
setupTasklistFragmentWithFilter(filter, extras);
@ -170,7 +169,7 @@ public class AstridActivity extends ActionBarActivity
return;
}
if (fragmentLayout == LAYOUT_TRIPLE) {
if (fragmentLayout == LAYOUT_DOUBLE) {
findViewById(R.id.taskedit_fragment_container).setVisibility(View.VISIBLE);
}
FragmentManager manager = getSupportFragmentManager();
@ -358,7 +357,7 @@ public class AstridActivity extends ActionBarActivity
}
/**
* @return LAYOUT_SINGLE, LAYOUT_DOUBLE, or LAYOUT_TRIPLE
* @return LAYOUT_SINGLE or LAYOUT_DOUBLE
*/
public int getFragmentLayout() {
return fragmentLayout;

@ -48,9 +48,7 @@ public class TaskEditActivity extends AstridActivity {
Fragment frag = getSupportFragmentManager()
.findFragmentByTag(TaskListFragment.TAG_TASKLIST_FRAGMENT);
if (frag != null) {
fragmentLayout = LAYOUT_DOUBLE;
} else {
if (frag == null) {
fragmentLayout = LAYOUT_SINGLE;
}
}

@ -5,7 +5,6 @@
*/
package com.todoroo.astrid.activity;
import android.animation.LayoutTransition;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.SearchManager;
@ -20,13 +19,11 @@ import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout;
import com.todoroo.andlib.sql.QueryTemplate;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.CommentsFragment;
import com.todoroo.astrid.actfm.TagSettingsActivity;
import com.todoroo.astrid.actfm.TagViewFragment;
@ -92,14 +89,8 @@ public class TaskListActivity extends AstridActivity implements OnPageChangeList
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setLogo(null);
if(AndroidUtilities.isTabletSized(this)) {
menuDrawer = MenuDrawer.attach(this, MenuDrawer.Type.STATIC);
menuDrawer.setDropShadowEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(false);
} else {
menuDrawer = MenuDrawer.attach(this, MenuDrawer.Type.OVERLAY);
menuDrawer.setDrawerIndicatorEnabled(true);
}
menuDrawer = MenuDrawer.attach(this, MenuDrawer.Type.OVERLAY);
menuDrawer.setDrawerIndicatorEnabled(true);
menuDrawer.setContentView(contentView);
// cannot use full screen until next menudrawer release
// menuDrawer.setTouchMode(MenuDrawer.TOUCH_MODE_FULLSCREEN);
@ -189,14 +180,7 @@ public class TaskListActivity extends AstridActivity implements OnPageChangeList
updateFilterModeSpec(filterMode);
if(editFragment != null) {
if(editFragment.getVisibility() == View.INVISIBLE) {
fragmentLayout = LAYOUT_TRIPLE;
} else {
fragmentLayout = LAYOUT_DOUBLE;
if (AndroidUtilities.getSdkVersion() >= 11) {
setupLayoutTransitions();
}
}
fragmentLayout = LAYOUT_DOUBLE;
} else {
fragmentLayout = LAYOUT_SINGLE;
}
@ -205,12 +189,6 @@ public class TaskListActivity extends AstridActivity implements OnPageChangeList
filterModeSpec.getFilterListClass()));
}
private void setupLayoutTransitions() {
LayoutTransition transition = new LayoutTransition();
ViewGroup container = (ViewGroup) findViewById(R.id.right_column);
container.setLayoutTransition(transition);
}
private void setupPopoverWithFragment(Fragment frag) {
View view = frag.getView();
if (view != null) {
@ -242,7 +220,7 @@ public class TaskListActivity extends AstridActivity implements OnPageChangeList
public void setupActivityFragment(TagData tagData) {
super.setupActivityFragment(tagData);
if (fragmentLayout == LAYOUT_TRIPLE) {
if (fragmentLayout == LAYOUT_DOUBLE) {
View container = findViewById(R.id.taskedit_fragment_container);
if (container != null) {
container.setVisibility(View.VISIBLE);
@ -343,9 +321,6 @@ public class TaskListActivity extends AstridActivity implements OnPageChangeList
// manage task edit visibility
View taskeditFragmentContainer = findViewById(R.id.taskedit_fragment_container);
if(taskeditFragmentContainer != null && taskeditFragmentContainer.getVisibility() == View.VISIBLE) {
if(fragmentLayout == LAYOUT_DOUBLE) {
findViewById(R.id.taskedit_fragment_container).setVisibility(View.GONE);
}
Flags.set(Flags.TLA_DISMISSED_FROM_TASK_EDIT);
onPostResume();

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/Content"
android:orientation="horizontal">
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="?attr/asSeparatorBackground"/>
<!-- Task List -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="30"
android:id="@+id/tasklist_fragment_container" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="?attr/asSeparatorBackground"/>
<!-- Task Edit -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="35"
android:id="@+id/taskedit_fragment_container"
android:visibility="invisible" />
</LinearLayout>

@ -16,26 +16,24 @@
android:layout_height="match_parent"
android:background="?attr/asSeparatorBackground"/>
<LinearLayout
android:id="@+id/right_column"
<!-- Task List -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="40"
android:orientation="vertical">
<!-- Task List -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="50"
android:id="@+id/tasklist_fragment_container" />
<!-- Task Edit -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/taskedit_fragment_container"
android:visibility="gone" />
</LinearLayout>
android:layout_weight="60"
android:id="@+id/tasklist_fragment_container" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="?attr/asSeparatorBackground"/>
<!-- Task Edit -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="40"
android:id="@+id/taskedit_fragment_container"
android:visibility="invisible" />
</LinearLayout>

Loading…
Cancel
Save