@Override protected void registerViews() { numberEditText.addTextChangedListener( new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) {} @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {} @Override public void afterTextChanged(Editable s) { getChargeInfo(); } }); chooseImageView.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { choosePhone(); } }); amountGridView.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { amountSelection = arg2; amountAdapter.notifyDataSetChanged(); getChargeInfo(); } }); timeGridView.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { timeSelection = arg2; timeAdapter.notifyDataSetChanged(); getChargeInfo(); } }); chargeButton.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { charge(); } }); }
private void initViews() { diliverGridView.setAdapter(diliverAdapter); paymentGridView.setAdapter(paymentAdapter); okButton.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { showLoading(); LocalCarController.selectDiliverAndPayment( localCar, localCar.getDiliver(), localCar.getPayment()); hideLoading(); refresh(); dismiss(); } }); diliverGridView.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { if (localCar.getDiliver().getType() != localCar.getDilivers().get(arg2).getType()) { localCar.setDiliver(localCar.getDilivers().get(arg2)); diliverAdapter.notifyDataSetChanged(); } } }); paymentGridView.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { if (localCar.getPayment().getType() != localCar.getPayments().get(arg2).getType()) { localCar.setPayment(localCar.getPayments().get(arg2)); paymentAdapter.notifyDataSetChanged(); } } }); }
@Override protected void initViews() { numberEditText.setText(User.getUser().getPhone()); amountGridView.setAdapter(amountAdapter); timeGridView.setAdapter(timeAdapter); }