Support plugin icon
This commit is contained in:
parent
7b439dd639
commit
4502d56394
3 changed files with 10 additions and 8 deletions
|
@ -354,9 +354,10 @@ public class CustomOsmandPlugin extends OsmandPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public int getLogoResourceId() {
|
public Drawable getLogoResource() {
|
||||||
return super.getLogoResourceId();
|
return icon != null ? icon : super.getLogoResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -91,16 +91,16 @@ public abstract class OsmandPlugin {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public Drawable getLogoResource() {
|
|
||||||
return app.getUIUtilities().getIcon(getLogoResourceId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
public int getLogoResourceId() {
|
public int getLogoResourceId() {
|
||||||
return R.drawable.ic_extension_dark;
|
return R.drawable.ic_extension_dark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public Drawable getLogoResource() {
|
||||||
|
return app.getUIUtilities().getIcon(getLogoResourceId());
|
||||||
|
}
|
||||||
|
|
||||||
public Class<? extends Activity> getSettingsActivity() {
|
public Class<? extends Activity> getSettingsActivity() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import net.osmand.aidl.ConnectedApp;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandPlugin;
|
import net.osmand.plus.OsmandPlugin;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.UiUtilities;
|
||||||
import net.osmand.plus.dialogs.PluginInstalledBottomSheetDialog;
|
import net.osmand.plus.dialogs.PluginInstalledBottomSheetDialog;
|
||||||
import net.osmand.plus.download.DownloadIndexesThread;
|
import net.osmand.plus.download.DownloadIndexesThread;
|
||||||
|
|
||||||
|
@ -180,7 +181,7 @@ public class PluginsActivity extends OsmandListActivity implements DownloadIndex
|
||||||
|
|
||||||
OsmandApplication app = getMyApplication();
|
OsmandApplication app = getMyApplication();
|
||||||
int color = AndroidUtils.getColorFromAttr(app, R.attr.list_background_color);
|
int color = AndroidUtils.getColorFromAttr(app, R.attr.list_background_color);
|
||||||
pluginLogo.setImageDrawable(app.getUIUtilities().getPaintedIcon(plugin.getLogoResourceId(), color));
|
pluginLogo.setImageDrawable(UiUtilities.tintDrawable(plugin.getLogoResource(), color));
|
||||||
pluginLogo.setOnClickListener(new View.OnClickListener() {
|
pluginLogo.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
Loading…
Reference in a new issue