Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-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
xabber-android
Commits
892510c5
Commit
892510c5
authored
Feb 03, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ChatViewer: send action text insert fixed.
parent
abcde7d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
ChatViewer.java
app/src/main/java/com/xabber/android/ui/ChatViewer.java
+11
-2
ChatViewerFragment.java
...c/main/java/com/xabber/android/ui/ChatViewerFragment.java
+6
-1
No files found.
app/src/main/java/com/xabber/android/ui/ChatViewer.java
View file @
892510c5
...
...
@@ -62,6 +62,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
private
boolean
exitOnSend
;
private
String
extraText
=
null
;
ChatViewerAdapter
chatViewerAdapter
;
ViewPager
viewPager
;
...
...
@@ -132,8 +134,9 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
Intent
intent
=
getIntent
();
if
(
Intent
.
ACTION_SEND
.
equals
(
intent
.
getAction
()))
{
String
additional
=
intent
.
getStringExtra
(
Intent
.
EXTRA_TEXT
);
if
(
additional
!=
null
)
{
extraText
=
intent
.
getStringExtra
(
Intent
.
EXTRA_TEXT
);
if
(
extraText
!=
null
)
{
intent
.
removeExtra
(
Intent
.
EXTRA_TEXT
);
exitOnSend
=
true
;
}
...
...
@@ -354,6 +357,11 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
for
(
CurrentUpdatableChat
chat
:
registeredChats
)
{
if
(
chat
.
isEqual
(
actionWithAccount
,
actionWithUser
))
{
chat
.
setInputFocus
();
if
(
extraText
!=
null
)
{
chat
.
setInputText
(
extraText
);
extraText
=
null
;
}
}
}
}
...
...
@@ -362,5 +370,6 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
public
void
updateChat
(
final
boolean
incoming
);
public
boolean
isEqual
(
String
account
,
String
user
);
public
void
setInputFocus
();
public
void
setInputText
(
String
text
);
}
}
app/src/main/java/com/xabber/android/ui/ChatViewerFragment.java
View file @
892510c5
...
...
@@ -571,7 +571,7 @@ public class ChatViewerFragment extends Fragment implements ChatViewer.CurrentUp
*
* @param additional
*/
p
ublic
void
insertText
(
String
additional
)
{
p
rivate
void
insertText
(
String
additional
)
{
String
source
=
inputView
.
getText
().
toString
();
int
selection
=
inputView
.
getSelectionEnd
();
if
(
selection
==
-
1
)
...
...
@@ -605,4 +605,9 @@ public class ChatViewerFragment extends Fragment implements ChatViewer.CurrentUp
public
void
setInputFocus
()
{
inputView
.
requestFocus
();
}
@Override
public
void
setInputText
(
String
text
)
{
insertText
(
text
);
}
}
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