This commit is contained in:
veliymolfar 2020-03-02 17:45:29 +02:00
parent 67655b7496
commit 59352429ac
2 changed files with 10 additions and 2 deletions

View file

@ -1990,6 +1990,10 @@ public class SettingsHelper {
return selectedItems;
}
public void setSelectedItems(@Nullable List<SettingsItem> selectedItems) {
this.selectedItems = selectedItems;
}
@SuppressLint("StaticFieldLeak")
private class ImportItemsAsyncTask extends AsyncTask<Void, Void, Boolean> {

View file

@ -18,6 +18,7 @@ import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.SettingsHelper;
import net.osmand.plus.SettingsHelper.SettingsItem;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
@ -43,6 +44,7 @@ public class ImportCompleteFragment extends BaseOsmAndFragment {
private List<SettingsItem> settingsItems;
private String fileName;
private boolean nightMode;
private SettingsHelper settingsHelper;
public static void showInstance(FragmentManager fm, @NonNull List<SettingsItem> settingsItems,
@NonNull String fileName) {
@ -62,9 +64,10 @@ public class ImportCompleteFragment extends BaseOsmAndFragment {
fileName = savedInstanceState.getString(FILE_NAME_KEY);
}
app = requireMyApplication();
settingsHelper = app.getSettingsHelper();
nightMode = !app.getSettings().isLightContent();
if (settingsItems == null) {
settingsItems = app.getSettingsHelper().getImportedItems();
settingsItems = settingsHelper.getImportedItems();
if (settingsItems == null) {
dismissFragment();
}
@ -127,7 +130,8 @@ public class ImportCompleteFragment extends BaseOsmAndFragment {
if (fm != null) {
fm.popBackStack(IMPORT_SETTINGS_TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
app.getSettingsHelper().setImportedItems(null);
settingsHelper.setImportedItems(null);
settingsHelper.setSelectedItems(null);
}
private void navigateTo(AdditionalDataWrapper.Type type) {