Skip to content

Commit

Permalink
Added initial Tour UI, which could still use some work. Also cleaned …
Browse files Browse the repository at this point in the history
…up code in several places.

The Tour UI still needs a landscape layout (coming in a later commit).  We also need to insert a MapFragment with all of the places on the tour marked in the large empty space above the tour details.

PlaceListAdapter renamed to PlaceCursorAdapter to reflect that it now uses Cursors instead of Lists.
  • Loading branch information
nking-1 committed Dec 28, 2012
1 parent 861627c commit 315c4f2
Show file tree
Hide file tree
Showing 29 changed files with 691 additions and 167 deletions.
4 changes: 4 additions & 0 deletions GuideAndroid/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
android:name="edu.vanderbilt.vm.guide.ui.PlaceDetailer"
android:label="@string/title_activity_place_detail_activity" >
</activity>
<activity
android:name="edu.vanderbilt.vm.guide.ui.TourDetailer"
android:label="@string/title_activity_tour_detail_activity" >
</activity>
<activity
android:name="edu.vanderbilt.vm.guide.ui.MapViewer"
android:label="Map" >
Expand Down
8 changes: 4 additions & 4 deletions GuideAndroid/assets/places.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"hours": "9-5 PM",
"placeDescription": "A distinctive tower marks the entrance of Featheringill Hall, one of four buildings housing the Vanderbilt School of Engineering. Inside, Featheringill features a three-story atrium, which serves as a focal for student interaction and social events, more than 50 teaching and research laboratories with the latest equpment and computer resources, and project rooms.",
"imagePath": "http://www.vanderbilt.edu/studentcenters/wp-content/uploads/FEA138.jpg?quick_view=1",
"videoPath": "1/1/11",
"videoPath": "",
"latitude" : 36.144782,
"longitude" : -86.803231
},
Expand All @@ -17,7 +17,7 @@
"hours": "9-5 PM",
"placeDescription": "Almost every Vanderbilt student has heard rumors regarding Kissam Quadrangle, the residential area on the corner of 21st and West End. Whether it is that a homeless man has begun to live in Kissam or that they shampoo the carpets weekly in order to keep them clean, it is more than likely most Vanderbilt students view Kissam in a negative light.\n\nThe six existing Kissam Quadrangle buildings, located near the intersection of West End Avenue and 21st Avenue South, will be demolished to make way for the two colleges that will be connected by a shared facility providing gathering space, grab-and-go dining options, a classroom, offices and meeting rooms.",
"imagePath": "http://admissions.vanderbilt.edu/insidedores/manage/wp-content/uploads/Fall-Day-300x300.jpg",
"videoPath": "1/1/11",
"videoPath": "",
"latitude" : 36.149536,
"longitude" : -86.801671
},
Expand All @@ -28,7 +28,7 @@
"hours": "9-5 PM",
"placeDescription": "Sarratt Student Center and the adjoining Rand Hall are light and bright and humming with activity. With assorted dining options, the Vanderbilt Bookstore, the popular Baseball Glove Lounge for studying, art studios, art gallery, cinema, post office, meeting rooms, and offices, Sarratt and Rand pulse with the heartbeat of Vanderbilt.",
"imagePath": "https://img-s.foursquare.com/derived_pix/KV3D3IMOOUYZBQA4PUKK224FCF0XKV0JS4RI3FVCEN5DZABR_300x300.jpg",
"videoPath": "1/1/11",
"videoPath": "",
"latitude" : 36.14624,
"longitude" : -86.80309
},
Expand All @@ -39,7 +39,7 @@
"hours": "9-5 PM",
"placeDescription": "It is the mission of the Office of Campus Recreation to assist in the development and education of the whole person. The Office achieves this goal by providing comprehensive fitness, recreation, and wellness programs in a state of the art facility to the diverse population of students and the Vanderbilt community at large. The wide variety of programs provide opportunities to develop the individual's positive self-esteem, relationships with others, and effective communication and leadership skills. The Student Recreation Center additionally serves as an avenue for individuals to achieve a stress free, holistic approach to a healthy lifestyle.",
"imagePath": "http://farm3.staticflickr.com/2528/4026583256_453db1129d_o.jpg",
"videoPath": "1/1/11",
"videoPath": "",
"latitude" : 36.14041,
"longitude" : -86.80885
},
Expand Down
99 changes: 95 additions & 4 deletions GuideAndroid/assets/tours.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,101 @@
[
{
"id" : 1,
"name" : "Recommended",
"name" : "Test Tour 1",
"timeRequired" : "1 hour",
"placesOnTour" : [1, 8, 3, 9],
"distance" : "0.7 miles"
"iconPath" : ""
}
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 2,
"name" : "Test Tour 2",
"timeRequired" : "1 hour",
"placesOnTour" : [2, 4, 3, 5],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 3,
"name" : "Test Tour 3",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 4,
"name" : "Test Tour 4",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 5,
"name" : "Test Tour 5",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 6,
"name" : "Test Tour 6",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 7,
"name" : "Test Tour 7",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 8,
"name" : "Test Tour 8",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 9,
"name" : "Test Tour 9",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 10,
"name" : "Test Tour 10",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
{
"id" : 11,
"name" : "Test Tour 11",
"timeRequired" : "1 hour",
"placesOnTour" : [6, 1, 7],
"description" : "Description for this tour",
"distance" : "0.7 miles",
"iconPath" : "tour_placeholder"
},
]
6 changes: 4 additions & 2 deletions GuideAndroid/docs/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ Tour JSON template:
"name" : "template",
"timeRequired" : "",
"placesOnTour" : [0, 1, 2],
"description" : "",
"distance" : "",
"iconPath" : ""
}
]

