Change position favorite screen

This commit is contained in:
Nezumi
2023-03-16 16:05:40 +07:00
parent ddcc861e03
commit 17ce01ce4f
16 changed files with 277 additions and 115 deletions
@@ -81,17 +81,17 @@ public class FoodFavoriteAdapter extends RecyclerView.Adapter<FoodFavoriteAdapt
listFavoriteFood.remove(index);
notifyItemRemoved(index);
FoodApiToken.apiService.removeFoodFromFavorite(index).enqueue(new Callback<Food>() {
@Override
public void onResponse(Call<Food> call, Response<Food> response) {
Toast.makeText(context, "Remove successful!", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(Call<Food> call, Throwable t) {
Toast.makeText(context, "Error: " + t, Toast.LENGTH_SHORT).show();
}
});
// FoodApiToken.apiService.removeFoodFromFavorite(index).enqueue(new Callback<Food>() {
// @Override
// public void onResponse(Call<Food> call, Response<Food> response) {
// Toast.makeText(context, "Remove successful!", Toast.LENGTH_SHORT).show();
// }
//
// @Override
// public void onFailure(Call<Food> call, Throwable t) {
// Toast.makeText(context, "Error: " + t, Toast.LENGTH_SHORT).show();
// }
// });
}
public void undoItem(Food food, int index, Context context){