-
Notifications
You must be signed in to change notification settings - Fork 47
Long-Click-Delete Option Ready #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,10 +47,6 @@ Features | |
|
|
||
| History | ||
| ------- | ||
| v1.14 28-Oct-2012 | ||
| * Added support for syncing to Dropbox | ||
| * Hide account details in screenshots and task manager | ||
|
|
||
| v1.13 12-Aug-2012 | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is unnecessary.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with this one...I didn't added on purpose |
||
| * Added support for all API levels up to and including 16 | ||
| * Fixed a few bugs | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,7 @@ public class FullAccountList extends AccountsList { | |
| private static final int DIALOG_ABOUT = 2; | ||
| private static final int CONFIRM_DELETE_DB_DIALOG = 3; | ||
| private static final int IMPORT_CERT_DIALOG = 4; | ||
| private static final int DELETE_DIALOG = 5; | ||
|
|
||
| public static final int RESULT_EXIT = 0; | ||
| public static final int RESULT_ENTER_PW = 1; | ||
|
|
@@ -337,6 +338,39 @@ public void onClick(DialogInterface dialog, int id) { | |
| } | ||
| }); | ||
| break; | ||
| case DELETE_DIALOG: | ||
|
|
||
| dialogBuilder.setMessage(getString(R.string.confirm_delete_dialog))//setting the dialog of confirm_delete_dialog from string.xml | ||
| .setCancelable(false) | ||
| .setPositiveButton("Yes", new DialogInterface.OnClickListener() { | ||
| public void onClick(DialogInterface dialog, int id) { | ||
| getPasswordDatabase().deleteAccount(account.getAccountName());//insert into database and erase the account selected | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I run this I get a NullPointerException on this line. The problem is the "account" variable is null. To determine the name of the account to delete you'll need to find out what account name was long-clicked.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i will give it a try |
||
| final String accountName = account.getAccountName(); | ||
|
|
||
| new SaveDatabaseAsyncTask(FullAccountList.this, new Callback() { | ||
| @Override | ||
| public void execute() { | ||
| String message = String.format(getString(R.string.account_deleted), accountName); | ||
| Toast.makeText(FullAccountList.this, message, Toast.LENGTH_SHORT).show(); | ||
| //Β Set this flag so that when we're returned to the FullAccountList | ||
| // activity the list is refreshed | ||
| FullAccountList.this.setResult(AddEditAccount.EDIT_ACCOUNT_RESULT_CODE_TRUE); | ||
| finish(); | ||
| } | ||
| }).execute(getPasswordDatabase()); | ||
| } | ||
| }) | ||
| .setNegativeButton("No", new DialogInterface.OnClickListener() { | ||
| public void onClick(DialogInterface dialog, int id) { | ||
|
|
||
| dialog.cancel();//if the selection is "No" cancel the dialog | ||
| } | ||
| }); | ||
| break; | ||
| } | ||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 372 - 375 seem unnecessary.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i will erase that. thanks! |
||
| return dialogBuilder.create(); | ||
| } | ||
| } | ||
|
|
||
| return dialogBuilder.create(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i didn't change anything in AndroidManifest.xml. I added it to my changes by mistake.