diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml
index d762e0a261..f108fc7dd5 100644
--- a/OsmAnd/AndroidManifest.xml
+++ b/OsmAnd/AndroidManifest.xml
@@ -247,6 +247,7 @@
+
@@ -262,6 +263,7 @@
+
@@ -466,6 +468,13 @@
+
+
+
+
+
+
+
@@ -478,28 +487,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/OsmAnd/res/layout/plugin.xml b/OsmAnd/res/layout/plugin.xml
index b0436d95e5..056fc218f0 100644
--- a/OsmAnd/res/layout/plugin.xml
+++ b/OsmAnd/res/layout/plugin.xml
@@ -1,186 +1,204 @@
-
+
-
+
-
+
+
+
+
+
+
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ android:layout_marginStart="@dimen/content_padding"
+ android:layout_marginLeft="@dimen/content_padding"
+ android:layout_marginTop="@dimen/content_padding"
+ android:layout_marginEnd="@dimen/content_padding"
+ android:layout_marginRight="@dimen/content_padding"
+ android:text="@string/shared_string_description"
+ android:textColor="?android:textColorSecondary"
+ android:textSize="@dimen/default_desc_text_size"
+ osmand:textAllCapsCompat="true"
+ osmand:typeface="@string/font_roboto_medium" />
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/plugins.xml b/OsmAnd/res/layout/plugins.xml
index 095bfee61c..66d220fce8 100644
--- a/OsmAnd/res/layout/plugins.xml
+++ b/OsmAnd/res/layout/plugins.xml
@@ -1,14 +1,24 @@
-
+
+
+
+
+
+
-
+ android:dividerHeight="1dp"
+ android:drawSelectorOnTop="true" />
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/plugins_list_item.xml b/OsmAnd/res/layout/plugins_list_item.xml
index c616b0014f..4e8f369e0c 100644
--- a/OsmAnd/res/layout/plugins_list_item.xml
+++ b/OsmAnd/res/layout/plugins_list_item.xml
@@ -52,6 +52,7 @@
android:ellipsize="end"
android:lines="2"
android:maxLines="2"
+ android:scrollbars="none"
android:text="@string/lorem_ipsum"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
diff --git a/OsmAnd/res/layout/profile_preference_toolbar.xml b/OsmAnd/res/layout/profile_preference_toolbar.xml
index b76eb61696..6776a7a70c 100644
--- a/OsmAnd/res/layout/profile_preference_toolbar.xml
+++ b/OsmAnd/res/layout/profile_preference_toolbar.xml
@@ -64,6 +64,13 @@
tools:text="Some description" />
+
+
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java b/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
index b9ea4a62cf..eb806a5a33 100644
--- a/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
+++ b/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
@@ -8,9 +8,9 @@ import androidx.annotation.NonNull;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
-import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.R;
-import net.osmand.plus.settings.fragments.BaseSettingsFragment;
+import net.osmand.plus.settings.backend.OsmandSettings;
+import net.osmand.plus.settings.fragments.BaseSettingsFragment.SettingsScreenType;
import java.io.IOException;
import java.util.HashMap;
@@ -66,13 +66,8 @@ public class AccessibilityPlugin extends OsmandPlugin {
}
@Override
- public Class extends Activity> getSettingsActivity() {
- return SettingsAccessibilityActivity.class;
- }
-
- @Override
- public Class extends BaseSettingsFragment> getSettingsFragment() {
- return AccessibilitySettingsFragment.class;
+ public SettingsScreenType getSettingsScreenType() {
+ return SettingsScreenType.ACCESSIBILITY_SETTINGS;
}
@Override
diff --git a/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java b/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java
index 781a10bf41..609c43fcff 100644
--- a/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java
+++ b/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java
@@ -4,6 +4,8 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.provider.Settings;
+import android.view.LayoutInflater;
+import android.view.View;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener;
import android.widget.ImageView;
@@ -13,21 +15,24 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceViewHolder;
-import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.access.AccessibilityMode;
import net.osmand.plus.access.RelativeDirectionStyle;
+import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet.CopyAppModePrefsListener;
-import net.osmand.plus.settings.fragments.BaseSettingsFragment;
-import net.osmand.plus.settings.fragments.OnPreferenceChanged;
+import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet.ResetAppModePrefsListener;
+import net.osmand.plus.settings.fragments.BaseSettingsFragment;
+import net.osmand.plus.settings.fragments.OnPreferenceChanged;
import net.osmand.plus.settings.preferences.ListPreferenceEx;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
+import static net.osmand.plus.activities.PluginInfoFragment.PLUGIN_INFO;
+
public class AccessibilitySettingsFragment extends BaseSettingsFragment implements OnPreferenceChanged, CopyAppModePrefsListener, ResetAppModePrefsListener {
private static final String ACCESSIBILITY_OPTIONS = "accessibility_options";
@@ -36,6 +41,8 @@ public class AccessibilitySettingsFragment extends BaseSettingsFragment implemen
private AccessibilityStateChangeListener accessibilityListener;
+ boolean showSwitchProfile = false;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -47,6 +54,28 @@ public class AccessibilitySettingsFragment extends BaseSettingsFragment implemen
}
}
};
+
+ Bundle args = getArguments();
+ if (args != null) {
+ showSwitchProfile = args.getBoolean(PLUGIN_INFO, false);
+ }
+ }
+
+ @Override
+ protected void createToolbar(LayoutInflater inflater, View view) {
+ super.createToolbar(inflater, view);
+
+ View switchProfile = view.findViewById(R.id.profile_button);
+ if (switchProfile != null) {
+ AndroidUiHelper.updateVisibility(switchProfile, showSwitchProfile);
+ }
+ }
+
+ @Override
+ public Bundle buildArguments() {
+ Bundle args = super.buildArguments();
+ args.putBoolean(PLUGIN_INFO, showSwitchProfile);
+ return args;
}
@Override
diff --git a/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java b/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java
deleted file mode 100644
index 719ed05863..0000000000
--- a/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package net.osmand.access;
-
-
-import android.os.Bundle;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
-import android.preference.PreferenceCategory;
-import android.preference.PreferenceGroup;
-import android.preference.PreferenceScreen;
-
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.R;
-import net.osmand.plus.access.AccessibilityMode;
-import net.osmand.plus.access.RelativeDirectionStyle;
-import net.osmand.plus.activities.SettingsBaseActivity;
-
-public class SettingsAccessibilityActivity extends SettingsBaseActivity {
-
- private ListPreference accessibilityModePreference;
- private ListPreference directionStylePreference;
- private ListPreference autoannouncePeriodPreference;
-
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- ((OsmandApplication) getApplication()).applyTheme(this);
- super.onCreate(savedInstanceState);
- getToolbar().setTitle(R.string.shared_string_accessibility);
- PreferenceScreen grp = getPreferenceScreen();
-
- String[] entries = new String[AccessibilityMode.values().length];
- for (int i = 0; i < entries.length; i++) {
- entries[i] = AccessibilityMode.values()[i].toHumanString(getMyApplication());
- }
- accessibilityModePreference = createListPreference(settings.ACCESSIBILITY_MODE, entries, AccessibilityMode.values(),
- R.string.accessibility_mode, R.string.accessibility_mode_descr);
- accessibilityModePreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
- private final OnPreferenceChangeListener committer = accessibilityModePreference.getOnPreferenceChangeListener();
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- if (committer != null)
- committer.onPreferenceChange(preference, newValue);
- updateAllSettings();
- return true;
- }
- });
- addSpeechRateSetting(grp);
-
- grp.addPreference(accessibilityModePreference);
- PreferenceCategory cat = new PreferenceCategory(this);
- cat.setKey("accessibility_options");
- cat.setTitle(R.string.accessibility_options);
- cat.setEnabled(getMyApplication().accessibilityEnabled());
- grp.addPreference(cat);
-
- entries = new String[RelativeDirectionStyle.values().length];
- for (int i = 0; i < entries.length; i++) {
- entries[i] = RelativeDirectionStyle.values()[i].toHumanString(getMyApplication());
- }
- directionStylePreference = createListPreference(settings.DIRECTION_STYLE, entries, RelativeDirectionStyle.values(),
- R.string.settings_direction_style, R.string.settings_direction_style_descr);
- directionStylePreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
- private final OnPreferenceChangeListener committer = directionStylePreference.getOnPreferenceChangeListener();
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- if (committer != null)
- committer.onPreferenceChange(preference, newValue);
- updateAllSettings();
- return true;
- }
- });
- cat.addPreference(directionStylePreference);
-
- cat.addPreference(createCheckBoxPreference(settings.ACCESSIBILITY_SMART_AUTOANNOUNCE, R.string.access_smart_autoannounce,
- R.string.access_smart_autoannounce_descr));
-
- final int[] seconds = new int[] {5, 10, 15, 20, 30, 45, 60, 90};
- final int[] minutes = new int[] {2, 3, 5};
- autoannouncePeriodPreference = createTimeListPreference(settings.ACCESSIBILITY_AUTOANNOUNCE_PERIOD, seconds, minutes, 1000,
- R.string.access_autoannounce_period, R.string.access_autoannounce_period_descr);
- autoannouncePeriodPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
- private final OnPreferenceChangeListener committer = autoannouncePeriodPreference.getOnPreferenceChangeListener();
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- if (committer != null)
- committer.onPreferenceChange(preference, newValue);
- updateAllSettings();
- return true;
- }
- });
- cat.addPreference(autoannouncePeriodPreference);
- cat.addPreference(createCheckBoxPreference(settings.DIRECTION_AUDIO_FEEDBACK, R.string.access_direction_audio_feedback,
- R.string.access_direction_audio_feedback_descr));
- cat.addPreference(createCheckBoxPreference(settings.DIRECTION_HAPTIC_FEEDBACK, R.string.access_direction_haptic_feedback,
- R.string.access_direction_haptic_feedback_descr));
-
- }
-
-
- protected void addSpeechRateSetting(PreferenceGroup grp) {
- Float[] sprValues = new Float[] {0.5f, 0.75f, 1f, 1.25f, 1.5f, 2f} ;
- String[] sprNames = new String[sprValues.length];
- for(int i = 0; i < sprNames.length; i++) {
- sprNames[i] = (int)(sprValues[i] * 100) + " %";
- }
- grp.addPreference(createListPreference(settings.SPEECH_RATE, sprNames, sprValues, R.string.speech_rate, R.string.speech_rate_descr));
- }
-
-
-
- public void updateAllSettings() {
- super.updateAllSettings();
- PreferenceCategory accessibilityOptions = ((PreferenceCategory)(getPreferenceScreen().findPreference("accessibility_options")));
- if (accessibilityOptions != null)
- accessibilityOptions.setEnabled(getMyApplication().accessibilityEnabled());
- if(accessibilityModePreference != null) {
- accessibilityModePreference.setSummary(getString(R.string.accessibility_mode_descr) + " [" + settings.ACCESSIBILITY_MODE.get().toHumanString(getMyApplication()) + "]");
- }
- if(directionStylePreference != null) {
- directionStylePreference.setSummary(getString(R.string.settings_direction_style_descr) + " [" + settings.DIRECTION_STYLE.get().toHumanString(getMyApplication()) + "]");
- }
- if(autoannouncePeriodPreference != null) {
- autoannouncePeriodPreference.setSummary(getString(R.string.access_autoannounce_period_descr) + " [" + autoannouncePeriodPreference.getEntry() + "]");
- }
- }
-
-}
diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
index bad1f3998e..21ed74a437 100644
--- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
+++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
@@ -81,8 +81,10 @@ import net.osmand.plus.routing.VoiceRouter;
import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.plus.settings.backend.OsmAndAppCustomization;
import net.osmand.plus.settings.backend.OsmandSettings;
-import net.osmand.plus.settings.backend.SettingsHelper;
+import net.osmand.plus.settings.backend.backup.ProfileSettingsItem;
+import net.osmand.plus.settings.backend.backup.SettingsHelper;
import net.osmand.plus.settings.backend.ExportSettingsType;
+import net.osmand.plus.settings.backend.backup.SettingsItem;
import net.osmand.plus.views.OsmandMapLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.layers.AidlMapLayer;
@@ -138,7 +140,7 @@ import static net.osmand.plus.helpers.ExternalApiHelper.PARAM_NT_DIRECTION_NAME;
import static net.osmand.plus.helpers.ExternalApiHelper.PARAM_NT_DIRECTION_TURN;
import static net.osmand.plus.helpers.ExternalApiHelper.PARAM_NT_DISTANCE;
import static net.osmand.plus.helpers.ExternalApiHelper.PARAM_NT_IMMINENT;
-import static net.osmand.plus.settings.backend.SettingsHelper.REPLACE_KEY;
+import static net.osmand.plus.settings.backend.backup.SettingsHelper.REPLACE_KEY;
public class OsmandAidlApi {
@@ -2305,8 +2307,8 @@ public class OsmandAidlApi {
for (String key : settingsTypesKeys) {
settingsTypes.add(ExportSettingsType.valueOf(key));
}
- List settingsItems = new ArrayList<>();
- settingsItems.add(new SettingsHelper.ProfileSettingsItem(app, appMode));
+ List settingsItems = new ArrayList<>();
+ settingsItems.add(new ProfileSettingsItem(app, appMode));
File exportDir = app.getSettings().getExternalStorageDirectory();
String fileName = appMode.toHumanString();
SettingsHelper settingsHelper = app.getSettingsHelper();
diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java
index 78364460a7..58690a9a3b 100644
--- a/OsmAnd/src/net/osmand/plus/AppInitializer.java
+++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java
@@ -55,7 +55,7 @@ import net.osmand.plus.routing.TransportRoutingHelper;
import net.osmand.plus.search.QuickSearchHelper;
import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.plus.settings.backend.OsmandSettings;
-import net.osmand.plus.settings.backend.SettingsHelper;
+import net.osmand.plus.settings.backend.backup.SettingsHelper;
import net.osmand.plus.views.corenative.NativeCoreContext;
import net.osmand.plus.voice.CommandPlayer;
import net.osmand.plus.voice.CommandPlayerException;
diff --git a/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java b/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java
index e0cb743a64..9127fa0aef 100644
--- a/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java
@@ -18,15 +18,15 @@ import net.osmand.data.LatLon;
import net.osmand.map.ITileSource;
import net.osmand.map.WorldRegion;
import net.osmand.plus.settings.backend.ApplicationMode;
-import net.osmand.plus.settings.backend.SettingsHelper;
-import net.osmand.plus.settings.backend.SettingsHelper.AvoidRoadsSettingsItem;
-import net.osmand.plus.settings.backend.SettingsHelper.MapSourcesSettingsItem;
-import net.osmand.plus.settings.backend.SettingsHelper.PluginSettingsItem;
-import net.osmand.plus.settings.backend.SettingsHelper.PoiUiFiltersSettingsItem;
-import net.osmand.plus.settings.backend.SettingsHelper.ProfileSettingsItem;
-import net.osmand.plus.settings.backend.SettingsHelper.QuickActionsSettingsItem;
-import net.osmand.plus.settings.backend.SettingsHelper.SettingsCollectListener;
-import net.osmand.plus.settings.backend.SettingsHelper.SettingsItem;
+import net.osmand.plus.settings.backend.backup.SettingsHelper;
+import net.osmand.plus.settings.backend.backup.AvoidRoadsSettingsItem;
+import net.osmand.plus.settings.backend.backup.MapSourcesSettingsItem;
+import net.osmand.plus.settings.backend.backup.PluginSettingsItem;
+import net.osmand.plus.settings.backend.backup.PoiUiFiltersSettingsItem;
+import net.osmand.plus.settings.backend.backup.ProfileSettingsItem;
+import net.osmand.plus.settings.backend.backup.QuickActionsSettingsItem;
+import net.osmand.plus.settings.backend.backup.SettingsHelper.SettingsCollectListener;
+import net.osmand.plus.settings.backend.backup.SettingsItem;
import net.osmand.plus.download.DownloadActivityType;
import net.osmand.plus.download.DownloadIndexesThread;
import net.osmand.plus.download.DownloadResources;
diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
index 1a48650a4d..b57d94dc3a 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
@@ -75,7 +75,7 @@ import net.osmand.plus.search.QuickSearchHelper;
import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.plus.settings.backend.OsmAndAppCustomization;
import net.osmand.plus.settings.backend.OsmandSettings;
-import net.osmand.plus.settings.backend.SettingsHelper;
+import net.osmand.plus.settings.backend.backup.SettingsHelper;
import net.osmand.plus.voice.CommandPlayer;
import net.osmand.plus.wikivoyage.data.TravelDbHelper;
import net.osmand.router.GeneralRouter;
diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
index e86b64df43..6d353713a0 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
@@ -48,7 +48,7 @@ import net.osmand.plus.search.QuickSearchDialogFragment;
import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.plus.settings.backend.CommonPreference;
import net.osmand.plus.settings.backend.OsmandPreference;
-import net.osmand.plus.settings.fragments.BaseSettingsFragment;
+import net.osmand.plus.settings.fragments.BaseSettingsFragment.SettingsScreenType;
import net.osmand.plus.skimapsplugin.SkiMapsPlugin;
import net.osmand.plus.srtmplugin.SRTMPlugin;
import net.osmand.plus.views.OsmandMapTileView;
@@ -111,11 +111,7 @@ public abstract class OsmandPlugin {
return app.getUIUtilities().getIcon(getLogoResourceId());
}
- public Class extends Activity> getSettingsActivity() {
- return null;
- }
-
- public Class extends BaseSettingsFragment> getSettingsFragment() {
+ public SettingsScreenType getSettingsScreenType() {
return null;
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index 53d3fcf473..8cb6e832c5 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -118,6 +118,7 @@ import net.osmand.plus.measurementtool.GpxData;
import net.osmand.plus.measurementtool.MeasurementEditingContext;
import net.osmand.plus.measurementtool.MeasurementToolFragment;
import net.osmand.plus.measurementtool.SnapTrackWarningFragment;
+import net.osmand.plus.osmedit.OsmEditingFragment;
import net.osmand.plus.render.RendererRegistry;
import net.osmand.plus.resources.ResourceManager;
import net.osmand.plus.routepreparationmenu.ChooseRouteFragment;
@@ -2216,6 +2217,10 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
return getFragment(GpxApproximationFragment.TAG);
}
+ public OsmEditingFragment getOsmEditingFragment() {
+ return getFragment(SettingsScreenType.OPEN_STREET_MAP_EDITING.fragmentName);
+ }
+
public SnapTrackWarningFragment getSnapTrackWarningBottomSheet() {
return getFragment(SnapTrackWarningFragment.TAG);
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index d9137ee2d6..294b382ca4 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -974,10 +974,7 @@ public class MapActivityActions implements DialogProvider {
@Override
public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
app.logEvent("drawer_plugins_open");
- Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
- .getPluginsActivity());
- newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
- mapActivity.startActivity(newIntent);
+ PluginsFragment.showInstance(mapActivity.getSupportFragmentManager());
return true;
}
}).createItem());
diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java b/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
deleted file mode 100644
index e367f3cd8e..0000000000
--- a/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
+++ /dev/null
@@ -1,241 +0,0 @@
-package net.osmand.plus.activities;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.content.Intent;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.text.method.LinkMovementMethod;
-import android.util.Log;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.Button;
-import android.widget.CompoundButton;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.appcompat.content.res.AppCompatResources;
-import androidx.core.content.ContextCompat;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
-
-import net.osmand.AndroidUtils;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.OsmandPlugin;
-import net.osmand.plus.R;
-import net.osmand.plus.chooseplan.ChoosePlanDialogFragment;
-import net.osmand.plus.dialogs.PluginInstalledBottomSheetDialog;
-import net.osmand.plus.download.DownloadIndexesThread;
-import net.osmand.plus.srtmplugin.SRTMPlugin;
-
-public class PluginActivity extends OsmandActionBarActivity implements DownloadIndexesThread.DownloadEvents, PluginInstalledBottomSheetDialog.PluginStateListener {
- private static final String TAG = "PluginActivity";
- public static final String EXTRA_PLUGIN_ID = "plugin_id";
-
- private OsmandPlugin plugin;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- ((OsmandApplication) getApplication()).applyTheme(this);
- super.onCreate(savedInstanceState);
-
- Intent intent = getIntent();
- if (intent == null || !intent.hasExtra(EXTRA_PLUGIN_ID)) {
- Log.e(TAG, "Required extra '" + EXTRA_PLUGIN_ID + "' is missing");
- finish();
- return;
- }
- String pluginId = intent.getStringExtra(EXTRA_PLUGIN_ID);
- if (pluginId == null) {
- Log.e(TAG, "Extra '" + EXTRA_PLUGIN_ID + "' is null");
- finish();
- return;
- }
- for (OsmandPlugin plugin : OsmandPlugin.getAvailablePlugins()) {
- if (!plugin.getId().equals(pluginId))
- continue;
-
- this.plugin = plugin;
- break;
- }
- if (plugin == null) {
- Log.e(TAG, "Plugin '" + EXTRA_PLUGIN_ID + "' not found");
- finish();
- return;
- }
-
- setContentView(R.layout.plugin);
- //noinspection ConstantConditions
- getSupportActionBar().setTitle(plugin.getName());
- Drawable pluginImage = plugin.getAssetResourceImage();
- if (pluginImage != null) {
- ImageView img = (ImageView) findViewById(R.id.plugin_image);
- img.setImageDrawable(pluginImage);
- } else {
- findViewById(R.id.plugin_image_placeholder).setVisibility(View.VISIBLE);
- }
-
- TextView descriptionView = (TextView) findViewById(R.id.plugin_description);
- descriptionView.setText(plugin.getDescription());
-
- boolean light = getMyApplication().getSettings().isLightContent();
- int linkTextColor = ContextCompat.getColor(this,
- light ? R.color.ctx_menu_bottom_view_url_color_light : R.color.ctx_menu_bottom_view_url_color_dark);
-
- descriptionView.setLinkTextColor(linkTextColor);
- descriptionView.setMovementMethod(LinkMovementMethod.getInstance());
- AndroidUtils.removeLinkUnderline(descriptionView);
-
- Button settingsButton = (Button) findViewById(R.id.plugin_settings);
- settingsButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- startActivity(new Intent(PluginActivity.this, plugin.getSettingsActivity()));
- }
- });
-
- CompoundButton enableDisableButton = (CompoundButton)findViewById(
- R.id.plugin_enable_disable);
- enableDisableButton.setOnCheckedChangeListener(
- new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- if (plugin.isActive() == isChecked) {
- return;
- }
-
- boolean ok = OsmandPlugin.enablePlugin(PluginActivity.this, (OsmandApplication)getApplication(),
- plugin, isChecked);
- if (!ok) {
- return;
- }
- updateState();
- }
- });
- Button getButton = (Button)findViewById(R.id.plugin_get);
- getButton.setText(plugin.isPaid() ? R.string.get_plugin : R.string.shared_string_install);
- getButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- try {
- if (plugin instanceof SRTMPlugin) {
- FragmentManager fragmentManager = getSupportFragmentManager();
- if (fragmentManager != null) {
- ChoosePlanDialogFragment.showHillshadeSrtmPluginInstance(fragmentManager);
- }
- } else {
- startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(plugin.getInstallURL())));
- }
- } catch (Exception e) {
- //ignored
- }
- }
- });
-
- updateState();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- OsmandApplication app = getMyApplication();
- OsmandPlugin.checkInstalledMarketPlugins(app, this);
- app.getDownloadThread().setUiActivity(this);
- updateState();
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- getMyApplication().getDownloadThread().resetUiActivity(this);
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- int itemId = item.getItemId();
- switch (itemId) {
- case android.R.id.home:
- finish();
- return true;
-
- }
- return false;
- }
-
- @SuppressLint("NewApi")
- private void updateState() {
- CompoundButton enableDisableButton = (CompoundButton)findViewById(
- R.id.plugin_enable_disable);
- Button getButton = (Button)findViewById(R.id.plugin_get);
- Button settingsButton = (Button)findViewById(R.id.plugin_settings);
- settingsButton.setCompoundDrawablesWithIntrinsicBounds(
- getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_settings),
- null, null, null);
- View installHeader = findViewById(R.id.plugin_install_header);
-
- if (plugin.needsInstallation()) {
- getButton.setVisibility(View.VISIBLE);
- enableDisableButton.setVisibility(View.GONE);
- settingsButton.setVisibility(View.GONE);
- installHeader.setVisibility(View.VISIBLE);
- View worldGlobeIcon = installHeader.findViewById(R.id.ic_world_globe);
- Drawable worldGlobeDrawable = getMyApplication().getUIUtilities().getThemedIcon(
- R.drawable.ic_world_globe_dark);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- worldGlobeIcon.setBackground(worldGlobeDrawable);
- } else {
- //noinspection deprecation
- worldGlobeIcon.setBackgroundDrawable(worldGlobeDrawable);
- }
- } else {
- getButton.setVisibility(View.GONE);
- enableDisableButton.setVisibility(View.VISIBLE);
- enableDisableButton.setChecked(plugin.isActive());
-
- final Class extends Activity> settingsActivity = plugin.getSettingsActivity();
- if (settingsActivity == null || !plugin.isActive()) {
- settingsButton.setVisibility(View.GONE);
- } else {
- settingsButton.setVisibility(View.VISIBLE);
- }
-
- installHeader.setVisibility(View.GONE);
- }
- }
-
- // DownloadEvents
- @Override
- public void newDownloadIndexes() {
- for (Fragment fragment : getSupportFragmentManager().getFragments()) {
- if (fragment instanceof DownloadIndexesThread.DownloadEvents && fragment.isAdded()) {
- ((DownloadIndexesThread.DownloadEvents) fragment).newDownloadIndexes();
- }
- }
- }
-
- @Override
- public void downloadInProgress() {
- for (Fragment fragment : getSupportFragmentManager().getFragments()) {
- if (fragment instanceof DownloadIndexesThread.DownloadEvents && fragment.isAdded()) {
- ((DownloadIndexesThread.DownloadEvents) fragment).downloadInProgress();
- }
- }
- }
-
- @Override
- public void downloadHasFinished() {
- for (Fragment fragment : getSupportFragmentManager().getFragments()) {
- if (fragment instanceof DownloadIndexesThread.DownloadEvents && fragment.isAdded()) {
- ((DownloadIndexesThread.DownloadEvents) fragment).downloadHasFinished();
- }
- }
- }
-
- @Override
- public void onPluginStateChanged(OsmandPlugin plugin) {
- updateState();
- }
-}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginInfoFragment.java b/OsmAnd/src/net/osmand/plus/activities/PluginInfoFragment.java
new file mode 100644
index 0000000000..7deb85768c
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/activities/PluginInfoFragment.java
@@ -0,0 +1,258 @@
+package net.osmand.plus.activities;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.text.method.LinkMovementMethod;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.activity.OnBackPressedCallback;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.content.ContextCompat;
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.FragmentManager;
+
+import net.osmand.AndroidUtils;
+import net.osmand.PlatformUtil;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.OsmandPlugin;
+import net.osmand.plus.R;
+import net.osmand.plus.UiUtilities;
+import net.osmand.plus.base.BaseOsmAndFragment;
+import net.osmand.plus.chooseplan.ChoosePlanDialogFragment;
+import net.osmand.plus.dialogs.PluginInstalledBottomSheetDialog.PluginStateListener;
+import net.osmand.plus.settings.fragments.BaseSettingsFragment;
+import net.osmand.plus.settings.fragments.BaseSettingsFragment.SettingsScreenType;
+import net.osmand.plus.srtmplugin.SRTMPlugin;
+
+import org.apache.commons.logging.Log;
+
+public class PluginInfoFragment extends BaseOsmAndFragment implements PluginStateListener {
+
+ private static final Log log = PlatformUtil.getLog(PluginInfoFragment.class);
+
+ private static final String TAG = PluginInfoFragment.class.getName();
+
+ public static final String EXTRA_PLUGIN_ID = "plugin_id";
+ public static final String PLUGIN_INFO = "plugin_info";
+
+ private OsmandPlugin plugin;
+ private OsmandApplication app;
+
+ private View mainView;
+ private boolean nightMode;
+
+ @Override
+ public int getStatusBarColorId() {
+ return nightMode ? R.color.status_bar_color_dark : R.color.status_bar_color_light;
+ }
+
+ @Override
+ public void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ FragmentActivity activity = requireMyActivity();
+ activity.getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
+ public void handleOnBackPressed() {
+ dismiss();
+ }
+ });
+ }
+
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ app = requireMyApplication();
+
+ Bundle args = getArguments();
+ if (args == null || !args.containsKey(EXTRA_PLUGIN_ID)) {
+ log.error("Required extra '" + EXTRA_PLUGIN_ID + "' is missing");
+ return null;
+ }
+ String pluginId = args.getString(EXTRA_PLUGIN_ID);
+ if (pluginId == null) {
+ log.error("Extra '" + EXTRA_PLUGIN_ID + "' is null");
+ return null;
+ }
+ plugin = OsmandPlugin.getPlugin(pluginId);
+ if (plugin == null) {
+ log.error("Plugin '" + EXTRA_PLUGIN_ID + "' not found");
+ return null;
+ }
+
+ Context context = requireContext();
+ nightMode = !app.getSettings().isLightContent();
+ LayoutInflater themedInflater = UiUtilities.getInflater(context, nightMode);
+ mainView = themedInflater.inflate(R.layout.plugin, container, false);
+ AndroidUtils.addStatusBarPadding21v(context, mainView);
+
+ TextView toolbarTitle = mainView.findViewById(R.id.toolbar_title);
+ toolbarTitle.setText(plugin.getName());
+
+ ImageView closeButton = mainView.findViewById(R.id.close_button);
+ closeButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Activity activity = getMyActivity();
+ if (activity != null) {
+ activity.onBackPressed();
+ }
+ }
+ });
+ UiUtilities.rotateImageByLayoutDirection(closeButton, AndroidUtils.getLayoutDirection(app));
+
+ Drawable pluginImage = plugin.getAssetResourceImage();
+ if (pluginImage != null) {
+ ImageView img = mainView.findViewById(R.id.plugin_image);
+ img.setImageDrawable(pluginImage);
+ } else {
+ mainView.findViewById(R.id.plugin_image_placeholder).setVisibility(View.VISIBLE);
+ }
+
+ TextView descriptionView = mainView.findViewById(R.id.plugin_description);
+ descriptionView.setText(plugin.getDescription());
+
+ int linkTextColorId = nightMode ? R.color.ctx_menu_bottom_view_url_color_dark : R.color.ctx_menu_bottom_view_url_color_light;
+ int linkTextColor = ContextCompat.getColor(context, linkTextColorId);
+
+ descriptionView.setLinkTextColor(linkTextColor);
+ descriptionView.setMovementMethod(LinkMovementMethod.getInstance());
+ AndroidUtils.removeLinkUnderline(descriptionView);
+
+ Button settingsButton = mainView.findViewById(R.id.plugin_settings);
+ settingsButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ FragmentActivity activity = getActivity();
+ if (activity != null) {
+ SettingsScreenType settingsScreenType = plugin.getSettingsScreenType();
+ if (settingsScreenType != null) {
+ Bundle args = new Bundle();
+ args.putBoolean(PLUGIN_INFO, true);
+ BaseSettingsFragment.showInstance(activity, settingsScreenType, null, args);
+ }
+ }
+ }
+ });
+
+ CompoundButton enableDisableButton = mainView.findViewById(R.id.plugin_enable_disable);
+ enableDisableButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ if (plugin.isActive() == isChecked) {
+ return;
+ }
+
+ boolean ok = OsmandPlugin.enablePlugin(getActivity(), app, plugin, isChecked);
+ if (!ok) {
+ return;
+ }
+ updateState();
+ }
+ });
+ Button getButton = mainView.findViewById(R.id.plugin_get);
+ getButton.setText(plugin.isPaid() ? R.string.get_plugin : R.string.shared_string_install);
+ getButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ try {
+ if (plugin instanceof SRTMPlugin) {
+ FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
+ if (fragmentManager != null) {
+ ChoosePlanDialogFragment.showHillshadeSrtmPluginInstance(fragmentManager);
+ }
+ } else {
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(plugin.getInstallURL())));
+ }
+ } catch (Exception e) {
+ //ignored
+ }
+ }
+ });
+
+ updateState();
+ return mainView;
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ OsmandPlugin.checkInstalledMarketPlugins(app, getActivity());
+ updateState();
+ }
+
+ private void updateState() {
+ CompoundButton enableDisableButton = mainView.findViewById(R.id.plugin_enable_disable);
+ Button getButton = mainView.findViewById(R.id.plugin_get);
+ Button settingsButton = mainView.findViewById(R.id.plugin_settings);
+ settingsButton.setCompoundDrawablesWithIntrinsicBounds(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_settings), null, null, null);
+ View installHeader = mainView.findViewById(R.id.plugin_install_header);
+
+ if (plugin.needsInstallation()) {
+ getButton.setVisibility(View.VISIBLE);
+ enableDisableButton.setVisibility(View.GONE);
+ settingsButton.setVisibility(View.GONE);
+ installHeader.setVisibility(View.VISIBLE);
+ View worldGlobeIcon = installHeader.findViewById(R.id.ic_world_globe);
+ Drawable worldGlobeDrawable = app.getUIUtilities().getThemedIcon(R.drawable.ic_world_globe_dark);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+ worldGlobeIcon.setBackground(worldGlobeDrawable);
+ } else {
+ worldGlobeIcon.setBackgroundDrawable(worldGlobeDrawable);
+ }
+ } else {
+ getButton.setVisibility(View.GONE);
+ enableDisableButton.setVisibility(View.VISIBLE);
+ enableDisableButton.setChecked(plugin.isActive());
+
+ if (plugin.getSettingsScreenType() == null || !plugin.isActive()) {
+ settingsButton.setVisibility(View.GONE);
+ } else {
+ settingsButton.setVisibility(View.VISIBLE);
+ }
+ installHeader.setVisibility(View.GONE);
+ }
+ }
+
+ @Override
+ public void onPluginStateChanged(OsmandPlugin plugin) {
+ updateState();
+ }
+
+ public void dismiss() {
+ FragmentActivity activity = getActivity();
+ if (activity != null) {
+ try {
+ activity.getSupportFragmentManager().popBackStack(TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
+ } catch (Exception e) {
+ log.error(e);
+ }
+ }
+ }
+
+ public static boolean showInstance(FragmentManager fragmentManager, OsmandPlugin plugin) {
+ try {
+ Bundle args = new Bundle();
+ args.putString(EXTRA_PLUGIN_ID, plugin.getId());
+
+ PluginInfoFragment fragment = new PluginInfoFragment();
+ fragment.setArguments(args);
+ fragmentManager.beginTransaction()
+ .add(R.id.fragmentContainer, fragment, TAG)
+ .addToBackStack(TAG)
+ .commitAllowingStateLoss();
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java b/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java
deleted file mode 100644
index a0e731c7bc..0000000000
--- a/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java
+++ /dev/null
@@ -1,296 +0,0 @@
-package net.osmand.plus.activities;
-
-import android.app.Activity;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.res.TypedArray;
-import android.os.Bundle;
-import android.text.method.LinkMovementMethod;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.annotation.NonNull;
-import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.widget.PopupMenu;
-import androidx.core.content.ContextCompat;
-import androidx.fragment.app.Fragment;
-
-import net.osmand.AndroidUtils;
-import net.osmand.aidl.ConnectedApp;
-import net.osmand.plus.CustomOsmandPlugin;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.OsmandPlugin;
-import net.osmand.plus.R;
-import net.osmand.plus.UiUtilities;
-import net.osmand.plus.dialogs.PluginInstalledBottomSheetDialog;
-import net.osmand.plus.download.DownloadIndexesThread;
-
-import java.util.ArrayList;
-
-public class PluginsActivity extends OsmandListActivity implements DownloadIndexesThread.DownloadEvents, PluginInstalledBottomSheetDialog.PluginStateListener {
-
- public static final int ACTIVE_PLUGINS_LIST_MODIFIED = 1;
-
- private boolean listModified = false;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- getMyApplication().applyTheme(this);
- super.onCreate(savedInstanceState);
- setContentView(R.layout.plugins);
- getSupportActionBar().setTitle(R.string.plugins_screen);
- setListAdapter(new PluginsListAdapter());
- }
-
- @Override
- public PluginsListAdapter getListAdapter() {
- return (PluginsListAdapter) super.getListAdapter();
- }
-
- @Override
- public void onItemClick(AdapterView> parent, View view, int position, long id) {
- Object tag = view.getTag();
- if (tag instanceof OsmandPlugin) {
- Intent intent = new Intent(this, PluginActivity.class);
- intent.putExtra(PluginActivity.EXTRA_PLUGIN_ID, ((OsmandPlugin) tag).getId());
- startActivity(intent);
- } else if (tag instanceof ConnectedApp) {
- switchEnabled((ConnectedApp) tag);
- }
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- OsmandApplication app = getMyApplication();
- OsmandPlugin.checkInstalledMarketPlugins(app, this);
- app.getDownloadThread().setUiActivity(this);
- getListAdapter().notifyDataSetChanged();
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- getMyApplication().getDownloadThread().resetUiActivity(this);
- }
-
- private void enableDisablePlugin(OsmandPlugin plugin, boolean enable) {
- OsmandApplication app = getMyApplication();
- if (OsmandPlugin.enablePlugin(this, app, plugin, enable)) {
- if (!listModified) {
- setResult(ACTIVE_PLUGINS_LIST_MODIFIED);
- listModified = true;
- }
- getListAdapter().notifyDataSetChanged();
- }
- }
-
- private void switchEnabled(@NonNull ConnectedApp app) {
- getMyApplication().getAidlApi().switchEnabled(app);
- getListAdapter().notifyDataSetChanged();
- }
-
- // DownloadEvents
- @Override
- public void newDownloadIndexes() {
- for (Fragment fragment : getSupportFragmentManager().getFragments()) {
- if (fragment instanceof DownloadIndexesThread.DownloadEvents && fragment.isAdded()) {
- ((DownloadIndexesThread.DownloadEvents) fragment).newDownloadIndexes();
- }
- }
- }
-
- @Override
- public void downloadInProgress() {
- for (Fragment fragment : getSupportFragmentManager().getFragments()) {
- if (fragment instanceof DownloadIndexesThread.DownloadEvents && fragment.isAdded()) {
- ((DownloadIndexesThread.DownloadEvents) fragment).downloadInProgress();
- }
- }
- }
-
- @Override
- public void downloadHasFinished() {
- for (Fragment fragment : getSupportFragmentManager().getFragments()) {
- if (fragment instanceof DownloadIndexesThread.DownloadEvents && fragment.isAdded()) {
- ((DownloadIndexesThread.DownloadEvents) fragment).downloadHasFinished();
- }
- }
- }
-
- @Override
- public void onPluginStateChanged(OsmandPlugin plugin) {
- getListAdapter().notifyDataSetChanged();
- }
-
- protected class PluginsListAdapter extends ArrayAdapter