mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-23 04:09:52 +00:00
Add list data for restaurant
This commit is contained in:
@@ -14,6 +14,8 @@ import com.capstone.foodify.API.FoodApi;
|
||||
import com.capstone.foodify.Model.Food.Food;
|
||||
import com.capstone.foodify.Model.Menu.Menu;
|
||||
import com.capstone.foodify.Model.Menu.MenuAdapter;
|
||||
import com.capstone.foodify.Model.Shop.Shop;
|
||||
import com.capstone.foodify.Model.Shop.ShopAdapter;
|
||||
import com.capstone.foodify.R;
|
||||
import com.denzcoskun.imageslider.ImageSlider;
|
||||
import com.denzcoskun.imageslider.constants.ScaleTypes;
|
||||
@@ -34,8 +36,9 @@ public class HomeFragment extends Fragment {
|
||||
|
||||
private ImageSlider imageSlider;
|
||||
|
||||
private RecyclerView rcvMenu;
|
||||
private RecyclerView rcvMenu, recyclerView_restaurant;
|
||||
private MenuAdapter menuAdapter;
|
||||
private ShopAdapter shopAdapter;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -47,9 +50,11 @@ public class HomeFragment extends Fragment {
|
||||
imageSlider = (ImageSlider) view.findViewById(R.id.slider);
|
||||
rcvMenu = view.findViewById(R.id.recycler_view_menu);
|
||||
menuAdapter = new MenuAdapter(getContext());
|
||||
recyclerView_restaurant = view.findViewById(R.id.recycler_view_restaurant);
|
||||
shopAdapter = new ShopAdapter(getContext());
|
||||
|
||||
|
||||
getListFood();
|
||||
drinkListFood();
|
||||
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false);
|
||||
rcvMenu.setLayoutManager(linearLayoutManager);
|
||||
@@ -63,6 +68,17 @@ public class HomeFragment extends Fragment {
|
||||
|
||||
imageSlider.setImageList(slideModels, ScaleTypes.FIT);
|
||||
|
||||
//Restaurant
|
||||
List<Shop> shopList = new ArrayList<>();
|
||||
shopList.add(new Shop(R.drawable.burgerking));
|
||||
shopList.add(new Shop(R.drawable.dominopizza));
|
||||
shopList.add(new Shop(R.drawable.mcdonals));
|
||||
shopList.add(new Shop(R.drawable.pizzahut));
|
||||
shopList.add(new Shop(R.drawable.subway));
|
||||
|
||||
shopAdapter.setData(shopList);
|
||||
recyclerView_restaurant.setAdapter(shopAdapter);
|
||||
|
||||
// Inflate the layout for this fragment
|
||||
return view;
|
||||
}
|
||||
@@ -106,7 +122,6 @@ public class HomeFragment extends Fragment {
|
||||
drinkFood.add(tempFood);
|
||||
}
|
||||
|
||||
|
||||
menuAdapter.setData(getListMenu());
|
||||
rcvMenu.setAdapter(menuAdapter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user