Ejemplo n.º 1
0
 @Override
 protected void onResume() {
   super.onResume();
   updateOrderedDishCount();
   if (mDishLstAdapter != null) {
     mDishLstAdapter.notifyDataSetChanged();
   }
 }
Ejemplo n.º 2
0
 private void updateDishes(final int position) {
   mDishes.clear();
   mDishLstAdapter.notifyDataSetChanged();
   new Thread() {
     public void run() {
       int ret =
           mDishes.setCategory(
               mCategories.getCategoryId(position), mCategories.getTableName(position));
       handler.sendEmptyMessage(ret);
     }
   }.start();
 }
Ejemplo n.º 3
0
        public void handleMessage(Message msg) {
          if (msg.what < 0) {
            switch (msg.what) {
              case ErrorNum.DB_BROKEN:
                errorAccurDlg("菜谱数据损坏,请更新菜谱!", FINISH_ACTIVITY);
                break;
              default:
                Toast.makeText(MenuActivity.this, "服务器开小差了,系统将显示全部菜单.", Toast.LENGTH_SHORT).show();
            }
          }

          mDishLstAdapter.notifyDataSetChanged();
        }
Ejemplo n.º 4
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();
  }
Ejemplo n.º 5
0
 public void handleMessage(Message msg) {
   mpDialog.cancel();
   if (msg.what < 0) {
     errorAccurDlg("删除失败", DO_NOTHING);
   } else {
     switch (msg.what) {
       case 0:
         updateOrderedDishCount();
         mDishLstAdapter.notifyDataSetChanged();
         break;
       default:
         mpDialog.setMessage("正在删除...");
         mpDialog.show();
     }
   }
 }
Ejemplo n.º 6
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();
 }