Skip to content

Commit

Permalink
#17527: Fixed profile import with widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
Corwin-Kh committed Jul 12, 2023
1 parent 4243690 commit a77edd2
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package net.osmand.plus.settings.fragments;

import static net.osmand.plus.views.mapwidgets.MapWidgetRegistry.AVAILABLE_MODE;
import static net.osmand.plus.views.mapwidgets.MapWidgetRegistry.ENABLED_MODE;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -17,6 +20,7 @@
import net.osmand.PlatformUtil;
import net.osmand.plus.AppInitializer;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.plugins.PluginsHelper;
import net.osmand.plus.plugins.audionotes.AudioVideoNotesPlugin;
import net.osmand.plus.resources.ResourceManager.ReloadIndexesListener;
Expand All @@ -25,9 +29,12 @@
import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportListener;
import net.osmand.plus.settings.backend.backup.items.FileSettingsItem;
import net.osmand.plus.settings.backend.backup.items.SettingsItem;
import net.osmand.plus.views.layers.MapInfoLayer;
import net.osmand.plus.views.mapwidgets.WidgetsPanel;

import org.apache.commons.logging.Log;

import java.util.Collections;
import java.util.List;

public abstract class ImportSettingsFragment extends BaseSettingsListFragment {
Expand Down Expand Up @@ -100,6 +107,13 @@ public void onImportFinished(boolean succeed, boolean needRestart, @NonNull List
if (plugin != null) {
plugin.indexingFiles(true, true);
}
MapActivity activity = getMapActivity();
if (activity != null) {
MapInfoLayer mapInfoLayer = activity.getMapLayers().getMapInfoLayer();
if (mapInfoLayer != null) {
mapInfoLayer.recreateAllControls(activity);
}
}
}
importFinished(succeed, needRestart, items);
}
Expand Down

0 comments on commit a77edd2

Please sign in to comment.