diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/IconsCache.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/IconsCache.java index e3e381bce7..f627008a3e 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/IconsCache.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/IconsCache.java @@ -101,7 +101,7 @@ public class IconsCache { long hash = ((long)resId << 31L) + clrId; Drawable d = osmandDrawable.get(hash); if (d == null) { - d = OAResources.getDrawable(resId); + d = OsmandResources.getDrawable(resId); if (d != null) { d = DrawableCompat.wrap(d); d.mutate(); @@ -118,7 +118,7 @@ public class IconsCache { long hash = ((long)resId << 31L) + color; Drawable d = osmandDrawable.get(hash); if(d == null) { - d = OAResources.getDrawable(resId); + d = OsmandResources.getDrawable(resId); if (d != null) { d = DrawableCompat.wrap(d); d.mutate(); @@ -130,7 +130,7 @@ public class IconsCache { } public Drawable getPaintedIcon(String osmandId, @ColorInt int color){ - int id = OAResources.getDrawableId(osmandId); + int id = OsmandResources.getDrawableId(osmandId); if (id != 0) { return getPaintedOsmandDrawable(id, color); } @@ -142,7 +142,7 @@ public class IconsCache { } public Drawable getIcon(String osmandId, @ColorRes int colorId) { - int id = OAResources.getDrawableId(osmandId); + int id = OsmandResources.getDrawableId(osmandId); if (id != 0) { return getOsmandDrawable(id, colorId); } @@ -150,8 +150,8 @@ public class IconsCache { } public Drawable getIcon(String osmandBackgroundId, String osmandId, @ColorRes int colorId) { - int backgroundId = OAResources.getDrawableId(osmandBackgroundId); - int id = OAResources.getDrawableId(osmandId); + int backgroundId = OsmandResources.getDrawableId(osmandBackgroundId); + int id = OsmandResources.getDrawableId(osmandId); if (backgroundId != 0 && id != 0) { Drawable b = getOsmandDrawable(backgroundId, 0); Drawable f = getOsmandDrawable(id, colorId); @@ -164,7 +164,7 @@ public class IconsCache { } public Drawable getThemedIcon(String osmandId) { - int id = OAResources.getDrawableId(osmandId); + int id = OsmandResources.getDrawableId(osmandId); if (id != 0) { return getOsmandDrawable(id, R.color.icon_color); } @@ -172,7 +172,7 @@ public class IconsCache { } public Drawable getIcon(String osmandId) { - int id = OAResources.getDrawableId(osmandId); + int id = OsmandResources.getDrawableId(osmandId); if (id != 0) { return getOsmandDrawable(id, 0); } @@ -180,7 +180,7 @@ public class IconsCache { } public Drawable getIcon(String osmandId, boolean light) { - int id = OAResources.getDrawableId(osmandId); + int id = OsmandResources.getDrawableId(osmandId); if (id != 0) { return getOsmandDrawable(id, light ? R.color.icon_color : 0); } diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOAAppDialog.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOsmandAppDialog.java similarity index 92% rename from OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOAAppDialog.java rename to OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOsmandAppDialog.java index 54479aa47c..973430e012 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOAAppDialog.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOsmandAppDialog.java @@ -13,8 +13,8 @@ import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatDialogFragment; import android.view.View; -public class InstallOAAppDialog extends AppCompatDialogFragment { - private static final String TAG = "InstallOAAppDialog"; +public class InstallOsmandAppDialog extends AppCompatDialogFragment { + private static final String TAG = "InstallOsmandAppDialog"; private static final String OSMAND_PLUS_PACKAGE_NAME = "net.osmand.plus"; private static final String OSMAND_PACKAGE_NAME = "net.osmand"; private static boolean wasChecked = false; @@ -69,7 +69,7 @@ public class InstallOAAppDialog extends AppCompatDialogFragment { wasChecked = true; if (!SampleUtils.isPackageInstalled(OSMAND_PACKAGE_NAME, ctx) && !SampleUtils.isPackageInstalled(OSMAND_PLUS_PACKAGE_NAME, ctx)) { - new InstallOAAppDialog().show(manager, TAG); + new InstallOsmandAppDialog().show(manager, TAG); return true; } else { return false; diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/MainActivity.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/MainActivity.java index 5b37161d94..a095be8602 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/MainActivity.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/MainActivity.java @@ -224,7 +224,7 @@ public class MainActivity extends AppCompatActivity { app.getIconsCache().setDisplayDensityFactor(displayDensityFactor); - if (!InstallOAAppDialog.showIfNeeded(getSupportFragmentManager(), this) + if (!InstallOsmandAppDialog.showIfNeeded(getSupportFragmentManager(), this) && externalStoragePermissionGranted) { checkMapsInstalled(); } diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/OAResources.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/OsmandResources.java similarity index 96% rename from OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/OAResources.java rename to OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/OsmandResources.java index 992c1d5ac6..f9882a6291 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/OAResources.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/OsmandResources.java @@ -5,7 +5,7 @@ import android.content.pm.PackageManager; import android.content.res.Resources; import android.graphics.drawable.Drawable; -public class OAResources { +public class OsmandResources { private static Resources osmandResources; private static String packageName; @@ -34,7 +34,7 @@ public class OAResources { } } if (osmandResources != null) { - OAResources.packageName = packageName; + OsmandResources.packageName = packageName; } } diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleApplication.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleApplication.java index 6676434745..4f09174dda 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleApplication.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleApplication.java @@ -55,7 +55,7 @@ public class SampleApplication extends Application { @Override public void onCreate() { super.onCreate(); - OAResources.init(this); + OsmandResources.init(this); locationProvider = new SampleLocationProvider(this); searchUICore = new QuickSearchHelper(this); uiHandler = new Handler(); @@ -206,10 +206,10 @@ public class SampleApplication extends Application { } public String getString(String osmandId) { - return OAResources.getString(osmandId); + return OsmandResources.getString(osmandId); } public String getString(String osmandId, Object... formatArgs) { - return OAResources.getString(osmandId, formatArgs); + return OsmandResources.getString(osmandId, formatArgs); } } \ No newline at end of file diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandImageButton.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandImageButton.java index ebb986334e..5968094928 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandImageButton.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandImageButton.java @@ -6,7 +6,7 @@ import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.ImageButton; -import net.osmand.core.samples.android.sample1.OAResources; +import net.osmand.core.samples.android.sample1.OsmandResources; import net.osmand.core.samples.android.sample1.R; @@ -54,6 +54,6 @@ public class OsmandImageButton extends ImageButton { } String osmandSrc = resolvedAttributes.getString(R.styleable.OsmandImageButton_osmandSrc); - target.setImageDrawable(OAResources.getDrawable(osmandSrc)); + target.setImageDrawable(OsmandResources.getDrawable(osmandSrc)); } } diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandImageView.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandImageView.java index 532299dca4..15f7a0942b 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandImageView.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandImageView.java @@ -6,7 +6,7 @@ import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.ImageView; -import net.osmand.core.samples.android.sample1.OAResources; +import net.osmand.core.samples.android.sample1.OsmandResources; import net.osmand.core.samples.android.sample1.R; public class OsmandImageView extends ImageView { @@ -52,6 +52,6 @@ public class OsmandImageView extends ImageView { } String osmandSrc = resolvedAttributes.getString(R.styleable.OsmandImageButton_osmandSrc); - target.setImageDrawable(OAResources.getDrawable(osmandSrc)); + target.setImageDrawable(OsmandResources.getDrawable(osmandSrc)); } } diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandTextView.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandTextView.java index 7c69728179..7ea4009397 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandTextView.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/customcontrols/OsmandTextView.java @@ -6,7 +6,7 @@ import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.TextView; -import net.osmand.core.samples.android.sample1.OAResources; +import net.osmand.core.samples.android.sample1.OsmandResources; import net.osmand.core.samples.android.sample1.R; public class OsmandTextView extends TextView { @@ -52,6 +52,6 @@ public class OsmandTextView extends TextView { } String osmandText = resolvedAttributes.getString(R.styleable.OsmandTextView_osmandText); - target.setText(OAResources.getString(osmandText)); + target.setText(OsmandResources.getString(osmandText)); } } diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchListItem.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchListItem.java index b9c02a5f16..1298e4d908 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchListItem.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchListItem.java @@ -3,7 +3,7 @@ package net.osmand.core.samples.android.sample1.search; import android.graphics.drawable.Drawable; import net.osmand.binary.BinaryMapIndexReader; -import net.osmand.core.samples.android.sample1.OAResources; +import net.osmand.core.samples.android.sample1.OsmandResources; import net.osmand.core.samples.android.sample1.R; import net.osmand.core.samples.android.sample1.SampleApplication; import net.osmand.core.samples.android.sample1.SampleFormatter; @@ -202,11 +202,11 @@ public class QuickSearchListItem { } public static int getPoiTypeIconId(SampleApplication app, AbstractPoiType abstractPoiType) { - int res = OAResources.getDrawableId("mx_" + abstractPoiType.getIconKeyName()); + int res = OsmandResources.getDrawableId("mx_" + abstractPoiType.getIconKeyName()); if (res != 0) { return res; } else if (abstractPoiType instanceof PoiType) { - res = OAResources.getDrawableId("mx_" + ((PoiType) abstractPoiType).getOsmTag() + res = OsmandResources.getDrawableId("mx_" + ((PoiType) abstractPoiType).getOsmTag() + "_" + ((PoiType) abstractPoiType).getOsmValue()); if (res != 0) { return res; @@ -222,9 +222,9 @@ public class QuickSearchListItem { int res = 0; PoiType st = amenity.getType().getPoiTypeByKeyName(amenity.getSubType()); if (st != null) { - res = OAResources.getDrawableId("mx_" + st.getIconKeyName()); + res = OsmandResources.getDrawableId("mx_" + st.getIconKeyName()); if (res == 0) { - res = OAResources.getDrawableId("mx_" + st.getOsmTag() + "_" + st.getOsmValue()); + res = OsmandResources.getDrawableId("mx_" + st.getOsmTag() + "_" + st.getOsmValue()); } } return res; @@ -234,9 +234,9 @@ public class QuickSearchListItem { PoiType st = amenity.getType().getPoiTypeByKeyName(amenity.getSubType()); if (st != null) { String id = st.getIconKeyName(); - if (OAResources.getDrawableId("mx_" + id) == 0) { + if (OsmandResources.getDrawableId("mx_" + id) == 0) { id = st.getOsmTag() + "_" + st.getOsmValue(); - if (OAResources.getDrawableId("mx_" + id) != 0) { + if (OsmandResources.getDrawableId("mx_" + id) != 0) { return id; } } else {