Commit 2e1b3416 authored by Amirhossein Naghshzan's avatar Amirhossein Naghshzan
Browse files

TVAccountExport: check if account has password

Change-Id: I9f95a4891beaa919b8cbf4c10c9fef854dc6fd35
parent f808e9e4
......@@ -53,12 +53,16 @@ public class TVAccountExport extends JamiGuidedStepFragment<JamiAccountSummaryPr
implements JamiAccountSummaryView {
private static final long PASSWORD = 1L;
private static final long ACTION = 2L;
private ProgressDialog mWaitDialog;
private String mIdAccount;
private boolean mHasPassword;
public static TVAccountExport createInstance(String idAccount) {
public static TVAccountExport createInstance(String idAccount, boolean hasPassword) {
TVAccountExport fragment = new TVAccountExport();
fragment.mIdAccount = idAccount;
fragment.mHasPassword = hasPassword;
return fragment;
}
......@@ -82,7 +86,16 @@ public class TVAccountExport extends JamiGuidedStepFragment<JamiAccountSummaryPr
@Override
public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
addPasswordAction(getActivity(), actions, PASSWORD, getString(R.string.account_enter_password), "", "");
if (mHasPassword) {
addPasswordAction(getActivity(), actions, PASSWORD, getString(R.string.account_enter_password), "", "");
} else {
addAction(getContext(), actions, ACTION, R.string.account_start_export_button);
}
}
@Override
public void onGuidedActionClicked(GuidedAction action) {
presenter.startAccountExport("");
}
@Override
......
......@@ -418,8 +418,8 @@ public class MainFragment extends BaseBrowseFragment<MainPresenter> implements M
}
@Override
public void showExportDialog(String pAccountID) {
GuidedStepSupportFragment wizard = TVAccountExport.createInstance(pAccountID);
public void showExportDialog(String pAccountID, boolean hasPassword) {
GuidedStepSupportFragment wizard = TVAccountExport.createInstance(pAccountID, hasPassword);
GuidedStepSupportFragment.add(getParentFragmentManager(), wizard, R.id.main_browse_fragment);
}
......
......@@ -113,7 +113,7 @@ public class MainPresenter extends RootPresenter<MainView> {
}
public void onExportClicked() {
getView().showExportDialog(mAccountService.getCurrentAccount().getAccountID());
getView().showExportDialog(mAccountService.getCurrentAccount().getAccountID(), mAccountService.getCurrentAccount().hasPassword());
}
public void onLicenceClicked(int aboutType) {
......
......@@ -43,7 +43,7 @@ public interface MainView {
void displayAccountInfos(HomeNavigationViewModel viewModel);
void updateModel(Account account);
void showExportDialog(String pAccountID);
void showExportDialog(String pAccountID, boolean hasPassword);
void showProfileEditing();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment