Commit be47c1b5 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Fix some layout issues

parent c113af7b
...@@ -15,7 +15,6 @@ import android.support.v7.widget.LinearLayoutManager ...@@ -15,7 +15,6 @@ import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.text.method.ScrollingMovementMethod import android.text.method.ScrollingMovementMethod
import android.view.* import android.view.*
import android.widget.ImageButton
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.chatroom.presentation.ChatRoomPresenter import chat.rocket.android.chatroom.presentation.ChatRoomPresenter
import chat.rocket.android.chatroom.presentation.ChatRoomView import chat.rocket.android.chatroom.presentation.ChatRoomView
...@@ -250,9 +249,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.EmojiKeyboardLi ...@@ -250,9 +249,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.EmojiKeyboardLi
override fun onKeyPressed(keyCode: Int) { override fun onKeyPressed(keyCode: Int) {
when (keyCode) { when (keyCode) {
KeyEvent.KEYCODE_BACK -> with(text_message) { KeyEvent.KEYCODE_BACK -> with(text_message) {
if (selectionStart > 0) { if (selectionStart > 0) text.delete(selectionStart - 1, selectionStart)
text.delete(selectionStart - 1, selectionStart)
}
} }
else -> throw IllegalArgumentException("pressed key not expected") else -> throw IllegalArgumentException("pressed key not expected")
} }
...@@ -298,7 +295,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.EmojiKeyboardLi ...@@ -298,7 +295,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.EmojiKeyboardLi
activity?.let { activity?.let {
val fragment = EmojiFragment.getOrAttach(it, R.id.emoji_fragment_placeholder, composer) val fragment = EmojiFragment.getOrAttach(it, R.id.emoji_fragment_placeholder, composer)
if (fragment.isCollapsed()) { if (fragment.isCollapsed()) {
fragment.show() fragment.openHidden()
} }
setReactionButtonIcon(R.drawable.ic_reaction_24dp) setReactionButtonIcon(R.drawable.ic_reaction_24dp)
} }
......
...@@ -98,7 +98,6 @@ class EmojiFragment : Fragment() { ...@@ -98,7 +98,6 @@ class EmojiFragment : Fragment() {
EmojiRepository.saveKeyboardHeight(currentKeyboardHeight) EmojiRepository.saveKeyboardHeight(currentKeyboardHeight)
setKeyboardHeight(currentKeyboardHeight) setKeyboardHeight(currentKeyboardHeight)
softKeyboardVisible = true softKeyboardVisible = true
openHidden()
} else if (lastVisibleDecorViewHeight + MIN_KEYBOARD_HEIGHT_PX < visibleDecorViewHeight) { } else if (lastVisibleDecorViewHeight + MIN_KEYBOARD_HEIGHT_PX < visibleDecorViewHeight) {
// Notify listener about keyboard being hidden. // Notify listener about keyboard being hidden.
softKeyboardVisible = false softKeyboardVisible = false
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingTop="10dp" android:paddingTop="10dp"
...@@ -43,27 +42,31 @@ ...@@ -43,27 +42,31 @@
android:id="@+id/button_add_reaction" android:id="@+id/button_add_reaction"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_gravity="bottom"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="false"
android:contentDescription="@string/msg_content_description_show_attachment_options" android:contentDescription="@string/msg_content_description_show_attachment_options"
android:src="@drawable/ic_reaction_24dp" /> android:src="@drawable/ic_reaction_24dp" />
<chat.rocket.android.widget.emoji.ComposerEditText <chat.rocket.android.widget.emoji.ComposerEditText
android:id="@+id/text_message" android:id="@+id/text_message"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:hint="@string/msg_message" android:hint="@string/msg_message"
android:inputType="textCapSentences|textMultiLine"
android:maxLines="4" android:maxLines="4"
android:minHeight="24dp"
android:scrollbars="vertical" /> android:scrollbars="vertical" />
<ImageButton <ImageButton
android:id="@+id/button_show_attachment_options" android:id="@+id/button_show_attachment_options"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/msg_content_description_show_attachment_options" android:contentDescription="@string/msg_content_description_show_attachment_options"
android:src="@drawable/ic_add_24dp" /> android:src="@drawable/ic_add_24dp" />
...@@ -72,6 +75,7 @@ ...@@ -72,6 +75,7 @@
android:id="@+id/button_send" android:id="@+id/button_send"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/msg_content_description_send_message" android:contentDescription="@string/msg_content_description_send_message"
android:src="@drawable/ic_send_24dp" android:src="@drawable/ic_send_24dp"
......
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