Commit 5f1bcf91 authored by Tup's avatar Tup

Added the dish page boiii

parent 59355320
...@@ -31,4 +31,5 @@ dependencies { ...@@ -31,4 +31,5 @@ dependencies {
compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0' compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile files('libs/picasso-2.5.2.jar') compile files('libs/picasso-2.5.2.jar')
compile 'com.android.support:support-v4:24.2.1'
} }
...@@ -31,7 +31,11 @@ ...@@ -31,7 +31,11 @@
<activity <activity
android:name=".SearchActivity" android:name=".SearchActivity"
android:label="@string/title_activity_search" android:label="@string/title_activity_search"
android:theme="@style/AppTheme.NoActionBar"></activity> android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".DishViewActivity"
android:label="@string/title_activity_blahblah"
android:theme="@style/AppTheme"></activity>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
package com.testapp;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
public class DishViewActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dish_view);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// app icon in action bar clicked; goto parent activity.
this.finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
...@@ -102,11 +102,23 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks< ...@@ -102,11 +102,23 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
} }
}); });
Button sampleDishButton = (Button) findViewById(R.id.sample_dish);
sampleDishButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
sample();
}
});
mLoginFormView = findViewById(R.id.login_form); mLoginFormView = findViewById(R.id.login_form);
mProgressView = findViewById(R.id.login_progress); mProgressView = findViewById(R.id.login_progress);
} }
public void sample() {
Intent intent = new Intent(this, DishViewActivity.class);
startActivity(intent);
}
public void guestLogin() { public void guestLogin() {
Intent intent = new Intent(this, NavDrawerActivity.class); Intent intent = new Intent(this, NavDrawerActivity.class);
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.testapp.DishViewActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_dish_view" />
</android.support.design.widget.CoordinatorLayout>
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="@string/action_sign_in" android:text="@string/action_sign_in"
android:textStyle="bold" /> android:textStyle="bold" />
<Button <Button
android:id="@+id/use_as_guest_button" android:id="@+id/use_as_guest_button"
style="?android:textAppearanceSmall" style="?android:textAppearanceSmall"
...@@ -89,6 +90,14 @@ ...@@ -89,6 +90,14 @@
android:text="@string/action_guest" android:text="@string/action_guest"
android:textStyle="bold" /> android:textStyle="bold" />
<Button
android:text="sample dish"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginTop="16dp"
android:id="@+id/sample_dish" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_blahblah"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.testapp.DishViewActivity"
tools:showIn="@layout/activity_dish_view">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:weightSum="5">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight="1"
android:weightSum="5"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="3"
android:weightSum="7">
<TextView
android:text="Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView5"
android:layout_weight="3"/>
<TextView
android:text="Price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView6"
android:layout_weight="1" />
<TextView
android:text="Stall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/dish_stall"
android:layout_weight="1"
android:clickable="true"/>
<TextView
android:text="Location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView8"
android:layout_weight="1" />
<Button
android:text="Favorite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/dish_favorite"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:srcCompat="@mipmap/ic_launcher"
android:id="@+id/dish_pic"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="100dp"
android:weightSum="14"
android:paddingTop="10dp"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
android:layout_weight="1">
<TextView
android:text="Description:"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView3"
android:layout_weight="1"
android:textSize="18sp" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/dish_desc"
android:layout_weight="13"
android:paddingTop="5dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:paddingTop="10dp"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
android:weightSum="14" >
<TextView
android:text="Reviews:"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView4"
android:textSize="18sp"
android:layout_weight="1"/>
<ListView
android:layout_width="match_parent"
android:id="@+id/dish_reviews"
android:layout_height="150dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
<string name="drawer_5_1"> Gonzaga</string> <string name="drawer_5_1"> Gonzaga</string>
<string name="drawer_5_2"> JSEC</string> <string name="drawer_5_2"> JSEC</string>
<string name="drawer_5_3"> Zekaf</string> <string name="drawer_5_3"> Zekaf</string>
<string name="drawer_6">Cuisine</string>
<string name="drawer_6_1"> American</string>
<string name="drawer_6_2"> Japanese</string>
<string name="drawer_6_3"> Chinese</string>
<string name="hint_search">Search</string> <string name="hint_search">Search</string>
<string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_open">Open navigation drawer</string>
...@@ -40,4 +44,5 @@ ...@@ -40,4 +44,5 @@
<item>Item 222</item> <item>Item 222</item>
<item>Item 333</item> <item>Item 333</item>
</string-array> </string-array>
<string name="title_activity_blahblah">blahblah</string>
</resources> </resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment