use of android.widget.Toast in project AdMoney by ErnestoGonAr.
the class PagoRecurrenteActivity method validar.
public boolean validar() {
if (n.getText().toString().equals("")) {
Toast toast = Toast.makeText(this, "Ingrese el nombre", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return false;
}
if (cant.getText().toString().equals("")) {
Toast toast = Toast.makeText(this, "Ingrese la cantidad", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return false;
}
if (Float.parseFloat(cant.getText().toString()) > 999999) {
Toast toast = Toast.makeText(this, "Cantidad muy grande", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return false;
}
return true;
}
use of android.widget.Toast in project AdMoney by ErnestoGonAr.
the class RecuperarActivity method evento.
public void evento(View v) {
bandera = false;
Spinner a = (Spinner) findViewById(R.id.spinnerPR);
String as = a.getSelectedItem().toString();
EditText b = (EditText) findViewById(R.id.editTextPR);
String bs = b.getText().toString();
if (a.getSelectedItemPosition() == 0) {
Toast toast = Toast.makeText(this, "Selecciona una pregunta de seguridad", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
if (bs.equals("")) {
Toast toast = Toast.makeText(this, "Escribe tu respuesta", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
bandera = true;
}
use of android.widget.Toast in project AdMoney by ErnestoGonAr.
the class RecuperarActivity method error.
public void error(View v) {
Toast toast = Toast.makeText(this, "Pregunta y/o respuesta no coinciden", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
use of android.widget.Toast in project AdMoney by ErnestoGonAr.
the class CategoriasEgresos method insertar.
private void insertar() {
bandera = false;
if (!validarNoRep(a, validartexto)) {
Toast toast = Toast.makeText(this, "Una categoria con el nombre, ya se ha insertado", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
if (validartexto.equals("")) {
Toast toast = Toast.makeText(this, "Escribe nombre de Categoria", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
bandera = true;
}
use of android.widget.Toast in project AdMoney by ErnestoGonAr.
the class CategoriasIngreso method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_categorias_ingreso);
aceptar = (Button) findViewById(R.id.aceptarin);
agregar = (ImageButton) findViewById(R.id.agregar_ci);
bd = new BDHandlerAM(this);
bandera = false;
a = bd.spinneringresos();
RecyclerView rv = (RecyclerView) findViewById(R.id.recycler_ci);
try {
String[][] dataSet = bd.obtenerCategoriasi();
LinearLayoutManager ln = new LinearLayoutManager(this);
ln.setOrientation(LinearLayoutManager.VERTICAL);
CustomAdapter_CategoriasI adapter = new CustomAdapter_CategoriasI(dataSet);
rv.setLayoutManager(ln);
rv.setAdapter(adapter);
} catch (ArrayIndexOutOfBoundsException e) {
Toast toast = Toast.makeText(this, "No hay categorias de Ingresos", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
agregar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(CategoriasIngreso.this);
View mView = getLayoutInflater().inflate(R.layout.insertar_categoriase, null);
final EditText insertar = (EditText) mView.findViewById(R.id.insertb);
final Button iguardar = (Button) mView.findViewById(R.id.insertarguardar);
final Button icancelar = (Button) mView.findViewById(R.id.insertarcancelar);
mBuilder.setView(mView);
AlertDialog dialog = mBuilder.create();
dialog.show();
insertar.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(insertar, InputMethodManager.SHOW_IMPLICIT);
iguardar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
validartexto = insertar.getText().toString();
insertar();
if (bandera) {
bd.insertarCI(primeroMayuscula(insertar.getText().toString()), 7);
}
onBackPressed2();
}
});
icancelar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed2();
}
});
}
});
aceptar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
Aggregations