diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java index 36b8dee6d0..0c488b384c 100644 --- a/OsmAnd/src/net/osmand/AndroidUtils.java +++ b/OsmAnd/src/net/osmand/AndroidUtils.java @@ -425,7 +425,7 @@ public class AndroidUtils { : ctx.getResources().getColor(R.color.text_color_secondary_light)); } - public static int getTextWidth(Context ctx, float textSize, List titles) { + public static int getTextMaxWidth(float textSize, List titles) { int width = 0; for (String title : titles) { int titleWidth = getTextWidth(textSize, title); diff --git a/OsmAnd/src/net/osmand/plus/UiUtilities.java b/OsmAnd/src/net/osmand/plus/UiUtilities.java index 38c36a9fc5..588cc66c55 100644 --- a/OsmAnd/src/net/osmand/plus/UiUtilities.java +++ b/OsmAnd/src/net/osmand/plus/UiUtilities.java @@ -665,8 +665,7 @@ public class UiUtilities { for (SimplePopUpMenuItem item : items) { titles.add(String.valueOf(item.getTitle())); } - float itemWidth = - AndroidUtils.getTextWidth(themedCtx, defaultListTextSize, titles) + contentPadding; + float itemWidth = AndroidUtils.getTextMaxWidth(defaultListTextSize, titles) + contentPadding; SimplePopUpMenuItemAdapter adapter = new SimplePopUpMenuItemAdapter(themedCtx, R.layout.popup_menu_item, items); diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/VehicleParametersBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/VehicleParametersBottomSheet.java index 2e50c74ae0..d452a4c7b0 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/VehicleParametersBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/VehicleParametersBottomSheet.java @@ -9,7 +9,6 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.recyclerview.widget.RecyclerView;