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
d10c519a
Commit
d10c519a
authored
Jan 25, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR based feedback
parent
92b0eb83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
15 deletions
+14
-15
ImageKeyboardEditText.java
.../rocket/android/widget/message/ImageKeyboardEditText.java
+9
-9
MessageFormLayout.java
...chat/rocket/android/widget/message/MessageFormLayout.java
+4
-5
message_composer.xml
...-android-widgets/src/main/res/layout/message_composer.xml
+1
-1
No files found.
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/
RocketChat
EditText.java
→
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/
ImageKeyboard
EditText.java
View file @
d10c519a
...
...
@@ -12,7 +12,7 @@ import android.view.inputmethod.EditorInfo;
import
android.view.inputmethod.InputConnection
;
import
android.widget.EditText
;
public
class
RocketChat
EditText
extends
EditText
{
public
class
ImageKeyboard
EditText
extends
EditText
{
private
final
String
[]
mimeTypes
=
{
"image/gif"
};
...
...
@@ -29,23 +29,23 @@ public class RocketChatEditText extends EditText {
}
};
private
ContentListener
listener
;
private
OnCommit
ContentListener
listener
;
public
RocketChat
EditText
(
Context
context
)
{
public
ImageKeyboard
EditText
(
Context
context
)
{
super
(
context
);
}
public
RocketChat
EditText
(
Context
context
,
AttributeSet
attrs
)
{
public
ImageKeyboard
EditText
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
RocketChat
EditText
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
public
ImageKeyboard
EditText
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
public
RocketChat
EditText
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
public
ImageKeyboard
EditText
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
super
(
context
,
attrs
,
defStyleAttr
,
defStyleRes
);
}
...
...
@@ -59,11 +59,11 @@ public class RocketChatEditText extends EditText {
.
createWrapper
(
inputConnection
,
editorInfo
,
inputConnectionListener
);
}
public
void
setContentListener
(
ContentListener
listener
)
{
public
void
setContentListener
(
OnCommit
ContentListener
listener
)
{
this
.
listener
=
listener
;
}
public
interface
ContentListener
{
public
interface
OnCommit
ContentListener
{
boolean
onCommitContent
(
InputContentInfoCompat
inputContentInfo
,
int
flags
,
Bundle
opts
,
String
[]
supportedMimeTypes
);
}
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/MessageFormLayout.java
View file @
d10c519a
...
...
@@ -12,7 +12,6 @@ import android.util.AttributeSet;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
...
...
@@ -27,7 +26,7 @@ public class MessageFormLayout extends LinearLayout {
private
ExtraActionSelectionClickListener
extraActionSelectionClickListener
;
private
SubmitTextListener
submitTextListener
;
private
RocketChatEditText
.
ContentListener
listener
;
private
ImageKeyboardEditText
.
OnCommit
ContentListener
listener
;
public
MessageFormLayout
(
Context
context
)
{
super
(
context
);
...
...
@@ -79,7 +78,7 @@ public class MessageFormLayout extends LinearLayout {
btnSubmit
.
setScaleY
(
0
);
btnSubmit
.
setVisibility
(
GONE
);
RocketChatEditText
editText
=
(
RocketChat
EditText
)
composer
.
findViewById
(
R
.
id
.
editor
);
ImageKeyboardEditText
editText
=
(
ImageKeyboard
EditText
)
composer
.
findViewById
(
R
.
id
.
editor
);
editText
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
...
...
@@ -102,7 +101,7 @@ public class MessageFormLayout extends LinearLayout {
}
});
editText
.
setContentListener
(
new
RocketChatEditText
.
ContentListener
()
{
editText
.
setContentListener
(
new
ImageKeyboardEditText
.
OnCommit
ContentListener
()
{
@Override
public
boolean
onCommitContent
(
InputContentInfoCompat
inputContentInfo
,
int
flags
,
Bundle
opts
,
String
[]
supportedMimeTypes
)
{
...
...
@@ -154,7 +153,7 @@ public class MessageFormLayout extends LinearLayout {
composer
.
findViewById
(
R
.
id
.
btn_submit
).
setEnabled
(
enabled
);
}
public
void
setEditTextContentListener
(
RocketChatEditText
.
ContentListener
listener
)
{
public
void
setEditTextContentListener
(
ImageKeyboardEditText
.
OnCommit
ContentListener
listener
)
{
this
.
listener
=
listener
;
}
...
...
rocket-chat-android-widgets/src/main/res/layout/message_composer.xml
View file @
d10c519a
...
...
@@ -21,7 +21,7 @@
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
/>
<chat.rocket.android.widget.message.
RocketChat
EditText
<chat.rocket.android.widget.message.
ImageKeyboard
EditText
android:id=
"@+id/editor"
android:layout_width=
"0px"
android:layout_height=
"wrap_content"
...
...
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