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
f2514d30
Commit
f2514d30
authored
Mar 19, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ContactViewerFragment: resources displaying changed.
parent
6f1f3ec8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
23 deletions
+42
-23
ContactViewerFragment.java
...ain/java/com/xabber/android/ui/ContactViewerFragment.java
+18
-8
contact_info_item.xml
app/src/main/res/layout/contact_info_item.xml
+22
-15
contact_viewer.xml
app/src/main/res/values-ru/contact_viewer.xml
+1
-0
contact_viewer.xml
app/src/main/res/values/contact_viewer.xml
+1
-0
No files found.
app/src/main/java/com/xabber/android/ui/ContactViewerFragment.java
View file @
f2514d30
...
@@ -111,12 +111,19 @@ public class ContactViewerFragment extends Fragment {
...
@@ -111,12 +111,19 @@ public class ContactViewerFragment extends Fragment {
}
}
}
}
String
label
=
getString
(
R
.
string
.
account_priority
)
+
": "
+
resourceItem
.
getPriority
();
String
priority
=
getString
(
R
.
string
.
account_priority
)
+
": "
+
resourceItem
.
getPriority
();
String
label
=
""
;
if
(!
client
.
isEmpty
())
{
if
(!
client
.
isEmpty
())
{
label
=
label
+
", "
+
client
;
label
=
getString
(
R
.
string
.
contact_viewer_client
)
+
": "
+
client
+
", "
;
}
}
label
+=
" "
+
resourceItem
.
getVerbose
();
label
+=
priority
;
String
resource
=
getString
(
R
.
string
.
account_resource
)
+
": "
+
resourceItem
.
getVerbose
();
String
status
=
resourceItem
.
getStatusText
().
trim
();
String
status
=
resourceItem
.
getStatusText
().
trim
();
if
(
status
.
isEmpty
())
{
if
(
status
.
isEmpty
())
{
...
@@ -127,8 +134,11 @@ public class ContactViewerFragment extends Fragment {
...
@@ -127,8 +134,11 @@ public class ContactViewerFragment extends Fragment {
View
contactInfoItem
=
inflater
.
inflate
(
R
.
layout
.
contact_info_item
,
xmppItems
,
false
);
View
contactInfoItem
=
inflater
.
inflate
(
R
.
layout
.
contact_info_item
,
xmppItems
,
false
);
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_name
)).
setText
(
label
);
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_secondary
)).
setText
(
label
);
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_value
)).
setText
(
status
);
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_main
)).
setText
(
status
);
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_secondary_second_line
)).
setText
(
resource
);
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_secondary_second_line
).
setVisibility
(
View
.
VISIBLE
);
ImageView
statusIcon
=
(
ImageView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_right_icon
);
ImageView
statusIcon
=
(
ImageView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_right_icon
);
statusIcon
.
setVisibility
(
View
.
VISIBLE
);
statusIcon
.
setVisibility
(
View
.
VISIBLE
);
...
@@ -308,11 +318,11 @@ public class ContactViewerFragment extends Fragment {
...
@@ -308,11 +318,11 @@ public class ContactViewerFragment extends Fragment {
View
contactInfoItem
=
inflater
.
inflate
(
R
.
layout
.
contact_info_item
,
rootView
,
false
);
View
contactInfoItem
=
inflater
.
inflate
(
R
.
layout
.
contact_info_item
,
rootView
,
false
);
if
(
label
==
null
||
label
.
trim
().
isEmpty
())
{
if
(
label
==
null
||
label
.
trim
().
isEmpty
())
{
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_
name
).
setVisibility
(
View
.
GONE
);
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_
secondary
).
setVisibility
(
View
.
GONE
);
}
else
{
}
else
{
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_
name
)).
setText
(
label
);
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_
secondary
)).
setText
(
label
);
}
}
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_
value
)).
setText
(
value
);
((
TextView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_item_
main
)).
setText
(
value
);
if
(
iconResource
!=
null
)
{
if
(
iconResource
!=
null
)
{
((
ImageView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_group_icon
)).
setImageResource
(
iconResource
);
((
ImageView
)
contactInfoItem
.
findViewById
(
R
.
id
.
contact_info_group_icon
)).
setImageResource
(
iconResource
);
...
...
app/src/main/res/layout/contact_info_item.xml
View file @
f2514d30
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:minHeight=
"72dp"
android:minHeight=
"72dp"
android:paddingRight=
"16dp"
android:paddingEnd=
"16dp"
>
>
...
@@ -14,18 +12,20 @@
...
@@ -14,18 +12,20 @@
android:layout_width=
"24dp"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_height=
"24dp"
android:layout_marginLeft=
"16dp"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"32dp"
android:layout_marginTop=
"24dp"
android:layout_marginTop=
"24dp"
/>
/>
<LinearLayout
<LinearLayout
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"72dp"
android:layout_marginTop=
"8dp"
android:layout_marginTop=
"8dp"
android:layout_marginBottom=
"8dp"
android:layout_marginBottom=
"8dp"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"72dp"
>
android:layout_weight=
"1"
android:layout_marginRight=
"16dp"
>
<TextView
<TextView
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
android:textColor=
"?android:attr/textColorPrimary"
android:textColor=
"?android:attr/textColorPrimary"
android:text=
"(650) 555-1234"
android:text=
"(650) 555-1234"
android:id=
"@+id/contact_info_item_
value
"
android:id=
"@+id/contact_info_item_
main
"
android:textSize=
"@dimen/abc_text_size_medium_material"
/>
android:textSize=
"@dimen/abc_text_size_medium_material"
/>
<TextView
<TextView
...
@@ -44,17 +44,24 @@
...
@@ -44,17 +44,24 @@
android:singleLine=
"true"
android:singleLine=
"true"
android:text=
"Mobile"
android:text=
"Mobile"
android:id=
"@+id/contact_info_item_name"
/>
android:id=
"@+id/contact_info_item_secondary"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"?android:attr/textColorSecondary"
android:singleLine=
"true"
android:text=
"Mobile"
android:visibility=
"gone"
android:id=
"@+id/contact_info_item_secondary_second_line"
/>
</LinearLayout>
</LinearLayout>
<ImageView
<ImageView
android:id=
"@+id/contact_info_right_icon"
android:id=
"@+id/contact_info_right_icon"
android:layout_width=
"wrap_content"
android:layout_width=
"24dp"
android:layout_height=
"wrap_content"
android:layout_height=
"24dp"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_vertical"
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
android:visibility=
"gone"
android:visibility=
"gone"
android:layout_marginRight=
"16dp"
/>
/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
\ No newline at end of file
app/src/main/res/values-ru/contact_viewer.xml
View file @
f2514d30
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
<string
name=
"contact_viewer_resources"
>
Ресурсы
</string>
<string
name=
"contact_viewer_resources"
>
Ресурсы
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<string
name=
"contact_viewer_resource_summary"
>
Ресурс: %1$s\nПриоритет: %2$d\nКлиент: %3$s
</string>
<string
name=
"contact_viewer_resource_summary"
>
Ресурс: %1$s\nПриоритет: %2$d\nКлиент: %3$s
</string>
<string
name=
"contact_viewer_client"
>
Клиент
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<string
name=
"contact_viewer_client_info"
>
%1$s, тип: %2$s
</string>
<string
name=
"contact_viewer_client_info"
>
%1$s, тип: %2$s
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_personal.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_personal.png -->
...
...
app/src/main/res/values/contact_viewer.xml
View file @
f2514d30
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
<string
name=
"contact_viewer_resources"
>
Resources
</string>
<string
name=
"contact_viewer_resources"
>
Resources
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<string
name=
"contact_viewer_resource_summary"
>
Resource: %1$s\nPriority: %2$d\nClient: %3$s
</string>
<string
name=
"contact_viewer_resource_summary"
>
Resource: %1$s\nPriority: %2$d\nClient: %3$s
</string>
<string
name=
"contact_viewer_client"
>
Client
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_xmpp.png -->
<string
name=
"contact_viewer_client_info"
>
%1$s, type: %2$s
</string>
<string
name=
"contact_viewer_client_info"
>
%1$s, type: %2$s
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_personal.png -->
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/contact_viewer_personal.png -->
...
...
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