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
cdbeb2ad
Commit
cdbeb2ad
authored
Jul 01, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show placeholder if user has no profile pic
parent
a154bae7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
...c/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
+5
-1
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/adapter/UserAdapter.java
...java/in/ac/iitb/gymkhana/iitbapp/adapter/UserAdapter.java
+5
-1
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/ProfileFragment.java
...in/ac/iitb/gymkhana/iitbapp/fragment/ProfileFragment.java
+5
-1
app/src/main/res/drawable/user_placeholder.xml
app/src/main/res/drawable/user_placeholder.xml
+7
-0
No files found.
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
View file @
cdbeb2ad
...
@@ -121,7 +121,11 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
...
@@ -121,7 +121,11 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
nameTextView
.
setText
(
currentUser
.
getUserName
());
nameTextView
.
setText
(
currentUser
.
getUserName
());
rollNoTextView
.
setText
(
currentUser
.
getUserRollNumber
());
rollNoTextView
.
setText
(
currentUser
.
getUserRollNumber
());
Picasso
.
with
(
this
).
load
(
currentUser
.
getUserProfilePictureUrl
()).
into
(
profilePictureImageView
);
Picasso
.
with
(
this
)
.
load
(
currentUser
.
getUserProfilePictureUrl
())
.
resize
(
200
,
0
)
.
placeholder
(
R
.
drawable
.
user_placeholder
)
.
into
(
profilePictureImageView
);
}
}
// private void fetchNotifications() {
// private void fetchNotifications() {
...
...
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/adapter/UserAdapter.java
View file @
cdbeb2ad
...
@@ -49,7 +49,11 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
...
@@ -49,7 +49,11 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
User
user
=
userList
.
get
(
position
);
User
user
=
userList
.
get
(
position
);
holder
.
userName
.
setText
(
user
.
getUserName
());
holder
.
userName
.
setText
(
user
.
getUserName
());
holder
.
role
.
setText
(
user
.
getCurrentRole
());
holder
.
role
.
setText
(
user
.
getCurrentRole
());
Picasso
.
with
(
context
).
load
(
user
.
getUserProfilePictureUrl
()).
resize
(
150
,
0
).
into
(
holder
.
image
);
Picasso
.
with
(
context
)
.
load
(
user
.
getUserProfilePictureUrl
())
.
resize
(
150
,
0
)
.
placeholder
(
R
.
drawable
.
user_placeholder
)
.
into
(
holder
.
image
);
}
}
...
...
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/ProfileFragment.java
View file @
cdbeb2ad
...
@@ -103,7 +103,11 @@ public class ProfileFragment extends BaseFragment {
...
@@ -103,7 +103,11 @@ public class ProfileFragment extends BaseFragment {
userRoleRecyclerView
.
setAdapter
(
roleAdapter
);
userRoleRecyclerView
.
setAdapter
(
roleAdapter
);
userRoleRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
userRoleRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
Picasso
.
with
(
getContext
()).
load
(
user
.
getUserProfilePictureUrl
()).
resize
(
800
,
0
).
into
(
userProfilePictureImageView
);
Picasso
.
with
(
getContext
())
.
load
(
user
.
getUserProfilePictureUrl
())
.
resize
(
800
,
0
)
.
placeholder
(
R
.
drawable
.
user_placeholder
)
.
into
(
userProfilePictureImageView
);
final
List
<
Body
>
bodyList
=
user
.
getUserFollowedBodies
();
final
List
<
Body
>
bodyList
=
user
.
getUserFollowedBodies
();
final
List
<
Event
>
eventList
=
user
.
getUserGoingEvents
();
final
List
<
Event
>
eventList
=
user
.
getUserGoingEvents
();
...
...
app/src/main/res/drawable/user_placeholder.xml
0 → 100644
View file @
cdbeb2ad
<vector
android:height=
"24dp"
android:viewportHeight=
"2250"
android:viewportWidth=
"2250"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"#c5c5c5"
android:pathData=
"M0,1125l0,-1125 1125,0 1125,0 0,1125 0,1125 -140,0c-77,0 -140,-3 -140,-6 0,-48 -51,-287 -69,-322 -5,-9 -19,-42 -32,-72 -82,-193 -257,-378 -431,-455 -37,-17 -68,-33 -68,-36 0,-3 17,-15 38,-27 20,-11 56,-40 78,-64 222,-231 179,-606 -89,-771 -102,-63 -154,-79 -267,-79 -154,-1 -248,38 -355,146 -82,83 -119,153 -141,264 -37,187 49,393 209,502 20,14 37,28 37,31 0,4 -20,14 -45,23 -73,28 -195,114 -264,184 -112,117 -177,228 -231,391 -25,76 -34,115 -56,259l-5,32 -139,0 -140,0 0,-1125z"
android:strokeColor=
"#00000000"
/>
<path
android:fillColor=
"#fefefe"
android:pathData=
"M286,2208c32,-228 86,-375 194,-533 77,-111 244,-248 355,-291 25,-9 45,-19 45,-23 0,-3 -17,-17 -37,-31 -160,-109 -246,-315 -209,-502 22,-111 59,-181 141,-264 107,-108 201,-147 355,-146 113,0 165,16 267,79 195,120 281,365 205,584 -36,103 -117,207 -194,251 -21,12 -38,24 -38,27 0,3 31,19 68,36 174,77 349,262 431,455 13,30 27,63 32,72 18,35 69,274 69,322 0,3 -380,6 -845,6l-845,0 6,-42z"
android:strokeColor=
"#00000000"
/>
</vector>
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