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;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.RatingBar
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.testapp.entities.DishReview
;
import
com.testapp.entities.StallReview
;
import
java.util.ArrayList
;
...
...
@@ -37,15 +40,17 @@ public class DishReviewAdapter extends BaseAdapter {
@Override
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
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
);
TextView
username
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_username
);
TextView
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
title
);
RatingBar
rating
=
(
RatingBar
)
v
.
findViewById
(
R
.
id
.
rating
);
TextView
body
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
body
);
TextView
username
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
user
);
DishReview
dr
=
dishReviews
.
get
(
position
);
title
.
setText
(
dr
.
getTitle
());
rating
.
set
Text
(
dr
.
getRating
()
+
""
);
rating
.
set
Rating
(
dr
.
getRating
()
);
body
.
setText
(
dr
.
getBody
());
Toast
.
makeText
(
v
.
getContext
(),
dr
.
getBody
(),
Toast
.
LENGTH_SHORT
).
show
();
// TODO set username
return
v
;
}
...
...
app/src/main/java/com/testapp/StallReviewAdapter.java
View file @
b63e073a
...
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.RatingBar
;
import
android.widget.TextView
;
import
com.testapp.entities.StallReview
;
...
...
@@ -37,15 +38,16 @@ public class StallReviewAdapter extends BaseAdapter {
@Override
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
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
);
TextView
username
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
drv_username
);
TextView
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
title
);
RatingBar
rating
=
(
RatingBar
)
v
.
findViewById
(
R
.
id
.
rating
);
TextView
body
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
body
);
TextView
username
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
user
);
StallReview
dr
=
stallReviews
.
get
(
position
);
title
.
setText
(
dr
.
getTitle
());
rating
.
set
Text
(
dr
.
getRating
());
rating
.
set
Rating
(
dr
.
getRating
());
body
.
setText
(
dr
.
getBody
());
username
.
setText
(
dr
.
getUser
());
// TODO set username
return
v
;
}
...
...
app/src/main/java/com/testapp/entities/DishReview.java
View file @
b63e073a
...
...
@@ -6,17 +6,19 @@ public class DishReview {
String
title
;
String
body
;
float
rating
;
String
user
;
int
user_id
;
int
dish_id
;
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
.
title
=
title
;
this
.
body
=
body
;
this
.
rating
=
rating
;
this
.
user
=
user
;
this
.
user_id
=
user_id
;
this
.
dish_id
=
dish_id
;
}
...
...
@@ -37,6 +39,14 @@ public class DishReview {
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
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 {
String
title
;
String
body
;
int
rating
;
String
user
;
int
user_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
.
title
=
title
;
this
.
body
=
body
;
this
.
rating
=
rating
;
this
.
user
=
user
;
this
.
user_id
=
user_id
;
this
.
stall_id
=
stall_id
;
}
...
...
@@ -34,6 +36,14 @@ public class StallReview {
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
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 @@
android:layout_height=
"wrap_content"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:text=
"Title"
android:id=
"@+id/
drv_
title"
android:id=
"@+id/title"
android:layout_alignParentTop=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
/>
<
TextView
<
RatingBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:text=
"Rating"
android:id=
"@+id/drv_rating"
android:id=
"@+id/rating"
style=
"?android:attr/ratingBarStyleIndicator"
android:layout_alignParentTop=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
/>
android:layout_alignParentEnd=
"true"
/>
<TextView
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:text=
"
New Text
"
android:id=
"@+id/
drv_body
"
android:layout_below=
"@+id/
drv_
title"
android:text=
"
username
"
android:id=
"@+id/
user
"
android:layout_below=
"@+id/title"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
android:inputType=
"textMultiLine"
/>
android:layout_alignParentStart=
"true"
/>
<TextView
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:text=
"username"
android:id=
"@+id/drv_username"
android:layout_below=
"@+id/drv_body"
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
/>
android:text=
"New Text"
android:id=
"@+id/body"
android:inputType=
"textMultiLine"
android:textSize=
"18sp"
android:layout_below=
"@+id/user"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
/>
</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