diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java index c5cf8f1cb..f6646ab9d 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java @@ -30,6 +30,7 @@ import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.inputmethod.EditorInfo; import android.widget.Button; import com.bluelinelabs.conductor.RouterTransaction; @@ -128,6 +129,14 @@ public class EntryMenuController extends BaseController { super.onViewBound(view); NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this); + editText.setOnEditorActionListener((v, actionId, event) -> { + if (actionId == EditorInfo.IME_ACTION_DONE && proceedButton.isEnabled()) { + proceedButton.callOnClick(); + return true; + } + return false; + }); + editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -144,12 +153,12 @@ public class EntryMenuController extends BaseController { if (!TextUtils.isEmpty(s)) { if (operationCode == 2) { if (room.getName() == null || !room.getName().equals(s.toString())) { - if (proceedButton.isEnabled()) { + if (!proceedButton.isEnabled()) { proceedButton.setEnabled(true); proceedButton.setAlpha(1.0f); } } else { - if (!proceedButton.isEnabled()) { + if (proceedButton.isEnabled()) { proceedButton.setEnabled(false); proceedButton.setAlpha(0.7f); } diff --git a/app/src/main/res/layout/controller_entry_menu.xml b/app/src/main/res/layout/controller_entry_menu.xml index ff85b58ec..6eee8210c 100644 --- a/app/src/main/res/layout/controller_entry_menu.xml +++ b/app/src/main/res/layout/controller_entry_menu.xml @@ -28,7 +28,7 @@ + android:background="@color/nc_white_color"> + android:layout_marginStart="16dp" + android:focusable="false" + android:focusableInTouchMode="false"/> - \ No newline at end of file + diff --git a/app/src/main/res/layout/rv_item_menu.xml b/app/src/main/res/layout/rv_item_menu.xml index 228b2ac34..6b294bcdf 100644 --- a/app/src/main/res/layout/rv_item_menu.xml +++ b/app/src/main/res/layout/rv_item_menu.xml @@ -22,16 +22,16 @@ + android:layout_marginTop="16dp"> - - \ No newline at end of file +