Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS123-CanteeneoAndroid
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Willard Torres
CS123-CanteeneoAndroid
Commits
8efb1d9a
Commit
8efb1d9a
authored
Nov 24, 2016
by
lumisce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes, add image in DishView
parent
3c7398ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
DishReviewAdapter.java
app/src/main/java/com/testapp/DishReviewAdapter.java
+1
-4
DishViewActivity.java
app/src/main/java/com/testapp/DishViewActivity.java
+6
-2
NavDrawerActivity.java
app/src/main/java/com/testapp/NavDrawerActivity.java
+0
-1
review_row.xml
app/src/main/res/layout/review_row.xml
+0
-0
No files found.
app/src/main/java/com/testapp/DishReviewAdapter.java
View file @
8efb1d9a
...
...
@@ -4,11 +4,8 @@ import android.app.Activity;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.squareup.picasso.Picasso
;
import
com.testapp.entities.Dish
;
import
com.testapp.entities.DishReview
;
import
java.util.ArrayList
;
...
...
@@ -39,7 +36,7 @@ public class DishReviewAdapter extends BaseAdapter {
@Override
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
View
v
=
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
dish_
review_row
,
null
);
View
v
=
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
review_row
,
null
);
TextView
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_title
);
TextView
rating
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_rating
);
TextView
body
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_body
);
...
...
app/src/main/java/com/testapp/DishViewActivity.java
View file @
8efb1d9a
...
...
@@ -6,9 +6,11 @@ import android.support.v7.app.AppCompatActivity;
import
android.support.v7.widget.Toolbar
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ListView
;
import
android.widget.TextView
;
import
com.squareup.picasso.Picasso
;
import
com.testapp.entities.DishReview
;
import
java.util.ArrayList
;
...
...
@@ -43,6 +45,8 @@ public class DishViewActivity extends AppCompatActivity {
dishPrice
.
setText
(
i
.
getStringExtra
(
"PRICE"
));
TextView
dishDesc
=
(
TextView
)
findViewById
(
R
.
id
.
dish_desc
);
dishDesc
.
setText
(
i
.
getStringExtra
(
"DESCRIPTION"
));
ImageView
image
=
(
ImageView
)
findViewById
(
R
.
id
.
dish_pic
);
Picasso
.
with
(
this
).
load
(
"http://"
+
getResources
().
getString
(
R
.
string
.
server_ip
)
+
":5000/static/uploads/"
+
i
.
getStringExtra
(
"IMAGE"
)).
fit
().
centerCrop
().
into
(
image
);
dishStall
=
(
TextView
)
findViewById
(
R
.
id
.
dish_stall
);
dishStall
.
setText
(
i
.
getStringExtra
(
"STALLNAME"
));
...
...
@@ -84,9 +88,9 @@ public class DishViewActivity extends AppCompatActivity {
call
.
enqueue
(
new
Callback
<
List
<
DishReview
>>()
{
@Override
public
void
onResponse
(
Call
<
List
<
DishReview
>>
call
,
Response
<
List
<
DishReview
>>
response
)
{
List
<
DishReview
>
new
Dishe
s
=
response
.
body
();
List
<
DishReview
>
new
Review
s
=
response
.
body
();
reviews
.
clear
();
reviews
.
addAll
(
new
Dishe
s
);
reviews
.
addAll
(
new
Review
s
);
adapter
.
notifyDataSetChanged
();
}
...
...
app/src/main/java/com/testapp/NavDrawerActivity.java
View file @
8efb1d9a
...
...
@@ -97,7 +97,6 @@ public class NavDrawerActivity extends AppCompatActivity implements NavigationVi
i
.
putExtra
(
"PRICE"
,
d
.
getPrice
());
i
.
putExtra
(
"IMAGE"
,
d
.
getImagePath
());
i
.
putExtra
(
"DESCRIPTION"
,
d
.
getDescription
());
// TODO i.putExtra("LOCATION", getStall(stallname).getLocation)?????????????
i
.
putExtra
(
"STALLNAME"
,
d
.
getStallName
());
startActivity
(
i
);
}
...
...
app/src/main/res/layout/
dish_
review_row.xml
→
app/src/main/res/layout/review_row.xml
View file @
8efb1d9a
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment