Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
b406770c
Commit
b406770c
authored
Jul 11, 2018
by
Sajal Narang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make view population independent of profile card loading
parent
1a50bc82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
app/src/main/java/app/insti/fragment/SettingsFragment.java
app/src/main/java/app/insti/fragment/SettingsFragment.java
+6
-2
No files found.
app/src/main/java/app/insti/fragment/SettingsFragment.java
View file @
b406770c
...
...
@@ -55,13 +55,15 @@ public class SettingsFragment extends Fragment {
String
userID
=
bundle
.
getString
(
Constants
.
USER_ID
);
populateViews
();
RetrofitInterface
retrofitInterface
=
ServiceGenerator
.
createService
(
RetrofitInterface
.
class
);
retrofitInterface
.
getUser
(
"sessionid="
+
getArguments
().
getString
(
Constants
.
SESSION_ID
),
userID
).
enqueue
(
new
Callback
<
User
>()
{
@Override
public
void
onResponse
(
Call
<
User
>
call
,
Response
<
User
>
response
)
{
if
(
response
.
isSuccessful
())
{
user
=
response
.
body
();
populate
Views
();
populate
UserCard
();
}
}
...
...
@@ -72,7 +74,7 @@ public class SettingsFragment extends Fragment {
});
}
private
void
populate
Views
()
{
private
void
populate
UserCard
()
{
ImageView
userProfilePictureImageView
=
getActivity
().
findViewById
(
R
.
id
.
user_card_avatar
);
TextView
userNameTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_card_name
);
...
...
@@ -82,7 +84,9 @@ public class SettingsFragment extends Fragment {
.
placeholder
(
R
.
drawable
.
user_placeholder
)
.
into
(
userProfilePictureImageView
);
userNameTextView
.
setText
(
user
.
getUserName
());
}
private
void
populateViews
()
{
Button
updateProfileButton
=
getActivity
().
findViewById
(
R
.
id
.
settings_update_profile
);
Button
feedbackButton
=
getActivity
().
findViewById
(
R
.
id
.
settings_feedback
);
Button
aboutButton
=
getActivity
().
findViewById
(
R
.
id
.
settings_about
);
...
...
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