fix text multiline in text fields

This commit is contained in:
veliymolfar 2020-06-12 15:20:46 +03:00
parent a0c58cb624
commit ab1050d43d
2 changed files with 10 additions and 2 deletions

View file

@ -55,7 +55,8 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/name_edit_text" android:id="@+id/name_edit_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="wrap_content"
android:minHeight="@dimen/favorites_list_item_height" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
@ -72,7 +73,8 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/url_edit_text" android:id="@+id/url_edit_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="wrap_content"
android:minHeight="@dimen/favorites_list_item_height" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<include layout="@layout/divider" /> <include layout="@layout/divider" />

View file

@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.text.Editable; import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -14,6 +15,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.inputmethod.EditorInfo;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
@ -173,9 +175,13 @@ public class EditMapSourceDialogFragment extends BaseOsmAndDialogFragment
nameInputLayout = root.findViewById(R.id.name_input_layout); nameInputLayout = root.findViewById(R.id.name_input_layout);
nameInputLayout.setBoxStrokeColor(boxStrokeColor); nameInputLayout.setBoxStrokeColor(boxStrokeColor);
nameEditText = root.findViewById(R.id.name_edit_text); 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 = root.findViewById(R.id.url_input_layout);
urlInputLayout.setBoxStrokeColor(boxStrokeColor); urlInputLayout.setBoxStrokeColor(boxStrokeColor);
urlEditText = root.findViewById(R.id.url_edit_text); 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); contentContainer = root.findViewById(R.id.content_container);
saveBtn = root.findViewById(R.id.save_button); saveBtn = root.findViewById(R.id.save_button);
saveBtn.setBackgroundResource(nightMode ? R.drawable.dlg_btn_primary_dark : R.drawable.dlg_btn_primary_light); saveBtn.setBackgroundResource(nightMode ? R.drawable.dlg_btn_primary_dark : R.drawable.dlg_btn_primary_light);