Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (anotodo.size() > 0) {
- AlertDialog.Builder builder = new AlertDialog.Builder(AnoTodoActivity.this);
- builder.setTitle("AVISO!!!!");
- // Cria um TextView personalizado para exibir o texto piscante
- TextView messageView = new TextView(AnoTodoActivity.this);
- messageView.setText("DESEJA APAGAR OS DADOS ??🫡");
- messageView.setTextSize(16);
- messageView.setTextColor(Color.BLACK);
- messageView.setPadding(20, 20, 20, 20);
- // Cria uma animação para piscar o texto
- AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
- alphaAnimation.setDuration(500);
- alphaAnimation.setRepeatCount(Animation.INFINITE);
- alphaAnimation.setRepeatMode(Animation.REVERSE);
- // Define a animação no TextView
- messageView.startAnimation(alphaAnimation);
- builder.setView(messageView);
- builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- SketchwareUtil.showMessage(AnoTodoActivity.this, "CLICA E AGUARDE 3 SEGUNDOS PARA APAGAR!\n");
- n = 0;
- for (int _repeat50 = 0; _repeat50 < (int)(anotodo.size()); _repeat50++) {
- fire_ano.child(anotodo.get((int)n).get("keyy").toString()).removeValue();
- n++;
- }
- SketchwareUtil.showMessage(AnoTodoActivity.this, "Você apagou tudo!");
- }
- });
- builder.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- ((BaseAdapter)listview2_ano.getAdapter()).notifyDataSetChanged();
- }
- });
- AlertDialog alertDialog = builder.create();
- alertDialog.show();
- } else {
- SketchwareUtil.showMessage(AnoTodoActivity.this, "Não há nada para apagar!");
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement