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
2627a460
Commit
2627a460
authored
Mar 20, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ContactViewerFragment: edit text contact name in toolbar removed and replaced by simple text view.
parent
f9d4c9a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
39 deletions
+5
-39
ContactViewerFragment.java
...ain/java/com/xabber/android/ui/ContactViewerFragment.java
+5
-25
expandable_contact_title_activity.xml
...src/main/res/layout/expandable_contact_title_activity.xml
+0
-14
No files found.
app/src/main/java/com/xabber/android/ui/ContactViewerFragment.java
View file @
2627a460
...
...
@@ -17,6 +17,7 @@ import com.xabber.android.data.Application;
import
com.xabber.android.data.NetworkException
;
import
com.xabber.android.data.extension.capability.CapabilitiesManager
;
import
com.xabber.android.data.extension.capability.ClientInfo
;
import
com.xabber.android.data.roster.AbstractContact
;
import
com.xabber.android.data.roster.PresenceManager
;
import
com.xabber.android.data.roster.ResourceItem
;
import
com.xabber.android.data.roster.RosterContact
;
...
...
@@ -43,7 +44,7 @@ public class ContactViewerFragment extends Fragment {
String
account
;
String
bareAddress
;
private
EditText
contactNameEditText
;
private
TextView
contactNameView
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -64,25 +65,11 @@ public class ContactViewerFragment extends Fragment {
contactTitleView
.
findViewById
(
R
.
id
.
status_icon
).
setVisibility
(
View
.
GONE
);
contactTitleView
.
findViewById
(
R
.
id
.
status_text
).
setVisibility
(
View
.
GONE
);
contactTitleView
.
findViewById
(
R
.
id
.
name
).
setVisibility
(
View
.
GONE
);
contactNameEditText
=
(
EditText
)
contactTitleView
.
findViewById
(
R
.
id
.
contact_name_edit
);
contactNameEditText
.
setVisibility
(
View
.
VISIBLE
);
contactNameView
=
(
TextView
)
contactTitleView
.
findViewById
(
R
.
id
.
name
);
return
view
;
}
@Override
public
void
onPause
()
{
super
.
onPause
();
try
{
String
name
=
contactNameEditText
.
getText
().
toString
();
RosterManager
.
getInstance
().
setName
(
account
,
bareAddress
,
name
);
}
catch
(
NetworkException
e
)
{
Application
.
getInstance
().
onError
(
e
);
}
}
/**
* @param source
* @param value
...
...
@@ -101,6 +88,8 @@ public class ContactViewerFragment extends Fragment {
this
.
account
=
account
;
this
.
bareAddress
=
bareAddress
;
contactNameView
.
setText
(
RosterManager
.
getInstance
().
getBestContact
(
account
,
bareAddress
).
getName
());
xmppItems
.
removeAllViews
();
View
jabberIdView
=
createItemView
(
xmppItems
,
...
...
@@ -110,15 +99,6 @@ public class ContactViewerFragment extends Fragment {
xmppItems
.
addView
(
jabberIdView
);
}
RosterContact
rosterContact
=
RosterManager
.
getInstance
().
getRosterContact
(
account
,
bareAddress
);
if
(
rosterContact
==
null
||
!
rosterContact
.
isConnected
())
{
contactNameEditText
.
setText
(
bareAddress
);
return
;
}
contactNameEditText
.
setText
(
rosterContact
.
getName
());
List
<
View
>
resourcesList
=
new
ArrayList
<>();
for
(
ResourceItem
resourceItem
...
...
app/src/main/res/layout/expandable_contact_title_activity.xml
View file @
2627a460
...
...
@@ -72,20 +72,6 @@
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:inputType=
"textPersonName"
android:textColor=
"@color/primary_text_default_material_dark"
android:text=
"Name"
android:singleLine=
"true"
android:ems=
"10"
android:id=
"@+id/contact_name_edit"
android:gravity=
"center_vertical"
android:visibility=
"gone"
android:theme=
"@style/ThemeOverlay.AppCompat.Dark.ActionBar"
/>
<TextView
android:id=
"@+id/status_text"
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