Commit 6e56a9bf authored by Willard's avatar Willard

Fix dishes not appearing properly in StallView

parent fb03238d
<component name="ProjectDictionaryState">
<dictionary name="candy" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -83,6 +83,11 @@ public class DishAdapter extends BaseAdapter {
}
}
public void defaultFilter() {
filteredDishes.clear();
filteredDishes.addAll(dishes);
}
static class DishViewHolder {
TextView name;
......
......@@ -159,6 +159,7 @@ public class StallViewActivity extends AppCompatActivity {
List<Dish> newDishes = response.body();
dishes.clear();
dishes.addAll(newDishes);
dAdapter.defaultFilter();
dAdapter.notifyDataSetChanged();
}
......
......@@ -18,163 +18,165 @@
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="2">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:weightSum="5"
android:layout_height="wrap_content">
android:orientation="horizontal"
android:weightSum="5">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="3">
android:layout_weight="3"
android:orientation="vertical">
<TextView
android:text="Name"
android:id="@+id/dish_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/dish_name"
android:layout_weight="2"
android:textSize="18sp" />
android:text="Name"
android:textSize="18sp"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:text="Location: "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Location: "
android:textSize="18sp"
/>
<TextView
android:text="Location"
android:id="@+id/stall_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/stall_location"
android:layout_weight="1" />
android:layout_weight="1"
android:text="Location"/>
</LinearLayout>
<CheckBox
android:text="Favorite"
android:id="@+id/favorite_checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/favorite_checkbox"
android:button="@drawable/favorite_checkbox"
android:layout_marginBottom="10dp"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/favorite_checkbox"
android:text="Favorite"/>
</LinearLayout>
<ImageView
android:id="@+id/dish_pic"
android:layout_width="wrap_content"
android:layout_height="78dp"
app:srcCompat="@mipmap/ic_launcher"
android:id="@+id/dish_pic"
android:layout_weight="2" />
android:layout_weight="2"
app:srcCompat="@mipmap/ic_launcher"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="10"
android:paddingTop="10dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp">
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="10">
<TextView
android:text="Description:"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18sp" />
android:text="Description:"
android:textSize="18sp"/>
<TextView
android:text="This is a foodz"
android:id="@+id/stall_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/stall_description"
android:layout_weight="9"
android:paddingTop="5dp" />
android:paddingTop="5dp"
android:text="This is a foodz"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:paddingTop="10dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:weightSum="14"
android:paddingLeft="10dp">
android:layout_weight="3"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:weightSum="14">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:text="Dishes:"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="18sp" />
android:text="Dishes:"
android:textSize="18sp"/>
<ListView
android:layout_width="match_parent"
android:layout_height="125dp"
android:id="@+id/stall_dishes"
android:fadeScrollbars="false" />
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_weight="6.45"
android:fadeScrollbars="false"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:text="Reviews:"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_weight="1"/>
android:layout_weight="1"
android:text="Reviews:"
android:textSize="18sp"/>
<Button
android:id="@+id/add_review_button"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/add_review_button"
android:drawableLeft="@drawable/ic_add_circle_outline_black_24dp"
android:text="Add your own review"
style="@style/Widget.AppCompat.Button.Borderless"/>
android:text="Add your own review"/>
</LinearLayout>
<ListView
android:layout_width="match_parent"
android:id="@+id/stall_reviews"
android:layout_height="wrap_content" />
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
......
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