Note that placesOnTour expects an array of place IDs

Notes:
placesOnTour expects an array of place IDs
iconPath should be the name of the file without the extension (for now). For example, "tourIcon.png" should just be written in the JSON as "tourIcon"
1 change: 1 addition & 0 deletions GuideAndroid/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@

# Project target.
target=Google Inc.:Google APIs:16
android.library.reference.1=../../android-sdk-linux/extras/google/google_play_services/libproject/google-play-services_lib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 3 additions & 9 deletions GuideAndroid/res/layout-land/fragment_place_detailer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@

<TextView
android:id="@+id/PlaceName"
style="@style/detail_name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:gravity="center_vertical"
android:text="Place name"
android:textSize="20sp"
android:textStyle="bold" />
android:text="Place name" />

<ImageView
android:id="@+id/PlaceImage"
Expand Down Expand Up @@ -47,12 +46,7 @@
android:layout_margin="8dp"
android:text="Place description text" />

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp"
android:background="@android:color/darker_gray" />
<include layout="@layout/horizontal_line" />

<TextView
android:id="@+id/PlaceHours"
Expand Down
72 changes: 72 additions & 0 deletions GuideAndroid/res/layout/activity_tour_detail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
android:id="@+id/tour_detail_map_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="40"
android:orientation="vertical" />

<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="35" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<TextView
android:id="@+id/tour_detail_tour_name_tv"
style="@style/detail_name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Tour name" />

<TextView
android:id="@+id/tour_detail_tour_desc_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Description: " />

<include layout="@layout/horizontal_line" />

<TextView
android:id="@+id/tour_detail_tour_time_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Time required: " />

<TextView
android:id="@+id/tour_detail_tour_distance_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Distance: " />
</LinearLayout>
</ScrollView>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="25"
android:orientation="vertical" >

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Places on the tour:"
android:textSize="14sp"
android:textStyle="bold" />

<ListView
android:id="@+id/tour_detail_place_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

</LinearLayout>
10 changes: 2 additions & 8 deletions GuideAndroid/res/layout/fragment_place_detailer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="20sp"
android:textStyle="bold"
style="@style/detail_name_text"
android:text="Place name"
android:layout_margin="16dp" />

