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
510ef2a4
Commit
510ef2a4
authored
Dec 07, 2016
by
Willard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove scrolling listview from StallView, use LayoutInflater instead
parent
6e56a9bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
40 deletions
+30
-40
CanteeneoApiInterface.java
app/src/main/java/com/canteeneo/CanteeneoApiInterface.java
+0
-1
StallViewActivity.java
app/src/main/java/com/canteeneo/StallViewActivity.java
+18
-22
content_stall_view.xml
app/src/main/res/layout/content_stall_view.xml
+12
-17
No files found.
app/src/main/java/com/canteeneo/CanteeneoApiInterface.java
View file @
510ef2a4
...
@@ -84,7 +84,6 @@ public interface CanteeneoApiInterface {
...
@@ -84,7 +84,6 @@ public interface CanteeneoApiInterface {
@DELETE
(
"api/stalls/{id}/reviews/{review_id}"
)
@DELETE
(
"api/stalls/{id}/reviews/{review_id}"
)
Call
<
ResponseBody
>
deleteStallReview
(
@Path
(
"id"
)
int
id
,
@Path
(
"review_id"
)
int
review_id
);
Call
<
ResponseBody
>
deleteStallReview
(
@Path
(
"id"
)
int
id
,
@Path
(
"review_id"
)
int
review_id
);
@GET
(
"api/stalls/{id}/dishes"
)
@GET
(
"api/stalls/{id}/dishes"
)
Call
<
List
<
Dish
>>
getDishesByStall
(
@Path
(
"id"
)
int
id
);
Call
<
List
<
Dish
>>
getDishesByStall
(
@Path
(
"id"
)
int
id
);
...
...
app/src/main/java/com/canteeneo/StallViewActivity.java
View file @
510ef2a4
...
@@ -9,6 +9,8 @@ import android.view.View;
...
@@ -9,6 +9,8 @@ import android.view.View;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.ListView
;
import
android.widget.ListView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
...
@@ -17,6 +19,7 @@ import com.canteeneo.entities.Dish;
...
@@ -17,6 +19,7 @@ import com.canteeneo.entities.Dish;
import
com.canteeneo.entities.FavoriteInfo
;
import
com.canteeneo.entities.FavoriteInfo
;
import
com.canteeneo.entities.Stall
;
import
com.canteeneo.entities.Stall
;
import
com.canteeneo.entities.StallReview
;
import
com.canteeneo.entities.StallReview
;
import
com.squareup.picasso.Picasso
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -119,28 +122,9 @@ public class StallViewActivity extends AppCompatActivity {
...
@@ -119,28 +122,9 @@ public class StallViewActivity extends AppCompatActivity {
}
}
});
});
ListView
lvDishes
=
(
ListView
)
findViewById
(
R
.
id
.
stall_dishes
);
dAdapter
=
new
DishAdapter
(
StallViewActivity
.
this
,
dishes
);
dAdapter
=
new
DishAdapter
(
StallViewActivity
.
this
,
dishes
);
getStallDishes
(
id
);
lvDishes
.
setAdapter
(
dAdapter
);
lvDishes
.
setOnItemClickListener
(
new
AdapterView
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
Intent
i
=
new
Intent
(
StallViewActivity
.
this
,
DishViewActivity
.
class
);
Dish
d
=
dishes
.
get
(
position
);
i
.
putExtra
(
"ID"
,
d
.
getId
());
i
.
putExtra
(
"NAME"
,
d
.
getName
());
i
.
putExtra
(
"PRICE"
,
d
.
getPrice
());
i
.
putExtra
(
"IMAGE"
,
d
.
getImagePath
());
i
.
putExtra
(
"DESCRIPTION"
,
d
.
getDescription
());
i
.
putExtra
(
"STALLNAME"
,
d
.
getStallName
());
startActivity
(
i
);
}
});
ListView
lvReviews
=
(
ListView
)
findViewById
(
R
.
id
.
stall_reviews
);
srAdapter
=
new
StallReviewAdapter
(
StallViewActivity
.
this
,
reviews
);
srAdapter
=
new
StallReviewAdapter
(
StallViewActivity
.
this
,
reviews
);
lvReviews
.
setAdapter
(
srAdapter
);
getStallDishes
(
id
);
getStallReviews
(
id
);
getStallReviews
(
id
);
}
}
...
@@ -160,7 +144,13 @@ public class StallViewActivity extends AppCompatActivity {
...
@@ -160,7 +144,13 @@ public class StallViewActivity extends AppCompatActivity {
dishes
.
clear
();
dishes
.
clear
();
dishes
.
addAll
(
newDishes
);
dishes
.
addAll
(
newDishes
);
dAdapter
.
defaultFilter
();
dAdapter
.
defaultFilter
();
dAdapter
.
notifyDataSetChanged
();
LinearLayout
stallDishes
=
(
LinearLayout
)
findViewById
(
R
.
id
.
stall_dishes
);
stallDishes
.
removeAllViews
();
for
(
int
i
=
0
;
i
<
dAdapter
.
getCount
();
i
++)
{
stallDishes
.
addView
(
dAdapter
.
getView
(
i
,
null
,
stallDishes
));
}
}
}
@Override
@Override
...
@@ -191,7 +181,13 @@ public class StallViewActivity extends AppCompatActivity {
...
@@ -191,7 +181,13 @@ public class StallViewActivity extends AppCompatActivity {
findViewById
(
R
.
id
.
add_review_button
).
setVisibility
(
ownedReview
!=
null
||
!
AppUtils
.
isLoggedIn
()
?
View
.
INVISIBLE
:
View
.
VISIBLE
);
findViewById
(
R
.
id
.
add_review_button
).
setVisibility
(
ownedReview
!=
null
||
!
AppUtils
.
isLoggedIn
()
?
View
.
INVISIBLE
:
View
.
VISIBLE
);
reviews
.
addAll
(
newReviews
);
reviews
.
addAll
(
newReviews
);
srAdapter
.
notifyDataSetChanged
();
LinearLayout
stallReviews
=
(
LinearLayout
)
findViewById
(
R
.
id
.
stall_reviews
);
stallReviews
.
removeAllViews
();
for
(
int
i
=
0
;
i
<
srAdapter
.
getCount
();
i
++)
{
stallReviews
.
addView
(
srAdapter
.
getView
(
i
,
null
,
stallReviews
));
}
}
}
@Override
@Override
...
...
app/src/main/res/layout/content_stall_view.xml
View file @
510ef2a4
...
@@ -129,31 +129,24 @@
...
@@ -129,31 +129,24 @@
android:paddingTop=
"10dp"
android:paddingTop=
"10dp"
android:weightSum=
"14"
>
android:weightSum=
"14"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"Dishes:"
android:textSize=
"18sp"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/stall_dishes"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:weightSum=
"1"
>
android:weightSum=
"1"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"Dishes:"
android:textSize=
"18sp"
/>
<ListView
android:id=
"@+id/stall_dishes"
android:layout_width=
"match_parent"
android:layout_height=
"150dp"
android:layout_weight=
"6.45"
android:fadeScrollbars=
"false"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
<TextView
...
@@ -173,10 +166,12 @@
...
@@ -173,10 +166,12 @@
</LinearLayout>
</LinearLayout>
<Li
stView
<Li
nearLayout
android:id=
"@+id/stall_reviews"
android:id=
"@+id/stall_reviews"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
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