gui: Convert UI to use Fragments
Change-Id: I7269604a1da72e6b22f4bbac31c1f5561660ccf5
Refs: #2646, #2667
diff --git a/app/src/main/res/drawable/custom_white_button.xml b/app/src/main/res/drawable/custom_white_button.xml
new file mode 100644
index 0000000..8edfc54
--- /dev/null
+++ b/app/src/main/res/drawable/custom_white_button.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_pressed="true"
+ android:drawable="@android:color/darker_gray"
+ />
+ <item
+ android:state_pressed="false"
+ android:drawable="@android:color/transparent"
+ />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/drawer_item_background_activated.xml b/app/src/main/res/drawable/drawer_item_background_activated.xml
new file mode 100644
index 0000000..1b497c0
--- /dev/null
+++ b/app/src/main/res/drawable/drawer_item_background_activated.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_activated="true"
+ android:drawable="@color/ndn_color_fire_bush"
+ />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/face_list_item_background_activated.xml b/app/src/main/res/drawable/face_list_item_background_activated.xml
new file mode 100644
index 0000000..f6a9b13
--- /dev/null
+++ b/app/src/main/res/drawable/face_list_item_background_activated.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_activated="true"
+ android:drawable="@android:color/darker_gray"
+ />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/item_background_activated.xml b/app/src/main/res/drawable/item_background_activated.xml
new file mode 100644
index 0000000..f6a9b13
--- /dev/null
+++ b/app/src/main/res/drawable/item_background_activated.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_activated="true"
+ android:drawable="@android:color/darker_gray"
+ />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_fragment.xml b/app/src/main/res/layout/activity_fragment.xml
new file mode 100644
index 0000000..98ee139
--- /dev/null
+++ b/app/src/main/res/layout/activity_fragment.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/fragment_container"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ >
+
+</FrameLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..6d8b08a
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v4.widget.DrawerLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/drawer_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context=".MainActivity">
+
+ <!-- Main container for fragments to be presented in -->
+ <FrameLayout
+ android:id="@+id/main_fragment_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ />
+
+ <!-- DrawerFragment for user navigation -->
+ <FrameLayout
+ android:id="@+id/navigation_drawer"
+ android:layout_width="@dimen/drawer_width"
+ android:layout_height="match_parent"
+ android:layout_gravity="start"
+ tools:layout="@layout/activity_main_drawer_listview"
+ />
+
+</android.support.v4.widget.DrawerLayout>
diff --git a/app/src/main/res/layout/activity_main_drawer_listview.xml b/app/src/main/res/layout/activity_main_drawer_listview.xml
new file mode 100644
index 0000000..7ca3700
--- /dev/null
+++ b/app/src/main/res/layout/activity_main_drawer_listview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:choiceMode="singleChoice"
+ android:divider="@android:color/transparent"
+ android:dividerHeight="0dp"
+ android:background="#cccc"
+ tools:context=".DrawerFragment"
+/>
diff --git a/app/src/main/res/layout/create_face.xml b/app/src/main/res/layout/create_face.xml
index 6588dcc..02d40a6 100644
--- a/app/src/main/res/layout/create_face.xml
+++ b/app/src/main/res/layout/create_face.xml
@@ -7,7 +7,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- style="@style/dialog_margin"
+ style="@style/default_dialog_margin"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Enter FaceUri for the remote NDN daemon"
android:layout_gravity="center_horizontal"/>
@@ -16,7 +16,7 @@
android:id="@+id/faceUri"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/dialog_margin"
+ style="@style/default_dialog_margin"
android:hint="Face URI"
android:inputType="text"
android:focusable="true"
diff --git a/app/src/main/res/layout/create_route.xml b/app/src/main/res/layout/create_route.xml
index ddf7fb2..67c7677 100644
--- a/app/src/main/res/layout/create_route.xml
+++ b/app/src/main/res/layout/create_route.xml
@@ -7,7 +7,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- style="@style/dialog_margin"
+ style="@style/default_dialog_margin"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Enter prefix and FaceUri to register with NDN daemon"
android:layout_gravity="center_horizontal"/>
@@ -16,7 +16,7 @@
android:id="@+id/prefix"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/dialog_margin"
+ style="@style/default_dialog_margin"
android:hint="Prefix"
android:inputType="text"
android:focusable="true"
@@ -29,7 +29,7 @@
android:id="@+id/faceUri"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/dialog_margin"
+ style="@style/default_dialog_margin"
android:hint="Face URI"
android:inputType="text"
android:focusable="true"
diff --git a/app/src/main/res/layout/face_status_item.xml b/app/src/main/res/layout/face_status_item.xml
deleted file mode 100644
index 9fd2a6b..0000000
--- a/app/src/main/res/layout/face_status_item.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="10dp">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="Title"
- android:id="@+id/title"
- android:textColor="@android:color/primary_text_light"/>
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="Value"
- android:id="@+id/value"
- android:textAlignment="gravity"
- android:gravity="right"
- android:textColor="@android:color/secondary_text_dark"
- android:layout_gravity="right"/>
-</LinearLayout>
diff --git a/app/src/main/res/layout/fragment_face_detail.xml b/app/src/main/res/layout/fragment_face_detail.xml
new file mode 100644
index 0000000..c251036
--- /dev/null
+++ b/app/src/main/res/layout/fragment_face_detail.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ style="@style/default_linear_layout_padding"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/fragment_face_details_title"
+ style="?android:listSeparatorTextViewStyle"
+ />
+
+ <include
+ layout="@android:layout/list_content"
+ />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_face_list.xml b/app/src/main/res/layout/fragment_face_list.xml
new file mode 100644
index 0000000..f7c2388
--- /dev/null
+++ b/app/src/main/res/layout/fragment_face_list.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ style="@style/default_linear_layout_padding"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/face_list_actions_title"
+ style="?android:listSeparatorTextViewStyle"
+ />
+
+ <Button
+ android:id="@+id/face_list_refresh_button"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/face_list_refresh_face_list"
+ style="@style/default_custom_white_button"
+ />
+ <Button
+ android:id="@+id/face_list_add_button"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/face_list_add_face"
+ style="@style/default_custom_white_button"
+ />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/face_list_list_of_faces_title"
+ style="?android:listSeparatorTextViewStyle"
+ />
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ >
+
+ <ProgressBar
+ android:id="@+id/face_list_reloading_list_progress_bar"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone"
+ />
+
+ <LinearLayout
+ android:id="@+id/face_list_info_unavailable"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:visibility="gone"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/oops"
+ />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/error_cannot_communicate_with_nfd"
+ />
+
+ </LinearLayout>
+
+ <include
+ layout="@android:layout/list_content"
+ />
+
+ </FrameLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_log.xml b/app/src/main/res/layout/fragment_logcat_output.xml
similarity index 100%
rename from app/src/main/res/layout/activity_log.xml
rename to app/src/main/res/layout/fragment_logcat_output.xml
diff --git a/app/src/main/res/layout/fragment_logcat_tags_list.xml b/app/src/main/res/layout/fragment_logcat_tags_list.xml
new file mode 100644
index 0000000..2688e0d
--- /dev/null
+++ b/app/src/main/res/layout/fragment_logcat_tags_list.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ style="@style/default_linear_layout_padding"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/fragment_logcat_general_operations_category"
+ style="?android:listSeparatorTextViewStyle"
+ />
+
+ <Button
+ android:id="@+id/logcat_reset_loglevel_defaults"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/logcat_reset_log_level_defaults"
+ style="@style/default_custom_white_button"
+ />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/fragment_logcat_tags_n_log_levels"
+ style="?android:listSeparatorTextViewStyle"
+ />
+
+ <include
+ layout="@android:layout/list_content"
+ />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml
new file mode 100644
index 0000000..9fa4afa
--- /dev/null
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ style="@style/default_linear_layout_padding"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/pref_category_title_general"
+ style="?android:listSeparatorTextViewStyle"
+ />
+
+ <Switch
+ android:id="@+id/nfd_start_stop_switch"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:text="@string/checking_on_nfd"
+ />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_route_list.xml b/app/src/main/res/layout/fragment_route_list.xml
new file mode 100644
index 0000000..b1d481b
--- /dev/null
+++ b/app/src/main/res/layout/fragment_route_list.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ style="@style/default_linear_layout_padding"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/route_list_actions_title"
+ style="?android:listSeparatorTextViewStyle"
+ />
+
+ <Button
+ android:id="@+id/route_list_refresh_button"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/route_list_refresh_route_list"
+ style="@style/default_custom_white_button"
+ />
+ <Button
+ android:id="@+id/route_list_add_button"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/route_list_add_route"
+ style="@style/default_custom_white_button"
+ />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/route_list_list_of_routes_title"
+ style="?android:listSeparatorTextViewStyle"
+ />
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ >
+
+ <ProgressBar
+ android:id="@+id/route_list_reloading_list_progress_bar"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone"
+ />
+
+ <LinearLayout
+ android:id="@+id/route_list_info_unavailable"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:visibility="gone"
+ >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/oops"
+ />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/error_cannot_communicate_with_nfd"
+ />
+
+ </LinearLayout>
+
+ <include
+ layout="@android:layout/list_content"
+ />
+
+ </FrameLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_item_drawer_item.xml b/app/src/main/res/layout/list_item_drawer_item.xml
new file mode 100644
index 0000000..08a598b
--- /dev/null
+++ b/app/src/main/res/layout/list_item_drawer_item.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/drawer_item_background_activated"
+ android:paddingLeft="@dimen/default_padding_left"
+ android:paddingRight="@dimen/default_padding_right"
+ >
+
+ <ImageView
+ android:id="@+id/drawer_item_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ />
+
+ <TextView
+ android:id="@+id/drawer_item_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceListItemSmall"
+ android:minHeight="?android:attr/listPreferredItemHeightSmall"
+ android:gravity="center_vertical"
+ />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_item_face_generic_item.xml b/app/src/main/res/layout/list_item_face_generic_item.xml
new file mode 100644
index 0000000..7683c68
--- /dev/null
+++ b/app/src/main/res/layout/list_item_face_generic_item.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
+
+ <TextView
+ android:id="@+id/list_item_generic_title"
+ android:text="Title"
+ style="@style/two_column_item_title"
+ />
+
+ <TextView
+ android:id="@+id/list_item_generic_value"
+ android:text="Value"
+ style="@style/two_column_item_secondary"
+ />
+
+</LinearLayout>
diff --git a/app/src/main/res/layout/list_item_face_status_item.xml b/app/src/main/res/layout/list_item_face_status_item.xml
new file mode 100644
index 0000000..0b6a1d0
--- /dev/null
+++ b/app/src/main/res/layout/list_item_face_status_item.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/item_background_activated"
+ >
+
+ <TextView
+ android:id="@+id/list_item_face_uri"
+ android:text="FaceUri"
+ style="@style/two_row_item_title"
+ />
+
+ <TextView
+ android:id="@+id/list_item_face_id"
+ android:text="FaceId"
+ style="@style/two_row_item_secondary"
+ />
+
+</LinearLayout>
diff --git a/app/src/main/res/layout/log_item.xml b/app/src/main/res/layout/list_item_log.xml
similarity index 100%
rename from app/src/main/res/layout/log_item.xml
rename to app/src/main/res/layout/list_item_log.xml
diff --git a/app/src/main/res/layout/list_item_route_item.xml b/app/src/main/res/layout/list_item_route_item.xml
new file mode 100644
index 0000000..baa6da0
--- /dev/null
+++ b/app/src/main/res/layout/list_item_route_item.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/item_background_activated"
+ >
+
+ <TextView
+ android:id="@+id/list_item_route_uri"
+ android:text="Route"
+ style="@style/two_row_item_title"
+ />
+
+ <TextView
+ android:id="@+id/list_item_face_list"
+ android:text="Faces"
+ style="@style/two_row_item_secondary"
+ />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_item_setting_item.xml b/app/src/main/res/layout/list_item_setting_item.xml
new file mode 100644
index 0000000..4d8498b
--- /dev/null
+++ b/app/src/main/res/layout/list_item_setting_item.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/item_background_activated"
+ >
+
+ <TextView
+ android:id="@+id/list_item_log_tag"
+ style="@style/two_row_item_title"
+ />
+
+ <TextView
+ android:id="@+id/list_item_setting_log_level"
+ style="@style/two_row_item_secondary"
+ />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_face_list_multiple_modal_menu.xml b/app/src/main/res/menu/menu_face_list_multiple_modal_menu.xml
new file mode 100644
index 0000000..1664611
--- /dev/null
+++ b/app/src/main/res/menu/menu_face_list_multiple_modal_menu.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <item
+ android:id="@+id/menu_item_delete_face_item"
+ android:icon="@android:drawable/ic_menu_delete"
+ android:title="@string/menu_item_delete_face_item"
+ app:showAsAction="ifRoom|withText"
+ />
+
+</menu>
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_log.xml b/app/src/main/res/menu/menu_log.xml
index b749bbe..a530929 100644
--- a/app/src/main/res/menu/menu_log.xml
+++ b/app/src/main/res/menu/menu_log.xml
@@ -7,6 +7,7 @@
android:id="@+id/action_log_settings"
android:title="@string/log_settings"
android:orderInCategory="100"
- app:showAsAction="never" />
+ app:showAsAction="never"
+ />
</menu>
diff --git a/app/src/main/res/menu/menu_logcat_settings_multiple_modal_menu.xml b/app/src/main/res/menu/menu_logcat_settings_multiple_modal_menu.xml
new file mode 100644
index 0000000..2bbf336
--- /dev/null
+++ b/app/src/main/res/menu/menu_logcat_settings_multiple_modal_menu.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <item
+ android:id="@+id/menu_item_delete_setting_item"
+ android:icon="@android:drawable/ic_menu_delete"
+ android:title="@string/menu_item_delete_setting_item"
+ app:showAsAction="ifRoom|withText"
+ />
+
+</menu>
\ No newline at end of file
diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml
new file mode 100644
index 0000000..a125d29
--- /dev/null
+++ b/app/src/main/res/values-sw600dp/dimens.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <dimen name="default_padding_left">48dp</dimen>
+ <dimen name="default_padding_right">48dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..92b2b4b
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <item name="ndn_color_fire_bush" type="color">#DB9710</item>
+ <item name="ndn_color_grenadier" type="color">#C04818</item>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 47c8224..5d96952 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -2,4 +2,8 @@
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
+
+ <dimen name="default_padding_left">16dp</dimen>
+ <dimen name="default_padding_right">16dp</dimen>
+ <dimen name="drawer_width">192dp</dimen>
</resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index a8f78fd..dc86688 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -2,15 +2,56 @@
<string name="app_name">NFD</string>
<string name="service_name">NFD Service</string>
<string name="action_settings">Settings</string>
- <string name="stop_nfd">Stop NFD</string>
- <string name="start_nfd">Start NFD</string>
- <string name="reconnecting_to_nfd">Please wait while we connect to the NFD Service.</string>
- <string name="stopping_nfd">Stopping NFD ...</string>
- <string name="starting_nfd">Starting NFD ...</string>
- <string name="reconnect_to_nfd">Reconnecting to NFD Service</string>
- <string name="loading_logger">Loading logger ...</string>
- <string name="nfd_logger">NFD Logger</string>
+ <string name="nfd_stopped">NFD is stopped</string>
+ <string name="nfd_started">NFD is started</string>
+ <string name="stopping_nfd">Stopping NFD …</string>
+ <string name="starting_nfd">Starting NFD …</string>
+ <string name="reconnect_to_nfd">Reconnecting to NFD Service …</string>
+ <string name="loading_logger">Loading logger …</string>
<string name="log_settings">Log Settings</string>
- <string name="nfd_log_settings">NFD Log Settings</string>
- <string name="checking_on_nfd">Checking on NFD Service ...</string>
+ <string name="checking_on_nfd">Checking on NFD Service …</string>
+ <string name="accessibility_open_drawer">Open NFD Navigation Drawer</string>
+ <string name="accessibility_close_drawer">Close NFD Navigation Drawer</string>
+ <string name="drawer_item_general">General</string>
+ <string name="drawer_item_faces">Faces</string>
+ <string name="drawer_item_routes">Routes</string>
+ <string name="drawer_item_strategies">Strategies</string>
+ <string name="drawer_item_logcat">Logcat</string>
+ <string name="menu_item_delete_setting_item">Delete</string>
+ <string name="fragment_logcat_general_operations_category">General Actions</string>
+ <string name="fragment_logcat_tags_n_log_levels">Tags & Log Levels</string>
+ <string name="logcat_reset_log_level_defaults">Reset Log Level Defaults</string>
+ <string name="reset_log_level_dialog_title">Select default value for all tags</string>
+ <string name="route_list_actions_title">Route List Actions</string>
+ <string name="oops">Oops!</string>
+ <string name="error_cannot_communicate_with_nfd">Not available, check that NFD is started</string>
+ <string name="route_list_list_of_routes_title">List of Routes</string>
+ <string name="route_list_refresh_route_list">Refresh Route List</string>
+ <string name="route_list_add_route">Add Route</string>
+ <string name="face_list_actions_title">Face List Actions</string>
+ <string name="face_list_refresh_face_list">Refresh Face List</string>
+ <string name="face_list_add_face">Add Face</string>
+ <string name="face_list_list_of_faces_title">List of Faces</string>
+ <string name="fragment_face_details_title">Face Details</string>
+ <string name="menu_item_delete_face_item">Delete</string>
+ <string name="expire_never">Never</string>
+
+ <string-array name="face_scopes">
+ <item>Local</item>
+ <item>Non-local</item>
+ </string-array>
+
+ <string-array name="face_persistency">
+ <item>Persistent</item>
+ <item>On-demand</item>
+ <item>Permanent</item>
+ </string-array>
+
+ <string-array name="face_link_types">
+ <item>Point-to-point</item>
+ <item>Multi-access</item>
+ </string-array>
+
+ <string name="face_add_dialog_create_face">Create face</string>
+ <string name="route_add_dialog_create_route">Create route</string>
</resources>
diff --git a/app/src/main/res/values/strings_logcat_settings_activity.xml b/app/src/main/res/values/strings_logcat_settings_activity.xml
index 36e89a7..47d5221 100644
--- a/app/src/main/res/values/strings_logcat_settings_activity.xml
+++ b/app/src/main/res/values/strings_logcat_settings_activity.xml
@@ -2,56 +2,8 @@
<!-- Strings related to NFD Log Settings -->
- <!-- Set all tags log level -->
- <string name="pref_tags_log_level_title_key">All_Log_Levels_Key</string>
- <string name="pref_tags_log_level_title">All Log Levels</string>
- <string name="pref_tags_log_level_key">Reset_All_Tags_Log_Level_Key</string>
- <string name="pref_tags_log_level">Reset</string>
-
- <!-- Tags -->
- <string name="pref_category_title_tags">NFD Tags & Log Levels</string>
- <string name="pref_category_title_tags_key">NFD_Tags_Key</string>
-
- <!-- Tag Display Names -->
- <string name="pref_tag_commandvalidator">CommandValidator</string>
- <string name="pref_tag_facemanager">FaceManager</string>
- <string name="pref_tag_facetable">FaceTable</string>
- <string name="pref_tag_fibmanager">FibManager</string>
- <string name="pref_tag_generalconfigsection">GeneralConfigSection</string>
- <string name="pref_tag_internalface">InternalFace</string>
- <string name="pref_tag_managerbase">ManagerBase</string>
- <string name="pref_tag_privilegehelper">PrivilegeHelper</string>
- <string name="pref_tag_remoteregistrator">RemoteRegistrator</string>
- <string name="pref_tag_ribmanager">RibManager</string>
- <string name="pref_tag_strategy">Strategy</string>
- <string name="pref_tag_strategychoice">StrategyChoice</string>
- <string name="pref_tag_tablesconfigsection">TablesConfigSection</string>
- <string name="pref_tag_tcpchannel">TcpChannel</string>
- <string name="pref_tag_tcpfactory">TcpFactory</string>
- <string name="pref_tag_tcplocalface">TcpLocalFace</string>
- <string name="pref_tag_udpfactory">UdpFactory</string>
-
- <!-- Tag Keys -->
- <string name="pref_tag_commandvalidator_key">CommandValidator</string>
- <string name="pref_tag_facemanager_key">FaceManager</string>
- <string name="pref_tag_facetable_key">FaceTable</string>
- <string name="pref_tag_fibmanager_key">FibManager</string>
- <string name="pref_tag_generalconfigsection_key">GeneralConfigSection</string>
- <string name="pref_tag_internalface_key">InternalFace</string>
- <string name="pref_tag_managerbase_key">ManagerBase</string>
- <string name="pref_tag_privilegehelper_key">PrivilegeHelper</string>
- <string name="pref_tag_remoteregistrator_key">RemoteRegistrator</string>
- <string name="pref_tag_ribmanager_key">RibManager</string>
- <string name="pref_tag_strategy_key">Strategy</string>
- <string name="pref_tag_strategychoice_key">StrategyChoice</string>
- <string name="pref_tag_tablesconfigsection_key">TablesConfigSection</string>
- <string name="pref_tag_tcpchannel_key">TcpChannel</string>
- <string name="pref_tag_tcpfactory_key">TcpFactory</string>
- <string name="pref_tag_tcplocalface_key">TcpLocalFace</string>
- <string name="pref_tag_udpfactory_key">UdpFactory</string>
-
<!-- Log Levels -->
- <string-array name="pref_log_levels">
+ <string-array name="reset_log_level_values">
<item>Verbose</item>
<item>Debug</item>
<item>Info</item>
@@ -61,15 +13,40 @@
<item>Silent</item>
</string-array>
- <!-- Log Level Command Tag-->
- <string-array name="pref_log_level_values">
- <item>V</item>
- <item>D</item>
- <item>I</item>
- <item>W</item>
- <item>E</item>
- <item>F</item>
- <item>S</item>
+ <!-- Log Level Mapping -->
+ <!--
+ This mapping is used for Logcat arguments and should be in the format of:
+ <display description>:<logcat priority value>
+ -->
+ <string-array name="logcat_log_level_map">
+ <item>Verbose:V</item>
+ <item>Debug:D</item>
+ <item>Info:I</item>
+ <item>Warn:W</item>
+ <item>Error:E</item>
+ <item>Fatal:F</item>
+ <item>Silent:S</item>
+ </string-array>
+
+ <!-- Default lag tags and log levels when no previous settings are found -->
+ <string-array name="default_log_tags_and_levels">
+ <item>CommandValidator:V</item>
+ <item>FaceManager:V</item>
+ <item>FaceTable:V</item>
+ <item>FibManager:V</item>
+ <item>GeneralConfigSection:V</item>
+ <item>InternalFace:V</item>
+ <item>ManagerBase:V</item>
+ <item>PrivilegeHelper:V</item>
+ <item>RemoteRegistrator:V</item>
+ <item>RibManager:V</item>
+ <item>Strategy:V</item>
+ <item>StrategyChoice:V</item>
+ <item>TablesConfigSection:V</item>
+ <item>TcpChannel:V</item>
+ <item>TcpFactory:V</item>
+ <item>TcpLocalFace:V</item>
+ <item>UdpFactory:V</item>
</string-array>
</resources>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 9484591..08a8a5c 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -5,11 +5,57 @@
<!-- Customize your theme here. -->
</style>
- <style name="dialog_margin">
+ <style name="default_dialog_margin">
<item name="android:layout_marginTop">16dp</item>
<item name="android:layout_marginLeft">4dp</item>
<item name="android:layout_marginRight">4dp</item>
<item name="android:layout_marginBottom">4dp</item>
</style>
+ <style name="default_linear_layout_padding">
+ <item name="android:paddingLeft">@dimen/default_padding_left</item>
+ <item name="android:paddingRight">@dimen/default_padding_right</item>
+ </style>
+
+ <style name="default_custom_white_button">
+ <item name="android:gravity">left|center_vertical</item>
+ <item name="android:background">@drawable/custom_white_button</item>
+ <item name="android:textColor">@android:color/primary_text_light</item>
+ <item name="android:textAppearance">?android:textAppearanceSmall</item>
+ </style>
+
+ <style name="item_title">
+ <item name="android:textAppearance">?android:textAppearanceSmall</item>
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:textColor">@android:color/primary_text_light</item>
+ </style>
+
+ <style name="item_secondary">
+ <item name="android:textAppearance">?android:textAppearanceSmall</item>
+ <item name="android:textColor">@android:color/secondary_text_dark</item>
+ </style>
+
+ <style name="two_row_item_title" parent="item_title">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ </style>
+
+ <style name="two_row_item_secondary" parent="item_secondary">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ </style>
+
+ <style name="two_column_item_title" parent="item_title">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
+ </style>
+
+ <style name="two_column_item_secondary" parent="item_secondary">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:gravity">right</item>
+ <item name="android:layout_gravity">right</item>
+ </style>
+
</resources>
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
deleted file mode 100644
index 7195806..0000000
--- a/app/src/main/res/xml/pref_general.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <!-- General section -->
- <PreferenceCategory
- android:key="@string/pref_category_title_general"
- android:title="@string/pref_category_title_general">
-
- <Preference
- android:title="@string/start_nfd"
- android:key="start_stop" />
-
- <PreferenceScreen
- android:title="NFD log"
- android:key="nfd_log">
- <intent
- android:action="android.intent.action.VIEW"
- android:targetPackage="net.named_data.nfd"
- android:targetClass="net.named_data.nfd.LogcatActivity" />
- </PreferenceScreen>
-
- </PreferenceCategory>
-</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_nfd_log.xml b/app/src/main/res/xml/pref_nfd_log.xml
deleted file mode 100644
index 37a0432..0000000
--- a/app/src/main/res/xml/pref_nfd_log.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <PreferenceCategory
- android:key="@string/pref_tags_log_level_title_key"
- android:title="@string/pref_tags_log_level_title">
-
- <ListPreference
- android:key="@string/pref_tags_log_level_key"
- android:title="@string/pref_tags_log_level"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- </PreferenceCategory>
-
- <PreferenceCategory
- android:key="@string/pref_category_title_tags_key"
- android:title="@string/pref_category_title_tags">
-
- <ListPreference
- android:key="@string/pref_tag_commandvalidator_key"
- android:title="@string/pref_tag_commandvalidator"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_facemanager_key"
- android:title="@string/pref_tag_facemanager"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_facetable_key"
- android:title="@string/pref_tag_facetable"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_fibmanager_key"
- android:title="@string/pref_tag_fibmanager"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_generalconfigsection_key"
- android:title="@string/pref_tag_generalconfigsection"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_internalface_key"
- android:title="@string/pref_tag_internalface"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_managerbase_key"
- android:title="@string/pref_tag_managerbase"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_privilegehelper_key"
- android:title="@string/pref_tag_privilegehelper"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_remoteregistrator_key"
- android:title="@string/pref_tag_remoteregistrator"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_ribmanager_key"
- android:title="@string/pref_tag_ribmanager"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_strategy_key"
- android:title="@string/pref_tag_strategy"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_strategychoice_key"
- android:title="@string/pref_tag_strategychoice"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_tablesconfigsection_key"
- android:title="@string/pref_tag_tablesconfigsection"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_tcpchannel_key"
- android:title="@string/pref_tag_tcpchannel"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_tcpfactory_key"
- android:title="@string/pref_tag_tcpfactory"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_tcplocalface_key"
- android:title="@string/pref_tag_tcplocalface"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- <ListPreference
- android:key="@string/pref_tag_udpfactory_key"
- android:title="@string/pref_tag_udpfactory"
- android:entries="@array/pref_log_levels"
- android:entryValues="@array/pref_log_level_values"
- android:defaultValue="I"
- android:negativeButtonText="@null"
- android:positiveButtonText="@null" />
-
- </PreferenceCategory>
-</PreferenceScreen>