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
68a38620
Commit
68a38620
authored
Aug 04, 2018
by
Sajal Narang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add former roles to profile, fix #170
parent
94569079
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
app/src/main/java/app/insti/data/User.java
app/src/main/java/app/insti/data/User.java
+15
-2
app/src/main/java/app/insti/fragment/ProfileFragment.java
app/src/main/java/app/insti/fragment/ProfileFragment.java
+5
-0
No files found.
app/src/main/java/app/insti/data/User.java
View file @
68a38620
...
@@ -54,6 +54,9 @@ public class User {
...
@@ -54,6 +54,9 @@ public class User {
@ColumnInfo
(
name
=
"institute_roles"
)
@ColumnInfo
(
name
=
"institute_roles"
)
@SerializedName
(
"institute_roles"
)
@SerializedName
(
"institute_roles"
)
List
<
Role
>
userInstituteRoles
;
List
<
Role
>
userInstituteRoles
;
@ColumnInfo
(
name
=
"former_roles"
)
@SerializedName
(
"former_roles"
)
List
<
Role
>
userFormerRoles
;
@ColumnInfo
(
name
=
"website_url"
)
@ColumnInfo
(
name
=
"website_url"
)
@SerializedName
(
"website_url"
)
@SerializedName
(
"website_url"
)
String
userWebsiteURL
;
String
userWebsiteURL
;
...
@@ -70,7 +73,7 @@ public class User {
...
@@ -70,7 +73,7 @@ public class User {
@Ignore
@Ignore
String
currentRole
;
String
currentRole
;
public
User
(
@NonNull
String
userID
,
String
userName
,
String
userProfilePictureUrl
,
List
<
Event
>
userInterestedEvents
,
List
<
Event
>
userGoingEvents
,
String
userEmail
,
String
userRollNumber
,
String
userContactNumber
,
String
userAbout
,
List
<
Body
>
userFollowedBodies
,
List
<
String
>
userFollowedBodiesID
,
List
<
Role
>
userRoles
,
List
<
Role
>
userInstituteRoles
,
String
userWebsiteURL
,
String
userLDAPId
,
String
hostel
)
{
public
User
(
@NonNull
String
userID
,
String
userName
,
String
userProfilePictureUrl
,
List
<
Event
>
userInterestedEvents
,
List
<
Event
>
userGoingEvents
,
String
userEmail
,
String
userRollNumber
,
String
userContactNumber
,
String
userAbout
,
List
<
Body
>
userFollowedBodies
,
List
<
String
>
userFollowedBodiesID
,
List
<
Role
>
userRoles
,
List
<
Role
>
userInstituteRoles
,
List
<
Role
>
userFormerRoles
,
String
userWebsiteURL
,
String
userLDAPId
,
String
hostel
)
{
this
.
userID
=
userID
;
this
.
userID
=
userID
;
this
.
userName
=
userName
;
this
.
userName
=
userName
;
this
.
userProfilePictureUrl
=
userProfilePictureUrl
;
this
.
userProfilePictureUrl
=
userProfilePictureUrl
;
...
@@ -84,6 +87,7 @@ public class User {
...
@@ -84,6 +87,7 @@ public class User {
this
.
userFollowedBodiesID
=
userFollowedBodiesID
;
this
.
userFollowedBodiesID
=
userFollowedBodiesID
;
this
.
userRoles
=
userRoles
;
this
.
userRoles
=
userRoles
;
this
.
userInstituteRoles
=
userInstituteRoles
;
this
.
userInstituteRoles
=
userInstituteRoles
;
this
.
userFormerRoles
=
userFormerRoles
;
this
.
userWebsiteURL
=
userWebsiteURL
;
this
.
userWebsiteURL
=
userWebsiteURL
;
this
.
userLDAPId
=
userLDAPId
;
this
.
userLDAPId
=
userLDAPId
;
this
.
hostel
=
hostel
;
this
.
hostel
=
hostel
;
...
@@ -93,11 +97,12 @@ public class User {
...
@@ -93,11 +97,12 @@ public class User {
return
new
Gson
().
fromJson
(
json
,
User
.
class
);
return
new
Gson
().
fromJson
(
json
,
User
.
class
);
}
}
@NonNull
public
String
getUserID
()
{
public
String
getUserID
()
{
return
userID
;
return
userID
;
}
}
public
void
setUserID
(
String
userID
)
{
public
void
setUserID
(
@NonNull
String
userID
)
{
this
.
userID
=
userID
;
this
.
userID
=
userID
;
}
}
...
@@ -197,6 +202,14 @@ public class User {
...
@@ -197,6 +202,14 @@ public class User {
this
.
userInstituteRoles
=
userInstituteRoles
;
this
.
userInstituteRoles
=
userInstituteRoles
;
}
}
public
List
<
Role
>
getUserFormerRoles
()
{
return
userFormerRoles
;
}
public
void
setUserFormerRoles
(
List
<
Role
>
userFormerRoles
)
{
this
.
userFormerRoles
=
userFormerRoles
;
}
public
String
getUserWebsiteURL
()
{
public
String
getUserWebsiteURL
()
{
return
userWebsiteURL
;
return
userWebsiteURL
;
}
}
...
...
app/src/main/java/app/insti/fragment/ProfileFragment.java
View file @
68a38620
...
@@ -129,6 +129,11 @@ public class ProfileFragment extends BackHandledFragment {
...
@@ -129,6 +129,11 @@ public class ProfileFragment extends BackHandledFragment {
getActivity
().
findViewById
(
R
.
id
.
tab_layout
).
setVisibility
(
View
.
VISIBLE
);
getActivity
().
findViewById
(
R
.
id
.
tab_layout
).
setVisibility
(
View
.
VISIBLE
);
final
List
<
Role
>
roleList
=
user
.
getUserRoles
();
final
List
<
Role
>
roleList
=
user
.
getUserRoles
();
List
<
Role
>
formerRoleList
=
user
.
getUserFormerRoles
();
for
(
Role
role
:
formerRoleList
)
{
role
.
setRoleName
(
"Former "
+
role
.
getRoleName
());
}
roleList
.
addAll
(
formerRoleList
);
RecyclerView
userRoleRecyclerView
=
getActivity
().
findViewById
(
R
.
id
.
role_recycler_view
);
RecyclerView
userRoleRecyclerView
=
getActivity
().
findViewById
(
R
.
id
.
role_recycler_view
);
RoleAdapter
roleAdapter
=
new
RoleAdapter
(
roleList
,
new
ItemClickListener
()
{
RoleAdapter
roleAdapter
=
new
RoleAdapter
(
roleList
,
new
ItemClickListener
()
{
@Override
@Override
...
...
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