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
6cc4cc51
Commit
6cc4cc51
authored
Mar 19, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ContactEditor: name editing removed.
parent
33074dd2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
39 deletions
+11
-39
RosterManager.java
...in/java/com/xabber/android/data/roster/RosterManager.java
+10
-20
ContactEditor.java
app/src/main/java/com/xabber/android/ui/ContactEditor.java
+1
-3
contact_editor.xml
app/src/main/res/layout/contact_editor.xml
+0
-16
No files found.
app/src/main/java/com/xabber/android/data/roster/RosterManager.java
View file @
6cc4cc51
...
@@ -326,30 +326,20 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
...
@@ -326,30 +326,20 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
ConnectionManager
.
getInstance
().
sendPacket
(
account
,
packet
);
ConnectionManager
.
getInstance
().
sendPacket
(
account
,
packet
);
}
}
/**
public
void
setGroups
(
String
account
,
String
bareAddress
,
Collection
<
String
>
groups
)
throws
NetworkException
{
* Requests to change contact's name and groups.
*
* @param account
* @param bareAddress
* @param name
* @param groups
* @throws NetworkException
*/
public
void
setNameAndGroup
(
String
account
,
String
bareAddress
,
String
name
,
Collection
<
String
>
groups
)
throws
NetworkException
{
RosterContact
contact
=
getRosterContact
(
account
,
bareAddress
);
RosterContact
contact
=
getRosterContact
(
account
,
bareAddress
);
if
(
contact
==
null
)
if
(
contact
==
null
)
{
throw
new
NetworkException
(
R
.
string
.
ENTRY_IS_NOT_FOUND
);
throw
new
NetworkException
(
R
.
string
.
ENTRY_IS_NOT_FOUND
);
if
(
contact
.
getRealName
().
equals
(
name
))
{
}
HashSet
<
String
>
check
=
new
HashSet
<
String
>(
contact
.
getGroupNames
());
HashSet
<
String
>
check
=
new
HashSet
<>(
contact
.
getGroupNames
());
if
(
check
.
size
()
==
groups
.
size
())
{
if
(
check
.
size
()
==
groups
.
size
())
{
check
.
removeAll
(
groups
);
check
.
removeAll
(
groups
);
if
(
check
.
isEmpty
())
if
(
check
.
isEmpty
())
return
;
return
;
}
}
}
updateRosterContact
(
account
,
bareAddress
,
name
,
groups
);
updateRosterContact
(
account
,
bareAddress
,
contact
.
getRealName
()
,
groups
);
}
}
public
void
setName
(
String
account
,
String
bareAddress
,
String
name
)
throws
NetworkException
{
public
void
setName
(
String
account
,
String
bareAddress
,
String
name
)
throws
NetworkException
{
...
...
app/src/main/java/com/xabber/android/ui/ContactEditor.java
View file @
6cc4cc51
...
@@ -76,7 +76,6 @@ public class ContactEditor extends GroupListActivity implements
...
@@ -76,7 +76,6 @@ public class ContactEditor extends GroupListActivity implements
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
((
EditText
)
findViewById
(
R
.
id
.
contact_name
)).
setText
(
RosterManager
.
getInstance
().
getName
(
account
,
user
));
Application
.
getInstance
().
addUIListener
(
OnAccountChangedListener
.
class
,
this
);
Application
.
getInstance
().
addUIListener
(
OnAccountChangedListener
.
class
,
this
);
Application
.
getInstance
().
addUIListener
(
OnContactChangedListener
.
class
,
this
);
Application
.
getInstance
().
addUIListener
(
OnContactChangedListener
.
class
,
this
);
update
();
update
();
...
@@ -88,8 +87,7 @@ public class ContactEditor extends GroupListActivity implements
...
@@ -88,8 +87,7 @@ public class ContactEditor extends GroupListActivity implements
Application
.
getInstance
().
removeUIListener
(
OnAccountChangedListener
.
class
,
this
);
Application
.
getInstance
().
removeUIListener
(
OnAccountChangedListener
.
class
,
this
);
Application
.
getInstance
().
removeUIListener
(
OnContactChangedListener
.
class
,
this
);
Application
.
getInstance
().
removeUIListener
(
OnContactChangedListener
.
class
,
this
);
try
{
try
{
String
name
=
((
EditText
)
findViewById
(
R
.
id
.
contact_name
)).
getText
().
toString
();
RosterManager
.
getInstance
().
setGroups
(
account
,
user
,
getSelected
());
RosterManager
.
getInstance
().
setNameAndGroup
(
account
,
user
,
name
,
getSelected
());
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
Application
.
getInstance
().
onError
(
e
);
Application
.
getInstance
().
onError
(
e
);
}
}
...
...
app/src/main/res/layout/contact_editor.xml
View file @
6cc4cc51
...
@@ -21,22 +21,6 @@
...
@@ -21,22 +21,6 @@
<include
layout=
"@layout/toolbar_default"
/>
<include
layout=
"@layout/toolbar_default"
/>
<TextView
android:text=
"@string/contact_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingTop=
"8dip"
android:paddingBottom=
"4dip"
android:paddingLeft=
"2dip"
android:paddingRight=
"2dip"
/>
<EditText
android:id=
"@+id/contact_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<TextView
<TextView
android:text=
"@string/contact_group"
android:text=
"@string/contact_group"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
...
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