From ab1050d43d0e39da59a008a4747f610e5c7e7c7c Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Fri, 12 Jun 2020 15:20:46 +0300 Subject: [PATCH] fix text multiline in text fields --- OsmAnd/res/layout/fragment_edit_map_source.xml | 6 ++++-- .../osmand/plus/mapsource/EditMapSourceDialogFragment.java | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/layout/fragment_edit_map_source.xml b/OsmAnd/res/layout/fragment_edit_map_source.xml index 3ca2ea8f8d..6c16662b17 100644 --- a/OsmAnd/res/layout/fragment_edit_map_source.xml +++ b/OsmAnd/res/layout/fragment_edit_map_source.xml @@ -55,7 +55,8 @@ + android:layout_height="wrap_content" + android:minHeight="@dimen/favorites_list_item_height" /> + android:layout_height="wrap_content" + android:minHeight="@dimen/favorites_list_item_height" /> diff --git a/OsmAnd/src/net/osmand/plus/mapsource/EditMapSourceDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapsource/EditMapSourceDialogFragment.java index a5c7aa9c58..0cbcb62a26 100644 --- a/OsmAnd/src/net/osmand/plus/mapsource/EditMapSourceDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapsource/EditMapSourceDialogFragment.java @@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.text.Editable; +import android.text.InputType; import android.text.TextWatcher; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -14,6 +15,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.view.ViewTreeObserver; +import android.view.inputmethod.EditorInfo; import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; @@ -173,9 +175,13 @@ public class EditMapSourceDialogFragment extends BaseOsmAndDialogFragment nameInputLayout = root.findViewById(R.id.name_input_layout); nameInputLayout.setBoxStrokeColor(boxStrokeColor); nameEditText = root.findViewById(R.id.name_edit_text); + nameEditText.setImeOptions(EditorInfo.IME_ACTION_DONE); + nameEditText.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES); urlInputLayout = root.findViewById(R.id.url_input_layout); urlInputLayout.setBoxStrokeColor(boxStrokeColor); urlEditText = root.findViewById(R.id.url_edit_text); + urlEditText.setImeOptions(EditorInfo.IME_ACTION_DONE); + urlEditText.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES); contentContainer = root.findViewById(R.id.content_container); saveBtn = root.findViewById(R.id.save_button); saveBtn.setBackgroundResource(nightMode ? R.drawable.dlg_btn_primary_dark : R.drawable.dlg_btn_primary_light);