|
|
|
@ -138,6 +138,7 @@ public class FragmentAccount extends FragmentBase {
|
|
|
|
|
private Group grpFolders;
|
|
|
|
|
|
|
|
|
|
private long id = -1;
|
|
|
|
|
private boolean saving = false;
|
|
|
|
|
private int auth_type = Helper.AUTH_TYPE_PASSWORD;
|
|
|
|
|
private int color = Color.TRANSPARENT;
|
|
|
|
|
|
|
|
|
@ -502,21 +503,20 @@ public class FragmentAccount extends FragmentBase {
|
|
|
|
|
new SimpleTask<CheckResult>() {
|
|
|
|
|
@Override
|
|
|
|
|
protected void onPreExecute(Bundle args) {
|
|
|
|
|
saving = true;
|
|
|
|
|
getActivity().invalidateOptionsMenu();
|
|
|
|
|
Helper.setViewsEnabled(view, false);
|
|
|
|
|
btnAuthorize.setEnabled(false);
|
|
|
|
|
btnCheck.setEnabled(false);
|
|
|
|
|
pbCheck.setVisibility(View.VISIBLE);
|
|
|
|
|
tvIdle.setVisibility(View.GONE);
|
|
|
|
|
grpFolders.setVisibility(View.GONE);
|
|
|
|
|
btnSave.setVisibility(View.GONE);
|
|
|
|
|
tvError.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onPostExecute(Bundle args) {
|
|
|
|
|
saving = false;
|
|
|
|
|
getActivity().invalidateOptionsMenu();
|
|
|
|
|
Helper.setViewsEnabled(view, true);
|
|
|
|
|
btnAuthorize.setEnabled(true);
|
|
|
|
|
btnCheck.setEnabled(true);
|
|
|
|
|
pbCheck.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -757,20 +757,18 @@ public class FragmentAccount extends FragmentBase {
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
@Override
|
|
|
|
|
protected void onPreExecute(Bundle args) {
|
|
|
|
|
saving = true;
|
|
|
|
|
getActivity().invalidateOptionsMenu();
|
|
|
|
|
Helper.setViewsEnabled(view, false);
|
|
|
|
|
btnAuthorize.setEnabled(false);
|
|
|
|
|
btnCheck.setEnabled(false);
|
|
|
|
|
btnSave.setEnabled(false);
|
|
|
|
|
pbSave.setVisibility(View.VISIBLE);
|
|
|
|
|
tvError.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onPostExecute(Bundle args) {
|
|
|
|
|
saving = false;
|
|
|
|
|
getActivity().invalidateOptionsMenu();
|
|
|
|
|
Helper.setViewsEnabled(view, true);
|
|
|
|
|
btnAuthorize.setEnabled(true);
|
|
|
|
|
btnCheck.setEnabled(true);
|
|
|
|
|
btnSave.setEnabled(true);
|
|
|
|
|
pbSave.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1216,7 +1214,7 @@ public class FragmentAccount extends FragmentBase {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onPrepareOptionsMenu(Menu menu) {
|
|
|
|
|
menu.findItem(R.id.menu_delete).setVisible(id > 0);
|
|
|
|
|
menu.findItem(R.id.menu_delete).setVisible(id > 0 && !saving);
|
|
|
|
|
super.onPrepareOptionsMenu(menu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1237,16 +1235,16 @@ public class FragmentAccount extends FragmentBase {
|
|
|
|
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
Helper.setViewsEnabled(view, false);
|
|
|
|
|
btnAuthorize.setEnabled(false);
|
|
|
|
|
btnCheck.setEnabled(false);
|
|
|
|
|
btnSave.setEnabled(false);
|
|
|
|
|
pbWait.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
args.putLong("id", id);
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
@Override
|
|
|
|
|
protected void onPostExecute(Bundle args) {
|
|
|
|
|
Helper.setViewsEnabled(view, false);
|
|
|
|
|
pbWait.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected Void onExecute(Context context, Bundle args) {
|
|
|
|
|
long id = args.getLong("id");
|
|
|
|
|