Example #1
0
  private void updateDishQuantity(final int position, final int quantity) {
    if (quantity < 0) {
      new Thread() {
        public void run() {
          int ret = mMyOrder.minus(mDishes.getDish(position), -quantity);
          minushandler.sendEmptyMessage(ret);
        }
      }.start();

    } else {
      mMyOrder.add(position, quantity);
    }
    updateOrderedDishCount();
    mDishLstAdapter.notifyDataSetChanged();
  }
Example #2
0
 public void onClick(View v) {
   final int position = Integer.parseInt(v.getTag().toString());
   mMyOrder.add(mDishes.getDish(position), 1, Info.getTableId(), 0);
   updateOrderedDishCount();
   mDishLstAdapter.notifyDataSetChanged();
 }
Example #3
0
 private void updateOrderedDishCount() {
   mOrderedDishCount.setText(Integer.toString(mMyOrder.totalQuantity()));
 }