diff --git a/OsmAnd/res/layout/osm_login_data.xml b/OsmAnd/res/layout/osm_login_data.xml index 26dbdd85e5..1e5e4a87de 100644 --- a/OsmAnd/res/layout/osm_login_data.xml +++ b/OsmAnd/res/layout/osm_login_data.xml @@ -6,7 +6,7 @@ android:orientation="vertical" android:paddingLeft="@dimen/content_padding" android:paddingRight="@dimen/content_padding" - android:paddingBottom="@dimen/route_info_list_text_padding"> + android:paddingBottom="@dimen/dialog_button_height"> + android:layout_marginStart="@dimen/dialog_content_margin" + android:layout_marginLeft="@dimen/dialog_content_margin" + android:layout_marginTop="@dimen/content_padding_small" + android:layout_marginEnd="@dimen/content_padding_small" + android:layout_marginRight="@dimen/content_padding_small" + android:layout_marginBottom="@dimen/content_padding_small" + android:orientation="vertical"> @@ -47,7 +50,6 @@ android:letterSpacing="@dimen/description_letter_spacing" android:maxLines="1" android:paddingTop="@dimen/content_padding_small" - android:paddingBottom="@dimen/content_padding_small" android:textColor="?attr/active_color_basic" android:textSize="@dimen/default_desc_text_size" osmand:typeface="@string/font_roboto_medium" diff --git a/OsmAnd/res/xml/accessibility_settings.xml b/OsmAnd/res/xml/accessibility_settings.xml index 69e92ecc50..3c1096fe37 100644 --- a/OsmAnd/res/xml/accessibility_settings.xml +++ b/OsmAnd/res/xml/accessibility_settings.xml @@ -12,10 +12,10 @@ android:title="@string/accessibility_mode_disabled" /> { PluginsListAdapter() { diff --git a/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java index 223bc8bee1..a91fe73580 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java @@ -62,6 +62,7 @@ public class MultimediaNotesFragment extends BaseSettingsFragment implements Cop private static final Log log = PlatformUtil.getLog(MultimediaNotesFragment.class); + private static final String OPEN_NOTES_DESCRIPTION = "open_notes_description"; private static final String CAMERA_PERMISSION = "camera_permission"; private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings"; private static final String RESET_TO_DEFAULT = "reset_to_default"; @@ -244,9 +245,13 @@ public class MultimediaNotesFragment extends BaseSettingsFragment implements Cop } private void setupPhotoPlaySoundPref(Camera cam, AudioVideoNotesPlugin plugin) { + Drawable disabled = getContentIcon(R.drawable.ic_action_music_off); + Drawable enabled = getActiveIcon(R.drawable.ic_type_audio); + Drawable icon = getPersistentPrefIcon(enabled, disabled); + SwitchPreferenceEx photoPlaySound = (SwitchPreferenceEx) findPreference(plugin.AV_PHOTO_PLAY_SOUND.getId()); photoPlaySound.setDescription(getString(R.string.av_photo_play_sound_descr)); - photoPlaySound.setIcon(getPersistentPrefIcon(R.drawable.ic_action_music_off)); + photoPlaySound.setIcon(icon); photoPlaySound.setEnabled(cam != null); } @@ -384,7 +389,7 @@ public class MultimediaNotesFragment extends BaseSettingsFragment implements Cop Typeface typeface = FontCache.getRobotoMedium(getContext()); titleSpan.setSpan(new CustomTypefaceSpan(typeface), startIndex, startIndex + multimediaNotesPath.length(), 0); - Preference osmEditsDescription = findPreference("open_notes_description"); + Preference osmEditsDescription = findPreference(OPEN_NOTES_DESCRIPTION); osmEditsDescription.setTitle(titleSpan); } @@ -444,7 +449,8 @@ public class MultimediaNotesFragment extends BaseSettingsFragment implements Cop @Override protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) { super.onBindPreferenceViewHolder(preference, holder); - if (CAMERA_PERMISSION.equals(preference.getKey())) { + String prefId = preference.getKey(); + if (CAMERA_PERMISSION.equals(prefId)) { View selectableView = holder.itemView.findViewById(R.id.selectable_list_item); if (selectableView != null) { int color = AndroidUtils.getColorFromAttr(app, R.attr.activity_background_color); @@ -460,6 +466,9 @@ public class MultimediaNotesFragment extends BaseSettingsFragment implements Cop AndroidUtils.setBackground(selectableView, bgDrawable); } } + } else if (OPEN_NOTES_DESCRIPTION.equals(prefId)) { + int minHeight = getResources().getDimensionPixelSize(R.dimen.bottom_sheet_list_item_height); + holder.itemView.setMinimumHeight(minHeight); } } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java index 07e3058730..546b2c3dcd 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java @@ -162,6 +162,20 @@ public class PluginInstalledBottomSheetDialog extends MenuBottomSheetDialogFragm return R.string.shared_string_turn_off; } + @Override + protected void onDismissButtonClickAction() { + OsmandApplication app = getMyApplication(); + OsmandPlugin plugin = OsmandPlugin.getPlugin(pluginId); + if (app != null && plugin != null) { + Activity activity = getActivity(); + OsmandPlugin.enablePlugin(activity, app, plugin, false); + + if (activity instanceof PluginStateListener) { + ((PluginStateListener) activity).onPluginStateChanged(plugin); + } + } + } + @Override protected int getRightBottomButtonTextId() { return R.string.shared_string_ok; @@ -307,4 +321,10 @@ public class PluginInstalledBottomSheetDialog extends MenuBottomSheetDialogFragm LOG.error("showInstance", e); } } -} + + public interface PluginStateListener { + + void onPluginStateChanged(OsmandPlugin plugin); + + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java b/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java index 2c559e2312..82f80519eb 100644 --- a/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java @@ -118,6 +118,7 @@ public class NavigationFragment extends BaseSettingsFragment { } bundle.putString(DIALOG_TYPE, TYPE_NAV_PROFILE); dialog.setArguments(bundle); + dialog.setUsedOnMap(false); if (getActivity() != null) { getActivity().getSupportFragmentManager().beginTransaction() .add(dialog, "select_nav_type").commitAllowingStateLoss(); diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/EditTextPreferenceBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/EditTextPreferenceBottomSheet.java index 447b34dd24..3868fcc6f2 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/EditTextPreferenceBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/EditTextPreferenceBottomSheet.java @@ -53,7 +53,7 @@ public class EditTextPreferenceBottomSheet extends BasePreferenceBottomSheet { RelativeLayout editTextLayout = view.findViewById(R.id.text_field_boxes_editTextLayout); if (editTextLayout != null && editTextLayout.getLayoutParams() instanceof RelativeLayout.LayoutParams) { RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) editTextLayout.getLayoutParams(); - params.setMargins(params.leftMargin, AndroidUtils.dpToPx(ctx, 19), params.rightMargin, params.bottomMargin); + params.setMargins(params.leftMargin, AndroidUtils.dpToPx(ctx, 9), params.rightMargin, params.bottomMargin); } items.add(new SimpleBottomSheetItem.Builder().setCustomView(view).create());