Rename classes back
This commit is contained in:
parent
be864d7c4f
commit
721829d6ad
9 changed files with 31 additions and 31 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue