From 5c9c438e28b6ad1a046e7ccbcfd764ebb5ac34b7 Mon Sep 17 00:00:00 2001
From: str4d <str4d@mail.i2p>
Date: Sat, 10 Aug 2013 01:40:22 +0000
Subject: [PATCH] Moved Addressbook button to navigation drawer

---
 res/layout/fragment_main.xml                         |  7 -------
 res/values/arrays.xml                                |  2 ++
 .../i2p/android/router/fragment/MainFragment.java    | 12 ------------
 3 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/res/layout/fragment_main.xml b/res/layout/fragment_main.xml
index 8cf86486b..f1ebe11ac 100644
--- a/res/layout/fragment_main.xml
+++ b/res/layout/fragment_main.xml
@@ -65,13 +65,6 @@
     android:text="@string/label_tools"
     android:textAppearance="?android:attr/textAppearanceMedium" />
 
-<Button
-    android:id="@+id/addressbook_button"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:text="@string/label_addressbook"
-    android:drawableLeft="@drawable/addressbook_icon" />
-
 <Button
     android:id="@+id/logs_button"
     android:layout_width="match_parent"
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index f747f55df..dd9e27093 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -2,9 +2,11 @@
 <resources>
     <string-array name="main_fragments">
         <item>net.i2p.android.router.fragment.MainFragment</item>
+        <item>net.i2p.android.router.fragment.AddressbookFragment</item>
     </string-array>
     <string-array name="main_fragment_titles">
         <item>@string/label_home</item>
+        <item>@string/label_addressbook</item>
     </string-array>
     <string-array name="setting0to3">
         <item>0</item>
diff --git a/src/net/i2p/android/router/fragment/MainFragment.java b/src/net/i2p/android/router/fragment/MainFragment.java
index 1c0d6418d..54d45c1f2 100644
--- a/src/net/i2p/android/router/fragment/MainFragment.java
+++ b/src/net/i2p/android/router/fragment/MainFragment.java
@@ -152,18 +152,6 @@ public class MainFragment extends I2PFragmentBase {
             }
         });
 
-        b = (Button) v.findViewById(R.id.addressbook_button);
-        b.setOnClickListener(new View.OnClickListener() {
-
-            public void onClick(View view) {
-                getActivity().getSupportFragmentManager()
-                             .beginTransaction()
-                             .replace(R.id.main_content, new AddressbookFragment())
-                             .addToBackStack(null)
-                             .commit();
-            }
-        });
-
         b = (Button) v.findViewById(R.id.logs_button);
         b.setOnClickListener(new View.OnClickListener() {
 
-- 
GitLab