Fix Server App

This commit is contained in:
phanhuuloi27
2022-07-12 19:30:40 +07:00
parent b10e4c6269
commit bd16f79b85
2 changed files with 11 additions and 9 deletions
@@ -40,16 +40,18 @@ public class OrderDetail extends AppCompatActivity {
order_id_value = getIntent().getStringExtra("OrderId");
//Set value
order_id.setText(order_id_value);
order_phone.setText(Common.currentRequest.getPhone());
order_total.setText(Common.currentRequest.getTotal());
order_address.setText(Common.currentRequest.getAddress());
order_comment.setText(Common.currentRequest.getComment());
order_id.setText("Mã đơn hàng: #" + order_id_value);
order_phone.setText("Số điện thoại: " + Common.currentRequest.getPhone());
order_total.setText("Tổng cộng: " + Common.currentRequest.getTotal());
order_address.setText("Địa chỉ giao: " + Common.currentRequest.getAddress());
order_comment.setText("Ghi chú: " + Common.currentRequest.getComment());
OrderDetailAdapter adapter = new OrderDetailAdapter(Common.currentRequest.getFoods());
adapter.notifyDataSetChanged();
lstFoods.setAdapter(adapter);
setTitle("Chi tiết đơn");
// calling the action bar
ActionBar actionBar = getSupportActionBar();
@@ -45,10 +45,10 @@ public class OrderDetailAdapter extends RecyclerView.Adapter<MyViewHolder>{
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
Order order = myOrders.get(position);
holder.name.setText(String.format("Name: %s", order.getProductName()));
holder.quantity.setText(String.format("Quantity: %s", order.getQuantity()));
holder.price.setText(String.format("Price: %s", order.getPrice()));
holder.discount.setText(String.format("Discount: %s", order.getDiscount()));
holder.name.setText(String.format("Tên món ăn: %s", order.getProductName()));
holder.quantity.setText(String.format("Số lượng: %s", order.getQuantity()));
holder.price.setText(String.format("Giá: %s", order.getPrice()));
holder.discount.setText("Giảm giá: " + order.getDiscount() + "%");
}