From 1ce5313dfd570174f023c2be3fdbd299c9d61f4d Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Tue, 30 Mar 2021 23:53:18 +0300 Subject: [PATCH] Data storage folder show second slash "/" for path goes to the second line. --- .../datastorage/DataStorageFragment.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/datastorage/DataStorageFragment.java b/OsmAnd/src/net/osmand/plus/settings/datastorage/DataStorageFragment.java index 41c58ebd7f..57da72c4cc 100644 --- a/OsmAnd/src/net/osmand/plus/settings/datastorage/DataStorageFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/datastorage/DataStorageFragment.java @@ -234,7 +234,7 @@ public class DataStorageFragment extends BaseSettingsFragment implements DataSto ivIcon.setImageDrawable(icon); if (currentKey.equals(MANUALLY_SPECIFIED)) { - tvSummary.setText(item.getDirectory()); + setFormattedPath(item, tvSummary); secondPart.setVisibility(View.GONE); tvAdditionalDescription.setVisibility(View.GONE); divider.setVisibility(View.GONE); @@ -252,15 +252,8 @@ public class DataStorageFragment extends BaseSettingsFragment implements DataSto } if (currentKey.equals(INTERNAL_STORAGE)) { tvAdditionalDescription.setText(item.getDescription()); - } else if (currentKey.equals(SHARED_STORAGE)) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { - BidiFormatter rtlFormatter = BidiFormatter.getInstance(); - tvAdditionalDescription.setText(rtlFormatter.unicodeWrap(item.getDirectory())); - } else { - tvAdditionalDescription.setText(String.format("\u200E%s", item.getDirectory())); - } } else { - tvAdditionalDescription.setText(item.getDirectory()); + setFormattedPath(item, tvAdditionalDescription); } } } @@ -310,6 +303,15 @@ public class DataStorageFragment extends BaseSettingsFragment implements DataSto } } + private void setFormattedPath(StorageItem item, TextView tvAdditionalDescription) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { + BidiFormatter pathRtlFormatter = BidiFormatter.getInstance(); + tvAdditionalDescription.setText(pathRtlFormatter.unicodeWrap(item.getDirectory())); + } else { + tvAdditionalDescription.setText(String.format("\u200E%s", item.getDirectory())); + } + } + @Override public void onDestroy() { if (!activity.isChangingConfigurations()) {