Commit 1d28ae86 authored by Tup's avatar Tup

Dish view and Stall view done

parent 5f1bcf91
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
<activity <activity
android:name=".DishViewActivity" android:name=".DishViewActivity"
android:label="@string/title_activity_blahblah" android:label="@string/title_activity_blahblah"
android:theme="@style/AppTheme" />
<activity
android:name=".StallViewActivity"
android:label="@string/title_activity_stall_view"
android:theme="@style/AppTheme"></activity> android:theme="@style/AppTheme"></activity>
</application> </application>
......
...@@ -16,6 +16,8 @@ public class DishViewActivity extends AppCompatActivity { ...@@ -16,6 +16,8 @@ public class DishViewActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true);
setTitle("Dish Pls");
} }
@Override @Override
......
...@@ -106,14 +106,29 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks< ...@@ -106,14 +106,29 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
sampleDishButton.setOnClickListener(new OnClickListener() { sampleDishButton.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
sample(); sampleDish();
} }
}); });
Button sampleStallButton = (Button) findViewById(R.id.sample_stall);
sampleStallButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
sampleStall();
}
});
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() { public void sampleStall() {
Intent intent = new Intent(this, StallViewActivity.class);
startActivity(intent);
}
public void sampleDish() {
Intent intent = new Intent(this, DishViewActivity.class); Intent intent = new Intent(this, DishViewActivity.class);
startActivity(intent); startActivity(intent);
......
package com.testapp;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
public class StallViewActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stall_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);
}
}
}
...@@ -98,6 +98,14 @@ ...@@ -98,6 +98,14 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:id="@+id/sample_dish" /> android:id="@+id/sample_dish" />
<Button
android:text="Sample Stall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/sample_stall"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginTop="16dp" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>
<?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.StallViewActivity">
<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_stall_view" />
</android.support.design.widget.CoordinatorLayout>
<?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_stall_view"
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.StallViewActivity"
tools:showIn="@layout/activity_stall_view">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/canteeneo_logo"
android:id="@+id/stall_logo" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="Location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/stall_location"
android:layout_weight="1" />
<Button
android:text="Favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/stall_favorite"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp"
android:layout_weight="1">
<TextView
android:text="Description:"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:textSize="18sp"
android:paddingTop="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp" />
<TextView
android:text="STOL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/stall_description"
android:paddingTop="5dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="Dishes:"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView9"
android:layout_marginTop="10dp"
android:textSize="18sp" />
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/stall_dishes" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:text="Reviews:"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView10"
android:textSize="18sp"
android:paddingTop="10dp" />
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/stall_reviews" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#3F51B5</color> <color name="colorPrimary">#3f51b5</color>
<color name="colorPrimaryDark">#303F9F</color> <color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color> <color name="colorAccent">#FF4081</color>
</resources> </resources>
...@@ -45,4 +45,5 @@ ...@@ -45,4 +45,5 @@
<item>Item 333</item> <item>Item 333</item>
</string-array> </string-array>
<string name="title_activity_blahblah">blahblah</string> <string name="title_activity_blahblah">blahblah</string>
<string name="title_activity_stall_view">StallViewActivity</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