use of layout.ItemC in project AdMoney by ErnestoGonAr.
the class Detalle_Categorias method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detalle__categorias);
bd = new BDHandlerAM(this);
a = bd.spinneregresos();
bandera = false;
modificar = (TextView) findViewById(R.id.modificar);
eliminar = (TextView) findViewById(R.id.eliminar);
quitaricono = (TextView) findViewById(R.id.quitaricono);
cambiaricono = (TextView) findViewById(R.id.cambiaricono);
final ItemC item = (ItemC) getIntent().getSerializableExtra("item");
itemaux = item;
modificar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(Detalle_Categorias.this);
View mView = getLayoutInflater().inflate(R.layout.categorias_selected, null);
final EditText mtexto = (EditText) mView.findViewById(R.id.modificarb);
final Button mguardar = (Button) mView.findViewById(R.id.modificarguardar);
final Button mcancelar = (Button) mView.findViewById(R.id.modificarcancelar);
mtexto.setText(itemaux.nombre);
mtexto.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
mBuilder.setView(mView);
AlertDialog dialog = mBuilder.create();
dialog.show();
mguardar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
validartexto = mtexto.getText().toString();
updatear(itemaux.nombre);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mtexto.getWindowToken(), 0);
if (bandera) {
bd.updateCategoriasE(primeroMayuscula(mtexto.getText().toString()), itemaux.nombre);
}
onBackPressed();
}
});
mcancelar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
// ///////////////////////////////////////////////////////////
}
});
eliminar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new AlertDialog.Builder(Detalle_Categorias.this).setTitle("Eliminar Categoria").setMessage("Seguro que quieres eliminar categoria").setPositiveButton("Si", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Positive");
if (item.nombre.equals("Prestamos")) {
msjprestamos();
onBackPressed();
} else {
bd.eliminarCE(item.nombre);
onBackPressed();
}
}
}).setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Negative");
onBackPressed();
}
}).show();
}
});
quitaricono.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new AlertDialog.Builder(Detalle_Categorias.this).setTitle("Eliminar Icono").setMessage("Seguro que quieres quitar icono?").setPositiveButton("Si", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Positive");
bd.quitarIconoe(item.id);
msjiconoquitado();
onBackPressed();
}
}).setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Negative");
onBackPressed();
}
}).show();
}
});
cambiaricono.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(Detalle_Categorias.this);
View mView = getLayoutInflater().inflate(R.layout.categoriase_elegir, null);
ImageButton cae1 = (ImageButton) mView.findViewById(R.id.cae1);
ImageButton cae2 = (ImageButton) mView.findViewById(R.id.cae2);
ImageButton cae3 = (ImageButton) mView.findViewById(R.id.cae3);
ImageButton cae4 = (ImageButton) mView.findViewById(R.id.cae4);
ImageButton cae5 = (ImageButton) mView.findViewById(R.id.cae5);
ImageButton cae6 = (ImageButton) mView.findViewById(R.id.cae6);
ImageButton cae7 = (ImageButton) mView.findViewById(R.id.cae7);
ImageButton cae8 = (ImageButton) mView.findViewById(R.id.cae8);
ImageButton cae9 = (ImageButton) mView.findViewById(R.id.cae9);
ImageButton cae10 = (ImageButton) mView.findViewById(R.id.cae10);
ImageButton cae11 = (ImageButton) mView.findViewById(R.id.cae11);
ImageButton cae12 = (ImageButton) mView.findViewById(R.id.cae12);
ImageButton cae13 = (ImageButton) mView.findViewById(R.id.cae13);
ImageButton cae14 = (ImageButton) mView.findViewById(R.id.cae14);
ImageButton cae16 = (ImageButton) mView.findViewById(R.id.cae16);
ImageButton cae17 = (ImageButton) mView.findViewById(R.id.cae17);
ImageButton cae18 = (ImageButton) mView.findViewById(R.id.cae18);
ImageButton cae19 = (ImageButton) mView.findViewById(R.id.cae19);
ImageButton cae20 = (ImageButton) mView.findViewById(R.id.cae20);
ImageButton cae21 = (ImageButton) mView.findViewById(R.id.cae21);
ImageButton caenuevo1 = (ImageButton) mView.findViewById(R.id.caenuevo1);
ImageButton caenuevo2 = (ImageButton) mView.findViewById(R.id.caenuevo2);
ImageButton caenuevo3 = (ImageButton) mView.findViewById(R.id.caenuevo3);
ImageButton caenuevo4 = (ImageButton) mView.findViewById(R.id.caenuevo4);
ImageButton caenuevo5 = (ImageButton) mView.findViewById(R.id.caenuevo5);
ImageButton caenuevo6 = (ImageButton) mView.findViewById(R.id.caenuevo6);
mBuilder.setView(mView);
AlertDialog dialog = mBuilder.create();
dialog.show();
cae1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 1);
onBackPressed();
}
});
cae2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 2);
onBackPressed();
}
});
cae3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 3);
onBackPressed();
}
});
cae4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 4);
onBackPressed();
}
});
cae5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 5);
onBackPressed();
}
});
cae6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 6);
onBackPressed();
}
});
cae7.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 7);
onBackPressed();
}
});
cae8.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 8);
onBackPressed();
}
});
cae9.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 9);
onBackPressed();
}
});
cae10.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 10);
onBackPressed();
}
});
cae11.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 11);
onBackPressed();
}
});
cae12.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 12);
onBackPressed();
}
});
cae13.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 13);
onBackPressed();
}
});
cae14.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 14);
onBackPressed();
}
});
cae16.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 16);
onBackPressed();
}
});
cae17.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 17);
onBackPressed();
}
});
cae18.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 18);
onBackPressed();
}
});
cae19.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 19);
onBackPressed();
}
});
cae20.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 20);
onBackPressed();
}
});
cae21.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 21);
onBackPressed();
}
});
caenuevo1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 22);
onBackPressed();
}
});
caenuevo2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 23);
onBackPressed();
}
});
caenuevo3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 24);
onBackPressed();
}
});
caenuevo4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 25);
onBackPressed();
}
});
caenuevo5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 26);
onBackPressed();
}
});
caenuevo6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoe(itemaux.id, 27);
onBackPressed();
}
});
}
});
}
use of layout.ItemC in project AdMoney by ErnestoGonAr.
the class Detalle_CategoriasIngreso method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detalle_categoriasingreso);
bd = new BDHandlerAM(this);
a = bd.spinneringresos();
bandera = false;
modificar = (TextView) findViewById(R.id.modificari);
eliminar = (TextView) findViewById(R.id.eliminari);
quitaricono = (TextView) findViewById(R.id.quitariconoi);
cambiaricono = (TextView) findViewById(R.id.cambiariconoi);
final ItemC item = (ItemC) getIntent().getSerializableExtra("item");
itemaux = item;
modificar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(Detalle_CategoriasIngreso.this);
View mView = getLayoutInflater().inflate(R.layout.categoriasi_selected, null);
final EditText mtexto = (EditText) mView.findViewById(R.id.modificarbi);
final Button mguardar = (Button) mView.findViewById(R.id.modificarguardari);
final Button mcancelar = (Button) mView.findViewById(R.id.modificarcancelari);
mtexto.setText(itemaux.nombre);
mtexto.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
mBuilder.setView(mView);
AlertDialog dialog = mBuilder.create();
dialog.show();
mguardar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
validartexto = mtexto.getText().toString();
updatear(itemaux.nombre);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mtexto.getWindowToken(), 0);
if (bandera) {
bd.updateCategoriasI(primeroMayuscula(mtexto.getText().toString()), itemaux.nombre);
}
onBackPressed();
}
});
mcancelar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
// ///////////////////////////////////////////////////////////
}
});
eliminar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new AlertDialog.Builder(Detalle_CategoriasIngreso.this).setTitle("Eliminar Categoria").setMessage("Seguro que quieres eliminar categoria").setPositiveButton("Si", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Positive");
if (item.nombre.equals("Deudas")) {
msjprestamos();
onBackPressed();
} else {
bd.eliminarCI(item.nombre);
onBackPressed();
}
}
}).setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Negative");
onBackPressed();
}
}).show();
}
});
quitaricono.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new AlertDialog.Builder(Detalle_CategoriasIngreso.this).setTitle("Eliminar Icono").setMessage("Seguro que quieres quitar icono?").setPositiveButton("Si", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Positive");
bd.quitarIconoi(item.id);
msjiconoquitado();
onBackPressed();
}
}).setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Negative");
onBackPressed();
}
}).show();
}
});
cambiaricono.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(Detalle_CategoriasIngreso.this);
View mView = getLayoutInflater().inflate(R.layout.categoriasi_elegir, null);
ImageButton cai1 = (ImageButton) mView.findViewById(R.id.cai1);
ImageButton cai2 = (ImageButton) mView.findViewById(R.id.cai2);
ImageButton cai3 = (ImageButton) mView.findViewById(R.id.cai3);
ImageButton cai4 = (ImageButton) mView.findViewById(R.id.cai4);
ImageButton cai5 = (ImageButton) mView.findViewById(R.id.cai5);
ImageButton cai6 = (ImageButton) mView.findViewById(R.id.cai6);
ImageButton cai8 = (ImageButton) mView.findViewById(R.id.cai8);
ImageButton cai9 = (ImageButton) mView.findViewById(R.id.cai9);
ImageButton cai10 = (ImageButton) mView.findViewById(R.id.cai10);
ImageButton cai11 = (ImageButton) mView.findViewById(R.id.cai11);
ImageButton cai12 = (ImageButton) mView.findViewById(R.id.cai12);
ImageButton cai13 = (ImageButton) mView.findViewById(R.id.cai13);
ImageButton cai14 = (ImageButton) mView.findViewById(R.id.cai14);
ImageButton cai15 = (ImageButton) mView.findViewById(R.id.cai15);
ImageButton cai16 = (ImageButton) mView.findViewById(R.id.cai16);
ImageButton cai17 = (ImageButton) mView.findViewById(R.id.cai17);
ImageButton cai18 = (ImageButton) mView.findViewById(R.id.cai18);
ImageButton cai19 = (ImageButton) mView.findViewById(R.id.cai19);
ImageButton cai20 = (ImageButton) mView.findViewById(R.id.cai20);
ImageButton cai21 = (ImageButton) mView.findViewById(R.id.cai21);
ImageButton cainuevo1 = (ImageButton) mView.findViewById(R.id.cainuevo1);
ImageButton cainuevo2 = (ImageButton) mView.findViewById(R.id.cainuevo2);
ImageButton cainuevo3 = (ImageButton) mView.findViewById(R.id.cainuevo3);
ImageButton cainuevo4 = (ImageButton) mView.findViewById(R.id.cainuevo4);
ImageButton cainuevo5 = (ImageButton) mView.findViewById(R.id.cainuevo5);
ImageButton cainuevo6 = (ImageButton) mView.findViewById(R.id.cainuevo6);
mBuilder.setView(mView);
AlertDialog dialog = mBuilder.create();
dialog.show();
cai1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 1);
onBackPressed();
}
});
cai2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 2);
onBackPressed();
}
});
cai3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 3);
onBackPressed();
}
});
cai4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 4);
onBackPressed();
}
});
cai5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 5);
onBackPressed();
}
});
cai6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 6);
onBackPressed();
}
});
cai8.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 8);
onBackPressed();
}
});
cai9.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 9);
onBackPressed();
}
});
cai10.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 10);
onBackPressed();
}
});
cai11.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 11);
onBackPressed();
}
});
cai12.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 12);
onBackPressed();
}
});
cai13.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 13);
onBackPressed();
}
});
cai14.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 14);
onBackPressed();
}
});
cai15.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 15);
onBackPressed();
}
});
cai16.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 16);
onBackPressed();
}
});
cai17.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 17);
onBackPressed();
}
});
cai18.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 18);
onBackPressed();
}
});
cai19.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 19);
onBackPressed();
}
});
cai20.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 20);
onBackPressed();
}
});
cai21.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 21);
onBackPressed();
}
});
cainuevo1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 22);
onBackPressed();
}
});
cainuevo2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 23);
onBackPressed();
}
});
cainuevo3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 24);
onBackPressed();
}
});
cainuevo4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 25);
onBackPressed();
}
});
cainuevo5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 26);
onBackPressed();
}
});
cainuevo6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bd.cambiarIconoi(itemaux.id, 27);
onBackPressed();
}
});
}
});
}
Aggregations