Skip to content
Snippets Groups Projects
Commit 97fc3cec authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Improved input handling with hardware keyboards

parent 05e6c02c
Branches
Tags
No related merge requests found
......@@ -110,8 +110,10 @@ class ChatActivity : ServiceBoundActivity() {
chatline.setOnKeyListener { _, keyCode, event ->
if (event.hasNoModifiers() && (keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.KEYCODE_NUMPAD_ENTER)) {
send()
true
} else {
false
}
false
}
viewModel.getBuffer().observe(
......@@ -187,7 +189,7 @@ class ChatActivity : ServiceBoundActivity() {
editorPanel.panelState = SlidingUpPanelLayout.PanelState.COLLAPSED
}
fun send() {
private fun send() {
viewModel.session { session ->
viewModel.getBuffer().let { bufferId ->
session.bufferSyncer?.bufferInfo(bufferId)?.also { bufferInfo ->
......
<?xml version="1.0" encoding="utf-8"?>
<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/editor_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
app:umanoAntiDragView="@id/card_panel"
app:umanoPanelHeight="?actionBarSize"
app:umanoScrollableView="@id/chatline_scroller"
app:umanoShadowHeight="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<include layout="@layout/layout_toolbar" />
<fragment
android:id="@+id/fragment_messages"
android:name="de.kuschku.quasseldroid_ng.ui.chat.messages.MessageListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_messages" />
</LinearLayout>
<include layout="@layout/layout_slider" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<include layout="@layout/layout_toolbar" />
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/editor_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
app:umanoAntiDragView="@id/card_panel"
app:umanoPanelHeight="?actionBarSize"
app:umanoScrollableView="@id/chatline_scroller"
app:umanoShadowHeight="4dp">
<fragment
android:id="@+id/fragment_messages"
android:name="de.kuschku.quasseldroid_ng.ui.chat.messages.MessageListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_messages" />
<include layout="@layout/layout_slider" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</LinearLayout>
\ No newline at end of file
......@@ -21,14 +21,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:gravity="top"
android:gravity="center_vertical"
android:hint="@string/label_placeholder"
android:imeOptions="actionSend|flagNoEnterAction"
android:imeOptions="actionSend|flagNoEnterAction|flagNoExtractUi"
android:inputType="textCapSentences|textAutoCorrect|textShortMessage"
android:paddingBottom="17dp"
android:minHeight="?actionBarSize"
android:paddingBottom="8dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="17dp"
android:paddingTop="8dp"
android:textColor="?attr/colorForeground"
android:textSize="16sp" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment