Exemple #1
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_shop);
   ButterKnife.inject(this);
   mtb.finishLeft(this);
   mtb.setTitle(R.string.shop);
   mtb.showRight();
   showProgressDialog();
   startPosition();
   loadSlidingmenu();
   initListener();
 }
  private void initData() {
    mtb.setTitle(product.getPrductName());
    tvSimplePirce.setText("¥" + product.getProductMoney() + "");
    tvNumber.setText(product.getCount() + "");
    tvTitle.setText(product.getPrductName());
    tvContent.setText(product.getDescritpion());
    tvKucun.setText("库存:" + product.getSurplusNum());
    SingletonServiceManager.getInstance()
        .display(product.getProductPictures(), ivPic, R.drawable.photo_3, null);
    tvCount.setText(list.size() + "");

    if (product.getCount() == 0) {
      flag = true;
    }

    for (Product p : list) {
      allMoney += p.getProductMoney() * p.getCount();
    }
    tvMoney.setText(allMoney + "");
  }
Exemple #3
0
  private void initListener() {
    plListv.setOnItemClickListener(
        new OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            Intent intent = new Intent(ShopActivity.this, GoodsShowActivity.class);
            Bundle b = new Bundle();
            b.putSerializable("store", listdata.get(arg2 - 1));
            intent.putExtras(b);
            startActivity(intent);
          }
        });

    mtb.setOnRightClickListener(
        new OnRightClickListener() {

          @Override
          public void onRightClick() {
            sm.showMenu();
          }
        });
  }