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