diff --git a/res/layout/activity_navdrawer_twopane.xml b/res/layout/activity_navdrawer_twopane.xml index 2044e277d9da46ea38b49ad18e88cead9ecbd392..eb11f12cfb935422d738de387c02916c5840c3ae 100644 --- a/res/layout/activity_navdrawer_twopane.xml +++ b/res/layout/activity_navdrawer_twopane.xml @@ -33,7 +33,7 @@ android:id="@+id/detail_fragment" android:layout_width="0dp" android:layout_height="match_parent" - android:layout_weight="3" /> + android:layout_weight="2" /> </LinearLayout> diff --git a/src/net/i2p/android/router/activity/AddressbookActivity.java b/src/net/i2p/android/router/activity/AddressbookActivity.java index 22149cc72d1484684283bc5b141a21f44358210d..a85dd7603d68eeda35b3d027fe12fc85bae28dd0 100644 --- a/src/net/i2p/android/router/activity/AddressbookActivity.java +++ b/src/net/i2p/android/router/activity/AddressbookActivity.java @@ -15,9 +15,29 @@ import android.view.MenuItem; public class AddressbookActivity extends I2PActivityBase implements AddressbookFragment.OnAddressSelectedListener, SearchView.OnQueryTextListener { + /** + * Whether or not the activity is in two-pane mode, i.e. running on a tablet + * device. + */ + private boolean mTwoPane; + + @Override + protected boolean canUseTwoPanes() { + return true; + } + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + if (findViewById(R.id.detail_fragment) != null) { + // The detail container view will be present only in the + // large-screen layouts (res/values-large and + // res/values-sw600dp). If this view is present, then the + // activity should be in two-pane mode. + mTwoPane = true; + } + // Start with the base view if (savedInstanceState == null) { AddressbookFragment f = new AddressbookFragment();