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_SINGLE = 0;
public static final int LAYOUT_DOUBLE = 1; public static final int LAYOUT_DOUBLE = 1;
public static final int LAYOUT_TRIPLE = 2;
public static final int RESULT_RESTART_ACTIVITY = 50; public static final int RESULT_RESTART_ACTIVITY = 50;
@ -135,7 +134,7 @@ public class AstridActivity extends ActionBarActivity
Filter filter = (Filter)item; Filter filter = (Filter)item;
Bundle extras = configureIntentAndExtrasWithFilter(intent, filter); 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 onBackPressed(); // remove the task edit fragment when switching between lists
} }
setupTasklistFragmentWithFilter(filter, extras); setupTasklistFragmentWithFilter(filter, extras);
@ -170,7 +169,7 @@ public class AstridActivity extends ActionBarActivity
return; return;
} }
if (fragmentLayout == LAYOUT_TRIPLE) { if (fragmentLayout == LAYOUT_DOUBLE) {
findViewById(R.id.taskedit_fragment_container).setVisibility(View.VISIBLE); findViewById(R.id.taskedit_fragment_container).setVisibility(View.VISIBLE);
} }
FragmentManager manager = getSupportFragmentManager(); 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() { public int getFragmentLayout() {
return fragmentLayout; return fragmentLayout;

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

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

Loading…
Cancel
Save