Expand All @@ -41,12 +40,7 @@
android:text="Place description text"
android:layout_margin="8dp" />

<View
android:layout_width="match_parent"
android:background="@android:color/darker_gray"
android:layout_height="2dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"/>
<include layout="@layout/horizontal_line"/>

<TextView
android:id="@+id/PlaceHours"
Expand Down
3 changes: 2 additions & 1 deletion GuideAndroid/res/layout/fragment_tour.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
android:horizontalSpacing="10dp"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" />
android:verticalSpacing="10dp"
android:layout_marginTop="10dp" />
7 changes: 7 additions & 0 deletions GuideAndroid/res/layout/horizontal_line.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp"
android:background="@android:color/darker_gray" />
5 changes: 3 additions & 2 deletions GuideAndroid/res/layout/tour_grid_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
android:orientation="vertical"
android:gravity="center_horizontal" >

<ImageView
android:id="@+id/tourGridItemIV"
Expand All @@ -17,6 +18,6 @@
android:id="@+id/tourGridItemTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp" />
android:textSize="17sp" />

</LinearLayout>
9 changes: 9 additions & 0 deletions GuideAndroid/res/menu/tour_detail_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_add_tour_to_agenda"
android:title="@string/menu_add_agenda"
android:icon="@drawable/content_new"
android:showAsAction="ifRoom|withText"/>

</menu>
3 changes: 2 additions & 1 deletion GuideAndroid/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<string name="menu_settings">Settings</string>

<string name="title_activity_guide_main">Guide Android</string>
<string name="title_activity_place_detail_activity">PlaceDetail</string>
<string name="title_activity_place_detail_activity">Place Details</string>
<string name="title_activity_tour_detail_activity">Tour Details</string>
<string name="title_activity_webmap">WebMap</string>

<string name="main_current_location">This box shows your current location.
Expand Down
6 changes: 4 additions & 2 deletions GuideAndroid/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="AppTheme" parent="@android:style/Theme.Holo.Light" >

<style name="AppTheme" parent="@android:style/Theme.Holo.Light" />
<style name="detail_name_text">
<item name="android:textSize">20sp</item>
<item name="android:textStyle">bold</item>
</style>

</resources>
4 changes: 2 additions & 2 deletions GuideAndroid/src/edu/vanderbilt/vm/guide/ui/GuideMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import edu.vanderbilt.vm.guide.ui.listener.ActivityTabListener;
import edu.vanderbilt.vm.guide.util.Geomancer;
import edu.vanderbilt.vm.guide.util.GlobalState;
import edu.vanderbilt.vm.guide.util.GuideConstants;

/**
* The main Activity of the Guide app. Contains the 4 main tabs:
Expand Down Expand Up @@ -56,8 +57,7 @@ private void setupActionBar() {
mAction = getActionBar();
mAction.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
mAction.setDisplayShowTitleEnabled(true);
mAction.setBackgroundDrawable(new ColorDrawable(
Color.rgb(189, 187, 14)));
mAction.setBackgroundDrawable(GuideConstants.ACTION_BAR_BG);
mAction.setSplitBackgroundDrawable(new ColorDrawable(
Color.rgb(189, 187, 14)));

Expand Down
3 changes: 1 addition & 2 deletions GuideAndroid/src/edu/vanderbilt/vm/guide/ui/MapViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ private void setupActionBar() {
mAction.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
mAction.setDisplayShowTitleEnabled(true);
mAction.setDisplayHomeAsUpEnabled(true);
mAction.setBackgroundDrawable(
new ColorDrawable(Color.rgb(189, 187, 14)));
mAction.setBackgroundDrawable(GuideConstants.ACTION_BAR_BG);
}

public boolean onCreateOptionsMenu(Menu menu){
Expand Down
Loading

0 comments on commit 315c4f2

Please sign in to comment.