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
d47ff0d3
Commit
d47ff0d3
authored
May 15, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If chat opened via shortcut widget, adapter created again, "intent" chat replaced. Fix #108
parent
1d11c4b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
ChatViewer.java
app/src/main/java/com/xabber/android/ui/ChatViewer.java
+18
-0
ContactList.java
app/src/main/java/com/xabber/android/ui/ContactList.java
+1
-1
No files found.
app/src/main/java/com/xabber/android/ui/ChatViewer.java
View file @
d47ff0d3
...
...
@@ -63,6 +63,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
private
static
final
String
ACTION_ATTENTION
=
"com.xabber.android.data.ATTENTION"
;
private
static
final
String
ACTION_RECENT_CHATS
=
"com.xabber.android.data.RECENT_CHATS"
;
private
static
final
String
ACTION_SPECIFIC_CHAT
=
"com.xabber.android.data.ACTION_SPECIFIC_CHAT"
;
private
static
final
String
ACTION_SHORTCUT
=
"com.xabber.android.data.ACTION_SHORTCUT"
;
private
static
final
String
SAVED_INITIAL_ACCOUNT
=
"com.xabber.android.ui.ChatViewer.SAVED_INITIAL_ACCOUNT"
;
private
static
final
String
SAVED_INITIAL_USER
=
"com.xabber.android.ui.ChatViewer.SAVED_INITIAL_USER"
;
...
...
@@ -135,6 +136,12 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
return
intent
;
}
public
static
Intent
createShortCutIntent
(
Context
context
,
String
account
,
String
user
)
{
Intent
intent
=
createClearTopIntent
(
context
,
account
,
user
);
intent
.
setAction
(
ACTION_SHORTCUT
);
return
intent
;
}
/**
* Create intent to send message.
* <p/>
...
...
@@ -179,6 +186,10 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
restoreInstanceState
(
savedInstanceState
);
}
initChats
();
}
private
void
initChats
()
{
if
(
initialChat
!=
null
)
{
chatViewerAdapter
=
new
ChatViewerAdapter
(
getFragmentManager
(),
initialChat
,
this
);
}
else
{
...
...
@@ -223,6 +234,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
case
ACTION_SPECIFIC_CHAT:
case
ACTION_ATTENTION:
case
Intent
.
ACTION_SEND
:
case
ACTION_SHORTCUT:
isRecentChatsSelected
=
false
;
selectedChat
=
new
BaseEntity
(
getAccount
(
intent
),
getUser
(
intent
));
break
;
...
...
@@ -237,7 +249,13 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
}
setIntent
(
intent
);
getSelectedPageDataFromIntent
();
if
(
intent
.
getAction
().
equals
(
ACTION_SHORTCUT
))
{
getInitialChatFromIntent
();
initChats
();
}
}
private
void
restoreInstanceState
(
Bundle
savedInstanceState
)
{
...
...
app/src/main/java/com/xabber/android/ui/ContactList.java
View file @
d47ff0d3
...
...
@@ -548,7 +548,7 @@ public class ContactList extends ManagedActivity implements OnAccountChangedList
private
void
createShortcut
(
AbstractContact
abstractContact
)
{
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
Intent
.
EXTRA_SHORTCUT_INTENT
,
ChatViewer
.
create
ClearTop
Intent
(
this
,
intent
.
putExtra
(
Intent
.
EXTRA_SHORTCUT_INTENT
,
ChatViewer
.
create
ShortCut
Intent
(
this
,
abstractContact
.
getAccount
(),
abstractContact
.
getUser
()));
intent
.
putExtra
(
Intent
.
EXTRA_SHORTCUT_NAME
,
abstractContact
.
getName
());
Bitmap
bitmap
;
...
...
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