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
ca3cfdc1
Commit
ca3cfdc1
authored
May 27, 2013
by
Alexander Ivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set contact group menu actions while ContextMenu creation.
parent
4a374d5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
35 deletions
+40
-35
ContactList.java
src/com/xabber/android/ui/ContactList.java
+40
-35
No files found.
src/com/xabber/android/ui/ContactList.java
View file @
ca3cfdc1
...
...
@@ -138,9 +138,6 @@ public class ContactList extends ManagedListActivity implements
private
static
final
int
CONTEXT_MENU_EDIT_ROOM_ID
=
0x1B
;
private
static
final
int
CONTEXT_MENU_VIEW_CONTACT_ID
=
0x1C
;
private
static
final
int
CONTEXT_MENU_GROUP_RENAME_ID
=
0x31
;
private
static
final
int
CONTEXT_MENU_GROUP_DELETE_ID
=
0x32
;
private
static
final
int
CONTEXT_MENU_SHOW_OFFLINE_GROUP_ID
=
0x40
;
private
static
final
int
DIALOG_CLOSE_APPLICATION_ID
=
0x57
;
...
...
@@ -541,22 +538,46 @@ public class ContactList extends ManagedListActivity implements
}
}
private
void
createGroupContextMenu
(
String
account
,
String
group
,
ContextMenu
menu
)
{
actionWithAccount
=
account
;
actionWithGroup
=
group
;
actionWithUser
=
null
;
menu
.
setHeaderTitle
(
GroupManager
.
getInstance
()
.
getGroupName
(
actionWithAccount
,
actionWithGroup
));
if
(
actionWithGroup
!=
GroupManager
.
ACTIVE_CHATS
&&
actionWithGroup
!=
GroupManager
.
IS_ROOM
)
{
menu
.
add
(
0
,
CONTEXT_MENU_GROUP_RENAME_ID
,
0
,
getText
(
R
.
string
.
group_rename
));
if
(
actionWithGroup
!=
GroupManager
.
NO_GROUP
)
menu
.
add
(
0
,
CONTEXT_MENU_GROUP_DELETE_ID
,
0
,
getText
(
R
.
string
.
group_remove
));
}
createOfflineModeContextMenu
(
account
,
group
,
menu
);
private
void
createGroupContextMenu
(
final
String
account
,
final
String
group
,
ContextMenu
menu
)
{
actionWithAccount
=
account
;
actionWithGroup
=
group
;
actionWithUser
=
null
;
menu
.
setHeaderTitle
(
GroupManager
.
getInstance
().
getGroupName
(
account
,
group
));
if
(
group
!=
GroupManager
.
ACTIVE_CHATS
&&
group
!=
GroupManager
.
IS_ROOM
)
{
menu
.
add
(
R
.
string
.
group_rename
).
setOnMenuItemClickListener
(
new
MenuItem
.
OnMenuItemClickListener
()
{
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
GroupRenameDialogFragment
.
newInstance
(
account
==
GroupManager
.
NO_ACCOUNT
?
null
:
account
,
group
==
GroupManager
.
NO_GROUP
?
null
:
group
)
.
show
(
getSupportFragmentManager
(),
"GROUP_RENAME"
);
return
true
;
}
});
if
(
group
!=
GroupManager
.
NO_GROUP
)
menu
.
add
(
R
.
string
.
group_remove
).
setOnMenuItemClickListener
(
new
MenuItem
.
OnMenuItemClickListener
()
{
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
GroupDeleteDialogFragment
.
newInstance
(
account
==
GroupManager
.
NO_ACCOUNT
?
null
:
account
,
group
).
show
(
getSupportFragmentManager
(),
"GROUP_DELETE"
);
return
true
;
}
});
}
createOfflineModeContextMenu
(
account
,
group
,
menu
);
}
private
void
createAccountContextMenu
(
final
String
account
,
ContextMenu
menu
)
{
...
...
@@ -722,22 +743,6 @@ public class ContactList extends ManagedListActivity implements
Application
.
getInstance
().
onError
(
e
);
}
return
true
;
// Group
case
CONTEXT_MENU_GROUP_RENAME_ID:
GroupRenameDialogFragment
.
newInstance
(
actionWithAccount
==
GroupManager
.
NO_ACCOUNT
?
null
:
actionWithAccount
,
actionWithGroup
==
GroupManager
.
NO_GROUP
?
null
:
actionWithGroup
).
show
(
getSupportFragmentManager
(),
"GROUP_RENAME"
);
return
true
;
case
CONTEXT_MENU_GROUP_DELETE_ID:
GroupDeleteDialogFragment
.
newInstance
(
actionWithAccount
==
GroupManager
.
NO_ACCOUNT
?
null
:
actionWithAccount
,
actionWithGroup
).
show
(
getSupportFragmentManager
(),
"GROUP_DELETE"
);
return
true
;
}
return
false
;
}
...
...
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