Skip to content

Commit

Permalink
Add restaurant activity.
Browse files Browse the repository at this point in the history
Some RTL fixes.
UI enhancements.
  • Loading branch information
joshliberty committed Jul 1, 2014
1 parent 44b9efa commit d5067be
Show file tree
Hide file tree
Showing 24 changed files with 956 additions and 83 deletions.
14 changes: 11 additions & 3 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@
package="com.joshliberty.veganfriendly"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="19"/>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>



<application android:label="@string/app_name" android:icon="@drawable/ic_launcher"
android:name="com.activeandroid.app.Application">
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:name="com.activeandroid.app.Application"
android:supportsRtl="true">

<meta-data android:name="AA_DB_NAME" android:value="VeganFriendly.db" />
<meta-data android:name="AA_DB_VERSION" android:value="1" />
<meta-data
Expand All @@ -32,5 +39,6 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".RestaurantActivity" android:theme="@android:style/Theme.Holo.Light.DarkActionBar"/>
</application>
</manifest>
4 changes: 3 additions & 1 deletion VeganFriendly.iml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="LIBS_FOLDER_RELATIVE_PATH" value="" />
<option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet>
Expand All @@ -21,7 +22,8 @@
<orderEntry type="library" name="com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" name="ActiveAndroid" level="project" />
<orderEntry type="library" name="android-support-v4" level="project" />
<orderEntry type="library" name="com.squareup.retrofit:retrofit:1.5.1" level="project" />
<orderEntry type="library" name="okhttp-2.0.0" level="project" />
<orderEntry type="library" name="retrofit-1.6.0" level="project" />
</component>
</module>

37 changes: 37 additions & 0 deletions res/drawable/button.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<solid
android:color="#343434" />
<stroke
android:width="1dp"
android:color="#ff2f2f2f" />
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#343434"
android:endColor="#ff272727"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#ff2f2f2f" />
<corners
android:radius="4dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>
20 changes: 20 additions & 0 deletions res/drawable/card.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#CABBBBBB"/>
<corners android:radius="2dp" />
</shape>
</item>

<item
android:left="0dp"
android:right="0dp"
android:top="0dp"
android:bottom="2dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="2dp" />
</shape>
</item>
</layer-list>
13 changes: 13 additions & 0 deletions res/drawable/gradient.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >

<gradient

android:angle="90"
android:startColor="@android:color/holo_green_dark"
android:endColor="@android:color/holo_green_dark"
android:type="linear"

/>

</shape>
13 changes: 13 additions & 0 deletions res/drawable/grey_glow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >

<gradient

android:angle="90"
android:startColor="#fff3f3f3"
android:endColor="@android:color/darker_gray"
android:type="linear"

/>

</shape>
Binary file added res/drawable/no_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions res/drawable/rounded.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >

<stroke
android:width="1dp"
android:color="@android:color/holo_green_dark" />

<solid android:color="@android:color/holo_green_dark" />

<padding
android:left="1dp"
android:right="1dp"
android:top="1dp" />

<corners android:radius="5dp" />

</shape>
117 changes: 117 additions & 0 deletions res/layout-v17/activity_restaurant.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl">

<RelativeLayout
android:id="@+id/rest_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/gradient"
android:layout_alignParentStart="true"
android:padding="7dp">

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

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rest_name"
android:textStyle="bold"
android:maxLines="2"
android:textSize="10pt"
android:textColor="@android:color/white" />

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rest_address"
android:textColor="@android:color/white" />

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rest_phone"
android:textColor="@android:color/white" />

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rest_cuisine"
android:textStyle="bold"
android:background="@drawable/rounded"
android:textColor="@android:color/white" />

</LinearLayout>

<FrameLayout
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/grey"
android:padding="5dp"
android:layout_gravity="left">

<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:padding="3dp"
android:background="@android:color/white"
android:contentDescription="@string/rest_photo_desc"
android:src="@drawable/no_image"
android:id="@+id/rest_image"
android:scaleType="fitCenter" />

</FrameLayout>

</RelativeLayout>

<FrameLayout
android:layout_below="@id/rest_details"
android:id="@+id/sep"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/separator">
</FrameLayout>

<TextView
android:layout_below="@id/sep"
android:padding="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text_color"
android:id="@+id/rest_desc" />


<LinearLayout
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginBottom="10dp">

<Button android:layout_width="wrap_content"
android:drawableEnd="@android:drawable/ic_menu_call"
android:background="@drawable/button"
android:layout_height="wrap_content"
android:id="@+id/call"
android:drawablePadding="2dp"
android:textColor="@android:color/white"
android:layout_marginEnd="10dp"
android:text="@string/call"/>

<Button android:layout_width="wrap_content"
android:background="@drawable/button"
android:drawableEnd="@android:drawable/ic_dialog_map"
android:drawablePadding="2dp"
android:layout_height="wrap_content"
android:id="@+id/navigate"
android:textColor="@android:color/white"
android:text="@string/navigate"/>
</LinearLayout>

</RelativeLayout>
59 changes: 59 additions & 0 deletions res/layout-v17/info_window.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:textDirection="rtl">

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

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/restaurant_name"
android:textStyle="bold"
android:textColor="@color/text_color" />

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/restaurant_address"
android:textColor="@color/text_color" />

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/restaurant_phone"
android:textColor="@color/text_color" />

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/restaurant_style"
android:textColor="@android:color/white"
android:background="@drawable/rounded"
android:padding="3dp" />

</LinearLayout>

<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/grey"
android:padding="5dp"
android:layout_marginStart="10dp">

<ImageView
android:layout_width="75dp"
android:layout_height="75dp"
android:padding="3dp"
android:background="@android:color/white"
android:contentDescription="@string/rest_photo_desc"
android:src="@drawable/no_image"
android:id="@+id/imageView"
android:scaleType="fitCenter"
android:layout_gravity="left" />

</FrameLayout>

</LinearLayout>
8 changes: 0 additions & 8 deletions res/layout/activity_map.xml

This file was deleted.

8 changes: 0 additions & 8 deletions res/layout/activity_places_list.xml

This file was deleted.

Loading

0 comments on commit d5067be

Please sign in to comment.