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
73bc5380
Commit
73bc5380
authored
Jul 30, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ContactVcardViewerFragment: progress bar added.
parent
3a4aac38
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
ContactVcardViewerFragment.java
...ava/com/xabber/android/ui/ContactVcardViewerFragment.java
+10
-3
contact_vcard_viewer_fragment.xml
app/src/main/res/layout/contact_vcard_viewer_fragment.xml
+7
-0
No files found.
app/src/main/java/com/xabber/android/ui/ContactVcardViewerFragment.java
View file @
73bc5380
...
...
@@ -52,6 +52,7 @@ public class ContactVcardViewerFragment extends Fragment implements OnContactCha
private
LinearLayout
contactInfoItems
;
private
VCard
vCard
;
private
boolean
vCardError
;
private
View
progressBar
;
public
static
ContactVcardViewerFragment
newInstance
(
String
account
,
String
user
)
{
ContactVcardViewerFragment
fragment
=
new
ContactVcardViewerFragment
();
...
...
@@ -108,6 +109,7 @@ public class ContactVcardViewerFragment extends Fragment implements OnContactCha
xmppItems
=
(
LinearLayout
)
view
.
findViewById
(
R
.
id
.
xmpp_items
);
contactInfoItems
=
(
LinearLayout
)
view
.
findViewById
(
R
.
id
.
contact_info_items
);
progressBar
=
view
.
findViewById
(
R
.
id
.
contact_info_progress_bar
);
return
view
;
}
...
...
@@ -118,13 +120,16 @@ public class ContactVcardViewerFragment extends Fragment implements OnContactCha
Application
.
getInstance
().
addUIListener
(
OnVCardListener
.
class
,
this
);
Application
.
getInstance
().
addUIListener
(
OnContactChangedListener
.
class
,
this
);
Application
.
getInstance
().
addUIListener
(
OnAccountChangedListener
.
class
,
this
);
if
(
vCard
==
null
&&
!
vCardError
)
{
VCardManager
.
getInstance
().
request
(
account
,
user
);
}
updateContact
(
account
,
user
);
if
(
vCard
==
null
&&
!
vCardError
)
{
progressBar
.
setVisibility
(
View
.
VISIBLE
);
VCardManager
.
getInstance
().
request
(
account
,
user
);
}
else
{
updateVCard
(
vCard
);
}
}
@Override
public
void
onPause
()
{
...
...
@@ -151,6 +156,7 @@ public class ContactVcardViewerFragment extends Fragment implements OnContactCha
this
.
vCard
=
vCard
;
this
.
vCardError
=
false
;
updateVCard
(
vCard
);
progressBar
.
setVisibility
(
View
.
GONE
);
}
@Override
...
...
@@ -160,6 +166,7 @@ public class ContactVcardViewerFragment extends Fragment implements OnContactCha
}
this
.
vCard
=
null
;
this
.
vCardError
=
true
;
progressBar
.
setVisibility
(
View
.
GONE
);
Application
.
getInstance
().
onError
(
R
.
string
.
XMPP_EXCEPTION
);
}
...
...
app/src/main/res/layout/contact_vcard_viewer_fragment.xml
View file @
73bc5380
...
...
@@ -14,6 +14,13 @@
android:orientation=
"vertical"
/>
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/contact_info_progress_bar"
android:visibility=
"gone"
android:layout_gravity=
"center_horizontal"
/>
<LinearLayout
android:id=
"@+id/contact_info_items"
android:layout_width=
"match_parent"
...
...
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