Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Integrate navigation drawer #653

Merged
merged 4 commits into from
Feb 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions DroidPlanner/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
<activity
android:name=".activities.EditorActivity"
android:label="@string/editor"
android:launchMode="singleTop"
android:parentActivityName=".activities.FlightActivity" >

<!-- Parent activity meta-data to support API level 7+ -->
Expand All @@ -115,24 +116,19 @@
<activity
android:name=".activities.ConfigurationActivity"
android:windowSoftInputMode="adjustPan"
android:launchMode="singleTop"
android:theme="@style/Theme.PageIndicatorDefaults"
android:label="@string/menu_drone_setup"
android:parentActivityName=".activities.FlightActivity" >
android:parentActivityName=".activities.SettingsActivity" >

<!-- Parent activity meta-data to support API level 7+ -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.FlightActivity" />
android:value=".activities.SettingsActivity" />
</activity>
<activity android:name=".activities.SettingsActivity"
android:label="@string/settings"
android:parentActivityName=".activities.FlightActivity">

<!-- Parent activity meta-data to support API level 7+ -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.FlightActivity" />
</activity>
android:launchMode="singleTop"
android:label="@string/settings"/>
</application>

</manifest>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-hdpi/ic_action_gear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-hdpi/ic_action_help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-hdpi/ic_action_less.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-hdpi/ic_action_more.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-hdpi/ic_action_paste.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-hdpi/ic_drawer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-mdpi/ic_action_gear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-mdpi/ic_action_help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-mdpi/ic_action_less.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-mdpi/ic_action_more.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-mdpi/ic_action_paste.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-mdpi/ic_action_plane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DroidPlanner/res/drawable-mdpi/ic_drawer.png
Binary file added DroidPlanner/res/drawable-xhdpi/ic_action_paste.png
Binary file added DroidPlanner/res/drawable-xhdpi/ic_drawer.png
Binary file added DroidPlanner/res/drawable-xxhdpi/ic_action_paste.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_action_less" />
<item android:drawable="@drawable/ic_action_less_blue" android:state_selected="true" />
<item android:drawable="@drawable/ic_action_less_blue" android:state_pressed="true" />
</selector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_action_more" />
<item android:drawable="@drawable/ic_action_more_blue" android:state_selected="true" />
<item android:drawable="@drawable/ic_action_more_blue" android:state_pressed="true" />
</selector>
22 changes: 22 additions & 0 deletions DroidPlanner/res/layout/activity_drawer_navigation_ui.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/drawer_layout"
>

<ExpandableListView
android:id="@+id/nav_drawer_container"
android:layout_width="240dp"
android:layout_height="match_parent"
android:background="#ffededed"
android:choiceMode="singleChoice"
android:childIndicator="@null"
android:groupIndicator="@null"
android:layout_gravity="start"
android:paddingTop="10dp"
android:orientation="vertical"/>

</android.support.v4.widget.DrawerLayout>
15 changes: 15 additions & 0 deletions DroidPlanner/res/layout/adapter_nav_drawer_child.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/nav_drawer_child"
android:layout_width="match_parent"
android:drawablePadding="10dp"
android:background="?android:attr/activatedBackgroundIndicator"
android:layout_height="?android:attr/listPreferredItemHeight"
android:paddingStart="40dp"
android:paddingLeft="40dp"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="start|center_vertical"
android:textColor="@android:color/black"
android:textAlignment="viewStart"
/>
38 changes: 38 additions & 0 deletions DroidPlanner/res/layout/adapter_nav_drawer_group.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:background="?android:attr/activatedBackgroundIndicator"
android:layout_height="match_parent"
android:minHeight="48dp"
android:orientation="horizontal"
>

<TextView
android:id="@+id/nav_drawer_group"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_width="0dp"
android:layout_weight="1"
android:drawablePadding="10dp"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:textColor="@android:color/primary_text_light"
android:textAppearance="?android:attr/textAppearanceListItem"
android:gravity="start|center_vertical"
android:text="Flight Data"
android:drawableLeft="@drawable/ic_action_plane"
android:textAlignment="viewStart"
/>

<ImageView
android:id="@+id/nav_drawer_group_expand_icon"
android:layout_height="48dp"
android:layout_width="48dp"
android:scaleType="fitXY"
android:contentDescription="@string/expandable_listview_icon_desc"
android:src="@drawable/expandable_listview_icon_collapsed"
/>

</LinearLayout>
72 changes: 72 additions & 0 deletions DroidPlanner/res/layout/preference_config_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- Layout for a Preference in a PreferenceActivity. The
Preference is able to place a specific widget for its particular
type in the "widget_frame" layout. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingEnd="?android:attr/scrollbarSize"
android:background="?android:attr/selectableItemBackground" >

<ImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dip"
android:layout_marginEnd="6dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">

<TextView android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/primary_text_light"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />

<TextView android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:maxLines="4" />

</RelativeLayout>

<!-- Preference should place its actual preference widget here. -->
<LinearLayout android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical" />

</LinearLayout>
12 changes: 0 additions & 12 deletions DroidPlanner/res/menu/menu_super_activiy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,4 @@
android:showAsAction="never"
android:title="@string/menu_disconnect"/>

<item
android:id="@+id/menu_drone_setup"
android:showAsAction="never"
android:title="@string/menu_drone_setup"/>
<item
android:id="@+id/menu_settings"
android:showAsAction="never"
android:title="@string/settings"/>
<item
android:id="@+id/menu_help"
android:showAsAction="never"
android:title="@string/help"/>
</menu>
13 changes: 10 additions & 3 deletions DroidPlanner/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<string name="settings">Settings</string>
<string name="help">Help</string>
<string name="menu_drone_setup">Drone Setup</string>
<string name="app_settings">App Settings</string>
<string name="flight_data">Flight Data</string>
<string name="editor">Editor</string>
<string name="send_mission">Send Mission</string>
<string name="load_mission">Load Mission</string>
Expand Down Expand Up @@ -324,6 +326,11 @@
<string name="mission_control_takeoff">Take</string>
<string name="mission_control_loiter">Loiter</string>
<string name="mission_control_follow">Follow</string>
<string name="telemetry_label">Telemetry</string>
<string name="flight_modes_label">Flight modes</string>
<string name="menu_info_bar">Info Bar</string>
<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>

<!-- Bluetooth device selection strings -->
<string name="select_device">Select device to connect</string>
Expand All @@ -334,6 +341,9 @@
<string name="button_scan">Scan for devices</string>
<string name="scanning">Scanning for devices</string>

<!-- Content description -->
<string name="expandable_listview_icon_desc">Expandable listview icon</string>

<!-- Others (when possible move to a grouping above) -->
<string name="tune_roll">Manual adjustment of roll and pitch tuning. Rate_P is the primary value to adjust.</string>
<string name="dialog_box_title_altitude">Altitude</string>
Expand All @@ -343,7 +353,4 @@
<string name="mode1_throttle_on_right_stick">Mode 1: Throttle on RIGHT stick</string>
<string name="mode2_throttle_on_left_stick">Mode 2: Throttle on LEFT stick</string>

<string name="telemetry_label">Telemetry</string>
<string name="flight_modes_label">Flight modes</string>
<string name="menu_info_bar">Info Bar</string>
</resources>
Loading