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
b63e073a
Commit
b63e073a
authored
Dec 04, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to review row
parent
5251bdb6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
32 deletions
+75
-32
DishReviewAdapter.java
app/src/main/java/com/testapp/DishReviewAdapter.java
+10
-5
StallReviewAdapter.java
app/src/main/java/com/testapp/StallReviewAdapter.java
+7
-5
DishReview.java
app/src/main/java/com/testapp/entities/DishReview.java
+11
-1
StallReview.java
app/src/main/java/com/testapp/entities/StallReview.java
+11
-1
ic_clear_black_24dp.xml
app/src/main/res/drawable/ic_clear_black_24dp.xml
+9
-0
ic_mode_edit_black_24dp.xml
app/src/main/res/drawable/ic_mode_edit_black_24dp.xml
+9
-0
review_row.xml
app/src/main/res/layout/review_row.xml
+18
-20
No files found.
app/src/main/java/com/testapp/DishReviewAdapter.java
View file @
b63e073a
...
@@ -4,9 +4,12 @@ import android.app.Activity;
...
@@ -4,9 +4,12 @@ import android.app.Activity;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.BaseAdapter
;
import
android.widget.RatingBar
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.testapp.entities.DishReview
;
import
com.testapp.entities.DishReview
;
import
com.testapp.entities.StallReview
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -37,15 +40,17 @@ public class DishReviewAdapter extends BaseAdapter {
...
@@ -37,15 +40,17 @@ public class DishReviewAdapter extends BaseAdapter {
@Override
@Override
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
View
v
=
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
review_row
,
null
);
View
v
=
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
review_row
,
null
);
TextView
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_
title
);
TextView
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
title
);
TextView
rating
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_
rating
);
RatingBar
rating
=
(
RatingBar
)
v
.
findViewById
(
R
.
id
.
rating
);
TextView
body
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_
body
);
TextView
body
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
body
);
TextView
username
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_username
);
TextView
username
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
user
);
DishReview
dr
=
dishReviews
.
get
(
position
);
DishReview
dr
=
dishReviews
.
get
(
position
);
title
.
setText
(
dr
.
getTitle
());
title
.
setText
(
dr
.
getTitle
());
rating
.
set
Text
(
dr
.
getRating
()
+
""
);
rating
.
set
Rating
(
dr
.
getRating
()
);
body
.
setText
(
dr
.
getBody
());
body
.
setText
(
dr
.
getBody
());
Toast
.
makeText
(
v
.
getContext
(),
dr
.
getBody
(),
Toast
.
LENGTH_SHORT
).
show
();
// TODO set username
// TODO set username
return
v
;
return
v
;
}
}
...
...
app/src/main/java/com/testapp/StallReviewAdapter.java
View file @
b63e073a
...
@@ -4,6 +4,7 @@ import android.app.Activity;
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.BaseAdapter
;
import
android.widget.RatingBar
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.testapp.entities.StallReview
;
import
com.testapp.entities.StallReview
;
...
@@ -37,15 +38,16 @@ public class StallReviewAdapter extends BaseAdapter {
...
@@ -37,15 +38,16 @@ public class StallReviewAdapter extends BaseAdapter {
@Override
@Override
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
View
v
=
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
review_row
,
null
);
View
v
=
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
review_row
,
null
);
TextView
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_
title
);
TextView
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
title
);
TextView
rating
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_
rating
);
RatingBar
rating
=
(
RatingBar
)
v
.
findViewById
(
R
.
id
.
rating
);
TextView
body
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_
body
);
TextView
body
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
body
);
TextView
username
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_username
);
TextView
username
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
user
);
StallReview
dr
=
stallReviews
.
get
(
position
);
StallReview
dr
=
stallReviews
.
get
(
position
);
title
.
setText
(
dr
.
getTitle
());
title
.
setText
(
dr
.
getTitle
());
rating
.
set
Text
(
dr
.
getRating
());
rating
.
set
Rating
(
dr
.
getRating
());
body
.
setText
(
dr
.
getBody
());
body
.
setText
(
dr
.
getBody
());
username
.
setText
(
dr
.
getUser
());
// TODO set username
// TODO set username
return
v
;
return
v
;
}
}
...
...
app/src/main/java/com/testapp/entities/DishReview.java
View file @
b63e073a
...
@@ -6,17 +6,19 @@ public class DishReview {
...
@@ -6,17 +6,19 @@ public class DishReview {
String
title
;
String
title
;
String
body
;
String
body
;
float
rating
;
float
rating
;
String
user
;
int
user_id
;
int
user_id
;
int
dish_id
;
int
dish_id
;
public
DishReview
()
{
public
DishReview
()
{
}
}
public
DishReview
(
int
id
,
String
title
,
String
body
,
float
rating
,
int
user_id
,
int
dish_id
)
{
public
DishReview
(
int
id
,
String
title
,
String
body
,
float
rating
,
String
user
,
int
user_id
,
int
dish_id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
title
=
title
;
this
.
title
=
title
;
this
.
body
=
body
;
this
.
body
=
body
;
this
.
rating
=
rating
;
this
.
rating
=
rating
;
this
.
user
=
user
;
this
.
user_id
=
user_id
;
this
.
user_id
=
user_id
;
this
.
dish_id
=
dish_id
;
this
.
dish_id
=
dish_id
;
}
}
...
@@ -37,6 +39,14 @@ public class DishReview {
...
@@ -37,6 +39,14 @@ public class DishReview {
public
void
setRating
(
float
rating
)
{
this
.
rating
=
rating
;
}
public
void
setRating
(
float
rating
)
{
this
.
rating
=
rating
;
}
public
String
getUser
()
{
return
user
;
}
public
void
setUser
(
String
user
)
{
this
.
user
=
user
;
}
public
int
getUserId
()
{
return
user_id
;
}
public
int
getUserId
()
{
return
user_id
;
}
public
void
setUserId
(
int
user_id
)
{
this
.
user_id
=
user_id
;
}
public
void
setUserId
(
int
user_id
)
{
this
.
user_id
=
user_id
;
}
...
...
app/src/main/java/com/testapp/entities/StallReview.java
View file @
b63e073a
...
@@ -6,14 +6,16 @@ public class StallReview {
...
@@ -6,14 +6,16 @@ public class StallReview {
String
title
;
String
title
;
String
body
;
String
body
;
int
rating
;
int
rating
;
String
user
;
int
user_id
;
int
user_id
;
int
stall_id
;
int
stall_id
;
public
StallReview
(
int
id
,
String
title
,
String
body
,
int
rating
,
int
user_id
,
int
stall_id
)
{
public
StallReview
(
int
id
,
String
title
,
String
body
,
String
user
,
int
rating
,
int
user_id
,
int
stall_id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
title
=
title
;
this
.
title
=
title
;
this
.
body
=
body
;
this
.
body
=
body
;
this
.
rating
=
rating
;
this
.
rating
=
rating
;
this
.
user
=
user
;
this
.
user_id
=
user_id
;
this
.
user_id
=
user_id
;
this
.
stall_id
=
stall_id
;
this
.
stall_id
=
stall_id
;
}
}
...
@@ -34,6 +36,14 @@ public class StallReview {
...
@@ -34,6 +36,14 @@ public class StallReview {
public
void
setRating
(
int
rating
)
{
this
.
rating
=
rating
;
}
public
void
setRating
(
int
rating
)
{
this
.
rating
=
rating
;
}
public
String
getUser
()
{
return
user
;
}
public
void
setUser
(
String
user
)
{
this
.
user
=
user
;
}
public
int
getUserId
()
{
return
user_id
;
}
public
int
getUserId
()
{
return
user_id
;
}
public
void
setUserId
(
int
user_id
)
{
this
.
user_id
=
user_id
;
}
public
void
setUserId
(
int
user_id
)
{
this
.
user_id
=
user_id
;
}
...
...
app/src/main/res/drawable/ic_clear_black_24dp.xml
0 → 100644
View file @
b63e073a
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"
/>
</vector>
app/src/main/res/drawable/ic_mode_edit_black_24dp.xml
0 → 100644
View file @
b63e073a
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"
/>
</vector>
app/src/main/res/layout/review_row.xml
View file @
b63e073a
...
@@ -9,39 +9,37 @@
...
@@ -9,39 +9,37 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:text=
"Title"
android:text=
"Title"
android:id=
"@+id/
drv_
title"
android:id=
"@+id/title"
android:layout_alignParentTop=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
/>
android:layout_alignParentStart=
"true"
/>
<
TextView
<
RatingBar
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:id=
"@+id/rating"
android:text=
"Rating"
style=
"?android:attr/ratingBarStyleIndicator"
android:id=
"@+id/drv_rating"
android:layout_alignParentTop=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
/>
android:layout_alignParentEnd=
"true"
/>
<TextView
<TextView
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
New Text
"
android:text=
"
username
"
android:id=
"@+id/
drv_body
"
android:id=
"@+id/
user
"
android:layout_below=
"@+id/
drv_
title"
android:layout_below=
"@+id/title"
android:layout_alignParentLeft=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
android:layout_alignParentStart=
"true"
/>
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
android:inputType=
"textMultiLine"
/>
<TextView
<TextView
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"username"
android:text=
"New Text"
android:id=
"@+id/drv_username"
android:id=
"@+id/body"
android:layout_below=
"@+id/drv_body"
android:inputType=
"textMultiLine"
android:layout_alignParentRight=
"true"
android:textSize=
"18sp"
android:layout_alignParentEnd=
"true"
/>
android:layout_below=
"@+id/user"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
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