diff --git a/AndroidManifest.xml.in b/AndroidManifest.xml.in index 0f97568590396b510b3caaf4dd75fcbc59718f63..6ea5c3f436f9ff6e0fc5310d96ac0ae8da56641c 100644 --- a/AndroidManifest.xml.in +++ b/AndroidManifest.xml.in @@ -66,7 +66,8 @@ android:resource="@xml/searchable_addressbook"/> </activity> <activity android:name=".activity.LogActivity" - android:label="I2P Logs" > + android:label="I2P Logs" + android:parentActivityName=".activity.MainActivity" > </activity> <activity android:name=".activity.PeersActivity" android:label="I2P Peers and Transport Status" diff --git a/res/layout/fragment_main.xml b/res/layout/fragment_main.xml index 3571f3ddcf666c2e2b6d0db2ee658a98e2e542c4..caffbcbf1d84cee15c1c8fb0564a54dd3b828259 100644 --- a/res/layout/fragment_main.xml +++ b/res/layout/fragment_main.xml @@ -66,20 +66,6 @@ android:text="@string/label_tools" android:textAppearance="?android:attr/textAppearanceMedium" /> -<Button - android:id="@+id/logs_button" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/label_logs" - android:drawableLeft="@drawable/log_icon" /> - -<Button - android:id="@+id/error_button" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/label_error_logs" - android:drawableLeft="@drawable/error_log_icon" /> - <Button android:id="@+id/peers_button" android:layout_width="match_parent" diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 1e96579d7c323ec40ade4efe8ab8fab23c82c366..0fdd1d8fdc058cc0535e5a2c702c501fe29529e9 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -3,6 +3,8 @@ <string-array name="navdrawer_activity_titles"> <item>@string/label_home</item> <item>@string/label_addressbook</item> + <item>@string/label_logs</item> + <item>@string/label_error_logs</item> <item>@string/label_licenses</item> </string-array> <string-array name="setting0to3"> diff --git a/src/net/i2p/android/router/activity/I2PActivityBase.java b/src/net/i2p/android/router/activity/I2PActivityBase.java index 5864f7e42f7b0717633053a9efd7b88b3f266d45..0275f14271aa38bf4f184c550e919cbff042d22d 100644 --- a/src/net/i2p/android/router/activity/I2PActivityBase.java +++ b/src/net/i2p/android/router/activity/I2PActivityBase.java @@ -25,11 +25,6 @@ public class I2PActivityBase extends ActionBarActivity { private CharSequence mDrawerTitle; private CharSequence mTitle; - private static final Class[] mActivities = { - MainActivity.class, - AddressbookActivity.class, - LicenseActivity.class, - }; private String[] mActivityTitles; @Override @@ -102,8 +97,29 @@ public class I2PActivityBase extends ActionBarActivity { } private void selectItem(int pos) { - Intent i = new Intent(I2PActivityBase.this, mActivities[pos]); - startActivity(i); + switch (pos) { + case 1: + Intent ab = new Intent(I2PActivityBase.this, AddressbookActivity.class); + startActivity(ab); + break; + case 2: + Intent log = new Intent(I2PActivityBase.this, LogActivity.class); + startActivity(log); + break; + case 3: + Intent err = new Intent(I2PActivityBase.this, LogActivity.class); + err.putExtra(LogActivity.ERRORS_ONLY, true); + startActivity(err); + break; + case 4: + Intent lic = new Intent(I2PActivityBase.this, LicenseActivity.class); + startActivity(lic); + break; + default: + Intent main = new Intent(I2PActivityBase.this, MainActivity.class); + startActivity(main); + break; + } mDrawerLayout.closeDrawer(mDrawerList); } diff --git a/src/net/i2p/android/router/fragment/MainFragment.java b/src/net/i2p/android/router/fragment/MainFragment.java index b60e430150b12b3b4d4b4e3ced016c2fc1c05a55..e2eba47d72d4041db733073f1fda8891f4052f2c 100644 --- a/src/net/i2p/android/router/fragment/MainFragment.java +++ b/src/net/i2p/android/router/fragment/MainFragment.java @@ -136,25 +136,6 @@ public class MainFragment extends I2PFragmentBase { } }); - b = (Button) v.findViewById(R.id.logs_button); - b.setOnClickListener(new View.OnClickListener() { - - public void onClick(View view) { - Intent intent = new Intent(view.getContext(), LogActivity.class); - startActivity(intent); - } - }); - - b = (Button) v.findViewById(R.id.error_button); - b.setOnClickListener(new View.OnClickListener() { - - public void onClick(View view) { - Intent intent = new Intent(view.getContext(), LogActivity.class); - intent.putExtra(LogActivity.ERRORS_ONLY, true); - startActivity(intent); - } - }); - b = (Button) v.findViewById(R.id.peers_button); b.setOnClickListener(new View.OnClickListener() {