Verified Commit 30f87e62 authored by Torsten Grote's avatar Torsten Grote
Browse files

Only create one forum when pressing enter

parent a0d91da5
...@@ -27,11 +27,13 @@ import javax.inject.Inject; ...@@ -27,11 +27,13 @@ import javax.inject.Inject;
import static android.view.View.GONE; import static android.view.View.GONE;
import static android.view.View.VISIBLE; import static android.view.View.VISIBLE;
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
import static android.widget.Toast.LENGTH_LONG; import static android.widget.Toast.LENGTH_LONG;
import static java.util.logging.Level.WARNING; import static java.util.logging.Level.WARNING;
import static org.briarproject.bramble.util.LogUtils.logDuration; import static org.briarproject.bramble.util.LogUtils.logDuration;
import static org.briarproject.bramble.util.LogUtils.logException; import static org.briarproject.bramble.util.LogUtils.logException;
import static org.briarproject.bramble.util.LogUtils.now; import static org.briarproject.bramble.util.LogUtils.now;
import static org.briarproject.briar.android.util.UiUtils.enterPressed;
import static org.briarproject.briar.api.forum.ForumConstants.MAX_FORUM_NAME_LENGTH; import static org.briarproject.briar.api.forum.ForumConstants.MAX_FORUM_NAME_LENGTH;
@MethodsNotNullByDefault @MethodsNotNullByDefault
...@@ -76,8 +78,11 @@ public class CreateForumActivity extends BriarActivity { ...@@ -76,8 +78,11 @@ public class CreateForumActivity extends BriarActivity {
} }
}); });
nameEntry.setOnEditorActionListener((v, actionId, e) -> { nameEntry.setOnEditorActionListener((v, actionId, e) -> {
createForum(); if (actionId == IME_ACTION_DONE || enterPressed(actionId, e)) {
return true; createForum();
return true;
}
return false;
}); });
createForumButton = findViewById(R.id.createForumButton); createForumButton = findViewById(R.id.createForumButton);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment