Search in sources :

Example 31 with Toast

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;
}
Also used : Toast(android.widget.Toast)

Example 32 with Toast

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;
}
Also used : EditText(android.widget.EditText) Toast(android.widget.Toast) Spinner(android.widget.Spinner)

Example 33 with Toast

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;
}
Also used : Toast(android.widget.Toast)

Example 34 with Toast

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;
}
Also used : Toast(android.widget.Toast)

Example 35 with Toast

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();
        }
    });
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) EditText(android.widget.EditText) InputMethodManager(android.view.inputmethod.InputMethodManager) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) Toast(android.widget.Toast) ImageButton(android.widget.ImageButton) Button(android.widget.Button) CustomAdapter_CategoriasI(layout.CustomAdapter_CategoriasI) RecyclerView(android.support.v7.widget.RecyclerView)

Aggregations

Toast (android.widget.Toast)485 Context (android.content.Context)89 View (android.view.View)86 TextView (android.widget.TextView)74 Intent (android.content.Intent)55 Rect (android.graphics.Rect)34 LayoutInflater (android.view.LayoutInflater)31 SuppressLint (android.annotation.SuppressLint)30 JSONObject (org.json.JSONObject)23 ImageView (android.widget.ImageView)21 RequestQueue (com.android.volley.RequestQueue)20 Response (com.android.volley.Response)20 EditText (android.widget.EditText)19 JSONException (org.json.JSONException)18 VolleyError (com.android.volley.VolleyError)17 JsonObjectRequest (com.android.volley.toolbox.JsonObjectRequest)17 User (model.User)16 PendingIntent (android.app.PendingIntent)15 File (java.io.File)15 HashMap (java.util.HashMap)15