Fix Name field, change keyboard "New line" button to "Apply".
This commit is contained in:
parent
706f47891c
commit
c63f3045a5
2 changed files with 4 additions and 1 deletions
|
@ -21,7 +21,7 @@
|
||||||
android:id="@+id/profile_name_et"
|
android:id="@+id/profile_name_et"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:inputType="text|textMultiLine|textCapSentences"
|
android:inputType="textMultiLine"
|
||||||
android:scrollHorizontally="false"
|
android:scrollHorizontally="false"
|
||||||
android:maxLines="4"
|
android:maxLines="4"
|
||||||
tools:text="@string/lorem_ipsum" />
|
tools:text="@string/lorem_ipsum" />
|
||||||
|
|
|
@ -15,6 +15,7 @@ import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.preference.Preference;
|
import android.support.v7.preference.Preference;
|
||||||
import android.support.v7.preference.PreferenceViewHolder;
|
import android.support.v7.preference.PreferenceViewHolder;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
|
import android.text.InputType;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -201,6 +202,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
|
hideKeyboard();
|
||||||
if (isChanged()) {
|
if (isChanged()) {
|
||||||
if (saveNewProfile()) {
|
if (saveNewProfile()) {
|
||||||
profile = changedProfile;
|
profile = changedProfile;
|
||||||
|
@ -281,6 +283,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
|
||||||
if (PROFILE_NAME.equals(preference.getKey())) {
|
if (PROFILE_NAME.equals(preference.getKey())) {
|
||||||
profileName = (EditText) holder.findViewById(R.id.profile_name_et);
|
profileName = (EditText) holder.findViewById(R.id.profile_name_et);
|
||||||
profileName.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
profileName.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||||
|
profileName.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||||
profileName.setText(changedProfile.name);
|
profileName.setText(changedProfile.name);
|
||||||
profileName.requestFocus();
|
profileName.requestFocus();
|
||||||
profileName.addTextChangedListener(new TextWatcher() {
|
profileName.addTextChangedListener(new TextWatcher() {
|
||||||
|
|
Loading…
Reference in a new issue