diff --git a/app/src/main/java/de/kuschku/quasseldroid_ng/ui/chat/ChatActivity.kt b/app/src/main/java/de/kuschku/quasseldroid_ng/ui/chat/ChatActivity.kt index 9f75fec591a2a7181d003a6f3452de625c791c9d..ad10acecc968079a04fd78cfb67c64ed184875d9 100644 --- a/app/src/main/java/de/kuschku/quasseldroid_ng/ui/chat/ChatActivity.kt +++ b/app/src/main/java/de/kuschku/quasseldroid_ng/ui/chat/ChatActivity.kt @@ -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 -> diff --git a/app/src/main/res/layout-land/layout_main.xml b/app/src/main/res/layout-land/layout_main.xml new file mode 100644 index 0000000000000000000000000000000000000000..d02f4ac542ef4e56062c8c05bb7a0f9ffe532574 --- /dev/null +++ b/app/src/main/res/layout-land/layout_main.xml @@ -0,0 +1,32 @@ +<?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 diff --git a/app/src/main/res/layout-sw600dp-land/layout_main.xml b/app/src/main/res/layout-sw600dp-land/layout_main.xml new file mode 100644 index 0000000000000000000000000000000000000000..9ec10cd07dc99d438c1eaa12d7cc9e6f104ddf27 --- /dev/null +++ b/app/src/main/res/layout-sw600dp-land/layout_main.xml @@ -0,0 +1,33 @@ +<?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 diff --git a/app/src/main/res/layout/layout_editor.xml b/app/src/main/res/layout/layout_editor.xml index f2c4e903acc15cdebd51b932b2cdd4cebcb610cc..a1e6accbbcfbab9cd8b565caaed009919627b1a2 100644 --- a/app/src/main/res/layout/layout_editor.xml +++ b/app/src/main/res/layout/layout_editor.xml @@ -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" /> diff --git a/app/src/main/res/layout/layout_main.xml b/app/src/main/res/layout/layout_main.xml index ef45eb6e9921abda470d96758912990ae91633f6..9ec10cd07dc99d438c1eaa12d7cc9e6f104ddf27 100644 --- a/app/src/main/res/layout/layout_main.xml +++ b/app/src/main/res/layout/layout_main.xml @@ -1,5 +1,4 @@ <?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"