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
1d614671
Commit
1d614671
authored
Feb 02, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ChatViewerFragment: input text state fixed.
parent
4ba3b54a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
ChatViewerFragment.java
...c/main/java/com/xabber/android/ui/ChatViewerFragment.java
+19
-8
No files found.
app/src/main/java/com/xabber/android/ui/ChatViewerFragment.java
View file @
1d614671
...
...
@@ -220,17 +220,36 @@ public class ChatViewerFragment extends Fragment implements ChatViewer.CurrentUp
((
ChatViewer
)
getActivity
()).
registerChat
(
this
);
registerForContextMenu
(
listView
);
restoreInputState
();
}
private
void
restoreInputState
()
{
skipOnTextChanges
=
true
;
inputView
.
setText
(
ChatManager
.
getInstance
().
getTypedMessage
(
account
,
user
));
inputView
.
setSelection
(
ChatManager
.
getInstance
().
getSelectionStart
(
account
,
user
),
ChatManager
.
getInstance
().
getSelectionEnd
(
account
,
user
));
skipOnTextChanges
=
false
;
}
@Override
public
void
onPause
()
{
super
.
onPause
();
saveInputState
();
((
ChatViewer
)
getActivity
()).
unregisterChat
(
this
);
unregisterForContextMenu
(
listView
);
}
public
void
saveInputState
()
{
ChatManager
.
getInstance
().
setTyped
(
account
,
user
,
inputView
.
getText
().
toString
(),
inputView
.
getSelectionStart
(),
inputView
.
getSelectionEnd
());
}
private
void
sendMessage
()
{
String
text
=
inputView
.
getText
().
toString
();
int
start
=
0
;
...
...
@@ -277,14 +296,6 @@ public class ChatViewerFragment extends Fragment implements ChatViewer.CurrentUp
private
void
updateView
()
{
final
AbstractContact
abstractContact
=
RosterManager
.
getInstance
().
getBestContact
(
account
,
user
);
skipOnTextChanges
=
true
;
inputView
.
setText
(
ChatManager
.
getInstance
().
getTypedMessage
(
account
,
user
));
inputView
.
setSelection
(
ChatManager
.
getInstance
().
getSelectionStart
(
account
,
user
),
ChatManager
.
getInstance
().
getSelectionEnd
(
account
,
user
));
skipOnTextChanges
=
false
;
ContactTitleInflater
.
updateTitle
(
titleView
,
getActivity
(),
abstractContact
);
avatarInflaterHelper
.
updateAvatar
((
ImageView
)
titleView
.
findViewById
(
R
.
id
.
avatar
),
abstractContact
);
...
...
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