Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
- switch (parent.getId()) {
- case R.id.pack_relatives:
- Toast.makeText(ProductView.this, "Spinner 2", Toast.LENGTH_SHORT).show();
- packspprice=PACK_PRICE.get(position);
- packelseprice=PACK_ELSEWHERE.get(position);
- packreorderprice=PACK_REORDER.get(position);
- System.out.println("SELECTED NP"+selnp);
- break;
- }
- }
- public void qtyshow()
- {
- final AlertDialog.Builder alert = new AlertDialog.Builder(ProductView.this);
- alert.setTitle("Select the Qty: ");
- np = new NumberPicker(ProductView.this);
- np.setMaxValue(20); // max value 20
- np.setMinValue(1); // min value 0
- np.setWrapSelectorWheel(false);
- np.setValue(mulqty);
- alert.setView(np);
- selnp=np.getValue();
- alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- if(stnm.equals("0"))
- {
- System.out.println("STNMS 0");
- proqty.setText(String.valueOf(np.getValue())); //set the value to textview
- // Do something with value!
- /* if(packspprice!=null)
- {*/
- mulprice= Float.parseFloat(packspprice);
- /* }
- else
- {
- mulprice=Float.parseFloat(packlist.get(0).getProductPack_SP());
- }*/
- mulqty= np.getValue();
- total=mulprice*mulqty;
- packsp.setText("$" + String.format("%.2f%n", total));
- System.out.println("price test" + packlist.get(0).getProductPack_SP() + "," + mulprice + "," + mulqty + "," + String.format("%.2f%n", total));
- /* if(packelseprice!=null)
- {*/
- mulelseprice= Float.parseFloat(packelseprice);
- /* }
- else
- {
- mulelseprice=Float.parseFloat(packlist.get(0).getProductPack_ElseWhere());
- }*/
- totalelse=mulelseprice*mulqty;
- packelsewhere.setText("$" + String.format("%.2f%n", totalelse));
- }
- else
- {
- System.out.println("STNMS NOT 0");
- proqty.setText(String.valueOf(np.getValue())); //set the value to textview
- // Do something with value!
- /* if (packreorderprice != null) {*/
- mulreorderprice = Float.parseFloat(packreorderprice);
- /*} else {
- mulreorderprice = Float.parseFloat(packlist.get(0).getProductPack_ReorderPrice());
- }*/
- mulqty= np.getValue();
- total=mulreorderprice*mulqty;
- packsp.setText("$" + String.format("%.2f%n", total));
- System.out.println("price test" + packlist.get(0).getProductPack_SP() + "," + mulreorderprice + "," + mulqty + "," + String.format("%.2f%n", total));
- /* if(packelseprice!=null)
- {*/
- mulelseprice= Float.parseFloat(packelseprice);
- /*}
- else
- {
- mulelseprice=Float.parseFloat(packlist.get(0).getProductPack_ElseWhere());
- }*/
- totalelse=mulelseprice*mulqty;
- packelsewhere.setText("$" + String.format("%.2f%n", totalelse));
- }
- }
- });
- alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- // Cancel.
- }
- });
- alert.show();
- }
Add Comment
Please, Sign In to add comment