Skip to content

Commit

Permalink
Merge branch 'osmandapp:master' into hardy_Afa
Browse files Browse the repository at this point in the history
  • Loading branch information
sonora authored Sep 23, 2024
2 parents b3a3a5c + 37bcf08 commit e08c878
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,10 @@ object GpxUtilities {
progress?.progress(1)
}

fun assignExtensionWriter(wptPt: WptPt, pluginsExtensions: Map<String, String>) {
fun assignExtensionWriter(wptPt: WptPt, extensions: Map<String, String>) {
val regularExtensions = HashMap<String, String>()
val gpxtpxExtensions = HashMap<String, String>()
for ((key, value) in pluginsExtensions) {
for ((key, value) in extensions) {
if (key.startsWith(GPXTPX_PREFIX)) {
gpxtpxExtensions[key] = value
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,12 @@ private void buildItem(@NonNull ViewGroup container, @NonNull String title, @Non
return true;
});
if (isUrl) {
view.setOnClickListener(v -> AndroidUtils.openUrl(app, description, nightMode));
view.setOnClickListener(v -> {
FragmentActivity activity = getActivity();
if (activity != null) {
AndroidUtils.openUrl(activity, description, nightMode);
}
});
}

container.addView(view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,19 @@ private void readButtonState(@NonNull JSONObject json) {
buttonState.setEnabled(object.getBoolean("enabled"));

String iconName = object.optString("icon");
if (Algorithms.isEmpty(iconName)) {
if (!Algorithms.isEmpty(iconName)) {
buttonState.getIconPref().set(iconName);
}
int size = object.optInt("size");
if (size > 0) {
buttonState.getSizePref().set(size);
}
int cornerRadius = object.optInt("corner_radius");
if (cornerRadius > 0) {
if (cornerRadius >= 0) {
buttonState.getCornerRadiusPref().set(cornerRadius);
}
float opacity = (float) object.optDouble("opacity");
if (opacity > 0) {
if (opacity >= 0) {
buttonState.getOpacityPref().set(opacity);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public boolean isDefaultButton() {
@Override
public ButtonAppearanceParams createAppearanceParams() {
ButtonAppearanceParams appearanceParams = super.createAppearanceParams();
if (!iconPref.isSet()) {
if (Algorithms.isEmpty(iconPref.get())) {
if (isSingleAction()) {
int iconId = getQuickActions().get(0).getIconRes(app);
if (iconId > 0) {
Expand Down

0 comments on commit e08c878

Please sign in to comment.