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
3b9a219f
Commit
3b9a219f
authored
May 27, 2013
by
Alexander Ivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate conference delete dialog.
parent
5d3e3182
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
30 deletions
+63
-30
ContactList.java
src/com/xabber/android/ui/ContactList.java
+6
-9
ContactDeleteDialogFragment.java
...xabber/android/ui/dialog/ContactDeleteDialogFragment.java
+7
-21
MUCDeleteDialogFragment.java
...com/xabber/android/ui/dialog/MUCDeleteDialogFragment.java
+50
-0
No files found.
src/com/xabber/android/ui/ContactList.java
View file @
3b9a219f
...
@@ -87,6 +87,7 @@ import com.xabber.android.ui.dialog.ContactIntegrationDialogFragment;
...
@@ -87,6 +87,7 @@ import com.xabber.android.ui.dialog.ContactIntegrationDialogFragment;
import
com.xabber.android.ui.dialog.DialogBuilder
;
import
com.xabber.android.ui.dialog.DialogBuilder
;
import
com.xabber.android.ui.dialog.GroupDeleteDialogFragment
;
import
com.xabber.android.ui.dialog.GroupDeleteDialogFragment
;
import
com.xabber.android.ui.dialog.GroupRenameDialogFragment
;
import
com.xabber.android.ui.dialog.GroupRenameDialogFragment
;
import
com.xabber.android.ui.dialog.MUCDeleteDialogFragment
;
import
com.xabber.android.ui.dialog.StartAtBootDialogFragment
;
import
com.xabber.android.ui.dialog.StartAtBootDialogFragment
;
import
com.xabber.android.ui.helper.ManagedListActivity
;
import
com.xabber.android.ui.helper.ManagedListActivity
;
import
com.xabber.androiddev.R
;
import
com.xabber.androiddev.R
;
...
@@ -485,11 +486,9 @@ public class ContactList extends ManagedListActivity implements
...
@@ -485,11 +486,9 @@ public class ContactList extends ManagedListActivity implements
@Override
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
ContactDeleteDialogFragment
.
newInstance
(
MUCDeleteDialogFragment
.
newInstance
(
account
,
user
)
account
==
GroupManager
.
NO_ACCOUNT
?
null
.
show
(
getSupportFragmentManager
(),
:
account
,
user
).
show
(
"MUC_DELETE"
);
getSupportFragmentManager
(),
"CONTACT_DELETE"
);
return
true
;
return
true
;
}
}
...
@@ -534,10 +533,8 @@ public class ContactList extends ManagedListActivity implements
...
@@ -534,10 +533,8 @@ public class ContactList extends ManagedListActivity implements
@Override
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
ContactDeleteDialogFragment
.
newInstance
(
ContactDeleteDialogFragment
.
newInstance
(
account
,
account
==
GroupManager
.
NO_ACCOUNT
?
null
user
).
show
(
getSupportFragmentManager
(),
:
account
,
user
).
show
(
getSupportFragmentManager
(),
"CONTACT_DELETE"
);
"CONTACT_DELETE"
);
return
true
;
return
true
;
}
}
...
...
src/com/xabber/android/ui/dialog/ContactDeleteDialogFragment.java
View file @
3b9a219f
...
@@ -6,9 +6,6 @@ import android.support.v4.app.DialogFragment;
...
@@ -6,9 +6,6 @@ import android.support.v4.app.DialogFragment;
import
com.xabber.android.data.Application
;
import
com.xabber.android.data.Application
;
import
com.xabber.android.data.NetworkException
;
import
com.xabber.android.data.NetworkException
;
import
com.xabber.android.data.account.AccountManager
;
import
com.xabber.android.data.account.AccountManager
;
import
com.xabber.android.data.extension.muc.MUCManager
;
import
com.xabber.android.data.message.MessageManager
;
import
com.xabber.android.data.notification.NotificationManager
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.androiddev.R
;
import
com.xabber.androiddev.R
;
...
@@ -19,7 +16,6 @@ public class ContactDeleteDialogFragment extends ConfirmDialogFragment {
...
@@ -19,7 +16,6 @@ public class ContactDeleteDialogFragment extends ConfirmDialogFragment {
/**
/**
* @param account
* @param account
* can be <code>null</code> to be used for all accounts.
* @param user
* @param user
* @return
* @return
*/
*/
...
@@ -30,33 +26,23 @@ public class ContactDeleteDialogFragment extends ConfirmDialogFragment {
...
@@ -30,33 +26,23 @@ public class ContactDeleteDialogFragment extends ConfirmDialogFragment {
private
String
user
;
private
String
user
;
private
String
account
;
private
String
account
;
private
boolean
isRoom
;
@Override
@Override
protected
Builder
getBuilder
()
{
protected
Builder
getBuilder
()
{
user
=
getArguments
().
getString
(
USER
);
user
=
getArguments
().
getString
(
USER
);
account
=
getArguments
().
getString
(
ACCOUNT
);
account
=
getArguments
().
getString
(
ACCOUNT
);
isRoom
=
MUCManager
.
getInstance
().
hasRoom
(
account
,
user
);
return
new
Builder
(
getActivity
()).
setMessage
(
getString
(
return
new
Builder
(
getActivity
()).
setMessage
(
getString
(
isRoom
?
R
.
string
.
muc_delete_confirm
R
.
string
.
contact_delete_confirm
,
RosterManager
.
getInstance
()
:
R
.
string
.
contact_delete_confirm
,
RosterManager
.
getName
(
account
,
user
),
AccountManager
.
getInstance
()
.
getInstance
().
getName
(
account
,
user
),
AccountManager
.
getVerboseName
(
account
)));
.
getInstance
().
getVerboseName
(
account
)));
}
}
@Override
@Override
protected
boolean
onPositiveClick
()
{
protected
boolean
onPositiveClick
()
{
if
(
isRoom
)
{
try
{
MUCManager
.
getInstance
().
removeRoom
(
account
,
user
);
RosterManager
.
getInstance
().
removeContact
(
account
,
user
);
MessageManager
.
getInstance
().
closeChat
(
account
,
user
);
}
catch
(
NetworkException
e
)
{
NotificationManager
.
getInstance
().
removeMessageNotification
(
Application
.
getInstance
().
onError
(
e
);
account
,
user
);
}
else
{
try
{
RosterManager
.
getInstance
().
removeContact
(
account
,
user
);
}
catch
(
NetworkException
e
)
{
Application
.
getInstance
().
onError
(
e
);
}
}
}
return
true
;
return
true
;
}
}
...
...
src/com/xabber/android/ui/dialog/MUCDeleteDialogFragment.java
0 → 100644
View file @
3b9a219f
package
com
.
xabber
.
android
.
ui
.
dialog
;
import
android.app.AlertDialog.Builder
;
import
android.support.v4.app.DialogFragment
;
import
com.xabber.android.data.account.AccountManager
;
import
com.xabber.android.data.extension.muc.MUCManager
;
import
com.xabber.android.data.message.MessageManager
;
import
com.xabber.android.data.notification.NotificationManager
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.androiddev.R
;
public
class
MUCDeleteDialogFragment
extends
ConfirmDialogFragment
{
private
static
final
String
ACCOUNT
=
"ACCOUNT"
;
private
static
final
String
USER
=
"USER"
;
/**
* @param account
* @param user
* @return
*/
public
static
DialogFragment
newInstance
(
String
account
,
String
user
)
{
return
new
MUCDeleteDialogFragment
().
putAgrument
(
ACCOUNT
,
account
)
.
putAgrument
(
USER
,
user
);
}
private
String
user
;
private
String
account
;
@Override
protected
Builder
getBuilder
()
{
user
=
getArguments
().
getString
(
USER
);
account
=
getArguments
().
getString
(
ACCOUNT
);
return
new
Builder
(
getActivity
()).
setMessage
(
getString
(
R
.
string
.
muc_delete_confirm
,
RosterManager
.
getInstance
()
.
getName
(
account
,
user
),
AccountManager
.
getInstance
()
.
getVerboseName
(
account
)));
}
@Override
protected
boolean
onPositiveClick
()
{
MUCManager
.
getInstance
().
removeRoom
(
account
,
user
);
MessageManager
.
getInstance
().
closeChat
(
account
,
user
);
NotificationManager
.
getInstance
().
removeMessageNotification
(
account
,
user
);
return
true
;
}
}
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