Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
2bef3fd7
Commit
2bef3fd7
authored
Jul 26, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update messageFormLayout and message_composer.
parent
bdc1c6b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
77 deletions
+72
-77
MessageFormLayout.java
...chat/rocket/android/widget/message/MessageFormLayout.java
+16
-16
message_composer.xml
...-android-widgets/src/main/res/layout/message_composer.xml
+56
-61
No files found.
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/MessageFormLayout.java
View file @
2bef3fd7
...
...
@@ -14,8 +14,8 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.EditText
;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
chat.rocket.android.widget.R
;
...
...
@@ -23,8 +23,8 @@ public class MessageFormLayout extends LinearLayout {
protected
ViewGroup
composer
;
private
View
btnExtra
;
private
View
btnSubmit
;
private
ImageButton
attachmentImageButton
;
private
ImageButton
sendImageButton
;
private
ExtraActionSelectionClickListener
extraActionSelectionClickListener
;
private
SubmitTextListener
submitTextListener
;
...
...
@@ -55,18 +55,18 @@ public class MessageFormLayout extends LinearLayout {
composer
=
(
ViewGroup
)
LayoutInflater
.
from
(
getContext
())
.
inflate
(
R
.
layout
.
message_composer
,
this
,
false
);
btnExtra
=
composer
.
findViewById
(
R
.
id
.
btn_extras
);
attachmentImageButton
=
composer
.
findViewById
(
R
.
id
.
attachmentImageButton
);
btnExtra
.
setOnClickListener
(
new
OnClickListener
()
{
attachmentImageButton
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
onExtraActionSelectionClick
();
}
});
btnSubmit
=
composer
.
findViewById
(
R
.
id
.
btn_submit
);
sendImageButton
=
composer
.
findViewById
(
R
.
id
.
sendImageButton
);
btnSubmit
.
setOnClickListener
(
new
OnClickListener
()
{
sendImageButton
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
String
messageText
=
getText
();
...
...
@@ -76,11 +76,11 @@ public class MessageFormLayout extends LinearLayout {
}
});
btnSubmit
.
setScaleX
(
0
);
btnSubmit
.
setScaleY
(
0
);
btnSubmit
.
setVisibility
(
GONE
);
sendImageButton
.
setScaleX
(
0
);
sendImageButton
.
setScaleY
(
0
);
sendImageButton
.
setVisibility
(
GONE
);
ImageKeyboardEditText
editText
=
(
ImageKeyboardEditText
)
composer
.
findViewById
(
R
.
id
.
editor
);
ImageKeyboardEditText
editText
=
composer
.
findViewById
(
R
.
id
.
editor
);
editText
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
...
...
@@ -94,11 +94,11 @@ public class MessageFormLayout extends LinearLayout {
@Override
public
void
afterTextChanged
(
Editable
s
)
{
if
(
TextUtils
.
getTrimmedLength
(
s
)
>
0
)
{
animateHide
(
btnExtra
);
animateShow
(
btnSubmit
);
animateHide
(
attachmentImageButton
);
animateShow
(
sendImageButton
);
}
else
{
animateShow
(
btnExtra
);
animateHide
(
btnSubmit
);
animateShow
(
attachmentImageButton
);
animateHide
(
sendImageButton
);
}
}
});
...
...
@@ -164,7 +164,7 @@ public class MessageFormLayout extends LinearLayout {
public
void
setEnabled
(
boolean
enabled
)
{
getEditor
().
setEnabled
(
enabled
);
composer
.
findViewById
(
R
.
id
.
btn_submit
).
setEnabled
(
enabled
);
composer
.
findViewById
(
R
.
id
.
sendImageButton
).
setEnabled
(
enabled
);
}
public
void
setEditTextCommitContentListener
(
...
...
rocket-chat-android-widgets/src/main/res/layout/message_composer.xml
View file @
2bef3fd7
<?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"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<chat.rocket.android.widget.DividerView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"bottom"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/emoji_keyboard_toggle"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
/>
<chat.rocket.android.widget.message.ImageKeyboardEditText
android:id=
"@+id/editor"
android:layout_width=
"0px"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:inputType=
"textCapSentences|textMultiLine"
android:background=
"@null"
android:layout_marginLeft=
"0dp"
android:layout_marginRight=
"0dp"
android:layout_marginTop=
"4dp"
android:layout_marginBottom=
"4dp"
android:padding=
"0dp"
android:layout_weight=
"1"
android:textSize=
"14sp"
android:hint=
"@string/message_composer_message_hint"
android:minLines=
"1"
android:maxLines=
"4"
/>
<FrameLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/btn_extras"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:padding=
"8dp"
app:srcCompat=
"@drawable/ic_add_circle_outline_black_24dp"
/>
<ImageView
android:id=
"@+id/btn_submit"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:padding=
"8dp"
app:srcCompat=
"@drawable/ic_send_black_24dp"
/>
</FrameLayout>
</LinearLayout>
</LinearLayout>
<android.support.constraint.ConstraintLayout
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=
"wrap_content"
android:minHeight=
"48dp"
android:background=
"@drawable/top_shadow"
tools:context=
"chat.rocket.android.widget.message.MessageFormLayout"
>
<chat.rocket.android.widget.message.ImageKeyboardEditText
android:id=
"@+id/editor"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"16dp"
android:layout_marginStart=
"16dp"
android:inputType=
"textCapSentences|textMultiLine"
android:hint=
"@string/message_composer_message_hint"
android:textSize=
"14sp"
android:minLines=
"1"
android:maxLines=
"4"
android:background=
"@null"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toLeftOf=
"@+id/imageButtonContainer"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
<android.support.constraint.ConstraintLayout
android:id=
"@+id/imageButtonContainer"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginRight=
"16dp"
android:layout_marginEnd=
"16dp"
app:layout_constraintTop_toTopOf=
"@+id/editor"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintLeft_toRightOf=
"@+id/editor"
app:layout_constraintBottom_toBottomOf=
"@+id/editor"
>
<ImageButton
android:id=
"@+id/attachmentImageButton"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:tint=
"@color/colorDefaultMessageComposerIcon"
app:srcCompat=
"@drawable/ic_attach_file_black_24dp"
android:background=
"?attr/selectableItemBackgroundBorderless"
/>
<ImageButton
android:id=
"@+id/sendImageButton"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:tint=
"@color/colorAccent"
app:srcCompat=
"@drawable/ic_send_black_24dp"
android:background=
"?attr/selectableItemBackgroundBorderless"
/>
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment