diff --git a/app/src/main/java/de/kuschku/quasseldroid_ng/util/ui/AutoCompleteRecyclerView.kt b/app/src/main/java/de/kuschku/quasseldroid_ng/util/ui/AutoCompleteRecyclerView.kt new file mode 100644 index 0000000000000000000000000000000000000000..b6aece06960a690db7f10be9d76bdd74d48a4fdb --- /dev/null +++ b/app/src/main/java/de/kuschku/quasseldroid_ng/util/ui/AutoCompleteRecyclerView.kt @@ -0,0 +1,24 @@ +package de.kuschku.quasseldroid_ng.util.ui + +import android.content.Context +import android.support.v7.widget.RecyclerView +import android.util.AttributeSet +import de.kuschku.quasseldroid_ng.R + +class AutoCompleteRecyclerView : RecyclerView { + constructor(context: Context?) : super(context) + constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) + constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super( + context, attrs, defStyle + ) + + override fun onMeasure(widthSpec: Int, heightSpec: Int) { + super.onMeasure( + widthSpec, + MeasureSpec.makeMeasureSpec( + resources.getDimensionPixelSize(R.dimen.autocomplete_max_height), + MeasureSpec.AT_MOST + ) + ) + } +} \ No newline at end of file diff --git a/app/src/main/res/layout-land/layout_main.xml b/app/src/main/res/layout-land/layout_main.xml index d02f4ac542ef4e56062c8c05bb7a0f9ffe532574..63319cf23e1e8471a1ffb9683607a60d96a618f0 100644 --- a/app/src/main/res/layout-land/layout_main.xml +++ b/app/src/main/res/layout-land/layout_main.xml @@ -23,8 +23,14 @@ 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" + android:layout_height="0dip" + android:layout_weight="1" tools:layout="@layout/fragment_messages" /> + + <de.kuschku.quasseldroid_ng.util.ui.AutoCompleteRecyclerView + android:id="@+id/autocomplete_list" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> </LinearLayout> <include layout="@layout/layout_slider" /> diff --git a/app/src/main/res/layout-sw600dp-land/layout_main.xml b/app/src/main/res/layout-sw600dp-land/layout_main.xml index 9ec10cd07dc99d438c1eaa12d7cc9e6f104ddf27..11679ffe195261f3e46dd5281a3b109c049a7062 100644 --- a/app/src/main/res/layout-sw600dp-land/layout_main.xml +++ b/app/src/main/res/layout-sw600dp-land/layout_main.xml @@ -19,12 +19,25 @@ app:umanoScrollableView="@id/chatline_scroller" app:umanoShadowHeight="4dp"> - <fragment - android:id="@+id/fragment_messages" - android:name="de.kuschku.quasseldroid_ng.ui.chat.messages.MessageListFragment" + <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" - tools:layout="@layout/fragment_messages" /> + android:orientation="vertical"> + + <fragment + android:id="@+id/fragment_messages" + android:name="de.kuschku.quasseldroid_ng.ui.chat.messages.MessageListFragment" + android:layout_width="match_parent" + android:layout_height="0dip" + android:layout_weight="1" + tools:layout="@layout/fragment_messages" /> + + <de.kuschku.quasseldroid_ng.util.ui.AutoCompleteRecyclerView + android:id="@+id/autocomplete_list" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + </LinearLayout> <include layout="@layout/layout_slider" /> diff --git a/app/src/main/res/layout/layout_editor.xml b/app/src/main/res/layout/layout_editor.xml index 401e590744057e32f36e9d46c75d9d6747e585e2..c98d345702e6e792f1256380bdc9e362cacc1d22 100644 --- a/app/src/main/res/layout/layout_editor.xml +++ b/app/src/main/res/layout/layout_editor.xml @@ -46,11 +46,10 @@ app:layout_constraintEnd_toEndOf="parent" app:srcCompat="@drawable/ic_send" /> - <android.support.v7.widget.RecyclerView + <de.kuschku.quasseldroid_ng.util.ui.AutoCompleteRecyclerView android:id="@+id/autocomplete_list2" android:layout_width="match_parent" android:layout_height="wrap_content" - android:maxHeight="144dp" app:layout_constraintBottom_toTopOf="@+id/formatting_toolbar_container" /> <android.support.design.widget.AppBarLayout diff --git a/app/src/main/res/layout/layout_main.xml b/app/src/main/res/layout/layout_main.xml index 9c856a9a860e81aa520afa97cf3710664bf0449c..be36a2487f5c1b6dc6c56320bed67f319837b04b 100644 --- a/app/src/main/res/layout/layout_main.xml +++ b/app/src/main/res/layout/layout_main.xml @@ -32,12 +32,10 @@ android:layout_weight="1" tools:layout="@layout/fragment_messages" /> - <android.support.v7.widget.RecyclerView + <de.kuschku.quasseldroid_ng.util.ui.AutoCompleteRecyclerView android:id="@+id/autocomplete_list" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:maxHeight="144dp" /> - + android:layout_height="wrap_content" /> </LinearLayout> <include layout="@layout/layout_slider" /> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 03012d411fcd296c628d15b39d772f616ddb282a..21fb8ab65f39b0dce1da370f4ec1ce9d6051fe04 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -3,4 +3,6 @@ <dimen name="message_horizontal">8dp</dimen> <dimen name="message_vertical">2dp</dimen> + + <dimen name="autocomplete_max_height">96dp</dimen> </resources>