Improved chat room landscape UI when not much height is available (such as phones)
This commit is contained in:
parent
a11e66f404
commit
8cd42efa8e
5 changed files with 17 additions and 17 deletions
|
@ -100,7 +100,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
// IME_FLAG_NO_PERSONALIZED_LEARNING is only available on Android 8 and newer
|
// IME_FLAG_NO_PERSONALIZED_LEARNING is only available on Android 8 and newer
|
||||||
Compatibility.getImeFlagsForSecureChatRoom()
|
Compatibility.getImeFlagsForSecureChatRoom()
|
||||||
} else {
|
} else {
|
||||||
EditorInfo.IME_FLAG_NO_EXTRACT_UI
|
EditorInfo.IME_NULL
|
||||||
}
|
}
|
||||||
|
|
||||||
val isEmojiPickerOpen = MutableLiveData<Boolean>()
|
val isEmojiPickerOpen = MutableLiveData<Boolean>()
|
||||||
|
|
|
@ -138,7 +138,7 @@ class Api23Compatibility {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getImeFlagsForSecureChatRoom(): Int {
|
fun getImeFlagsForSecureChatRoom(): Int {
|
||||||
return EditorInfo.IME_FLAG_NO_EXTRACT_UI
|
return EditorInfo.IME_NULL
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun addImageToMediaStore(context: Context, content: Content): Boolean {
|
suspend fun addImageToMediaStore(context: Context, content: Content): Boolean {
|
||||||
|
|
|
@ -346,7 +346,7 @@ class Api26Compatibility {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getImeFlagsForSecureChatRoom(): Int {
|
fun getImeFlagsForSecureChatRoom(): Int {
|
||||||
return EditorInfo.IME_FLAG_NO_EXTRACT_UI or EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING
|
return EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startForegroundService(context: Context, intent: Intent) {
|
fun startForegroundService(context: Context, intent: Intent) {
|
||||||
|
|
|
@ -145,18 +145,6 @@
|
||||||
android:layout_alignTop="@id/top_bar"
|
android:layout_alignTop="@id/top_bar"
|
||||||
tools:layout="@layout/list_edit_top_bar_fragment" />
|
tools:layout="@layout/list_edit_top_bar_fragment" />
|
||||||
|
|
||||||
<include
|
|
||||||
android:id="@+id/footer"
|
|
||||||
layout="@layout/chat_room_sending"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
app:viewModel="@{viewModel}"
|
|
||||||
app:chatSendingViewModel="@{chatSendingViewModel}"
|
|
||||||
app:attachFileClickListener="@{attachFileClickListener}"
|
|
||||||
app:voiceRecordingTouchListener="@{voiceRecordingTouchListener}"
|
|
||||||
app:cancelReplyToClickListener="@{cancelReplyToClickListener}"/>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/chat_messages_list"
|
android:id="@+id/chat_messages_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -196,9 +184,21 @@
|
||||||
android:src="@{viewModel.securityLevelIcon, default=@drawable/security_alert_indicator}"
|
android:src="@{viewModel.securityLevelIcon, default=@drawable/security_alert_indicator}"
|
||||||
android:visibility="@{viewModel.encryptedChatRoom ? View.VISIBLE : View.GONE}" />
|
android:visibility="@{viewModel.encryptedChatRoom ? View.VISIBLE : View.GONE}" />
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/footer"
|
||||||
|
layout="@layout/chat_room_sending"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
app:viewModel="@{viewModel}"
|
||||||
|
app:chatSendingViewModel="@{chatSendingViewModel}"
|
||||||
|
app:attachFileClickListener="@{attachFileClickListener}"
|
||||||
|
app:voiceRecordingTouchListener="@{voiceRecordingTouchListener}"
|
||||||
|
app:cancelReplyToClickListener="@{cancelReplyToClickListener}"/>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:onClick="@{scrollToBottomClickListener}"
|
android:onClick="@{scrollToBottomClickListener}"
|
||||||
android:visibility="@{viewModel.isUserScrollingUp ? View.VISIBLE : View.GONE, default=gone}"
|
android:visibility="@{viewModel.isUserScrollingUp && !chatSendingViewModel.isEmojiPickerOpen ? View.VISIBLE : View.GONE, default=gone}"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="chat_room_emoji_picker_height">240dp</dimen>
|
<dimen name="chat_room_emoji_picker_height">200dp</dimen>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in a new issue