Back to project page BusTicketer.
The source code is released under:
Copyright (c) 2013, Nelspike All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Red...
If you think the Android project BusTicketer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package bus.ticketer.listeners; /*from w w w.java 2s. co m*/ import bus.ticketer.passenger.BusTicketer; import android.view.View; import android.view.View.OnClickListener; import android.widget.TextView; public class TicketPurchaseListener implements OnClickListener { private String function; private TextView text; private int tickets; public TicketPurchaseListener(String func, String type, TextView text, BusTicketer app) { this.function = func; this.text = text; tickets = app.getTickets().get(Integer.parseInt(type.charAt(1)+"")).size(); } @Override public void onClick(View v) { int current = Integer.parseInt(text.getText().toString()); if(function.equals("Minus")) { if(current == 0) return; current--; } else { if(current == (10-tickets) || tickets >= 11) return; current++; } text.setText(current + ""); } }