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
c226b6ae
Commit
c226b6ae
authored
Jun 27, 2018
by
Yash Khemchandani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Recycler View Functionality in Profile Fragment
parent
495b6932
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/ProfileFragment.java
...in/ac/iitb/gymkhana/iitbapp/fragment/ProfileFragment.java
+27
-0
No files found.
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/ProfileFragment.java
View file @
c226b6ae
...
@@ -3,6 +3,9 @@ package in.ac.iitb.gymkhana.iitbapp.fragment;
...
@@ -3,6 +3,9 @@ package in.ac.iitb.gymkhana.iitbapp.fragment;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
...
@@ -11,10 +14,16 @@ import android.widget.TextView;
...
@@ -11,10 +14,16 @@ import android.widget.TextView;
import
com.squareup.picasso.Picasso
;
import
com.squareup.picasso.Picasso
;
import
java.util.List
;
import
in.ac.iitb.gymkhana.iitbapp.Constants
;
import
in.ac.iitb.gymkhana.iitbapp.Constants
;
import
in.ac.iitb.gymkhana.iitbapp.ItemClickListener
;
import
in.ac.iitb.gymkhana.iitbapp.R
;
import
in.ac.iitb.gymkhana.iitbapp.R
;
import
in.ac.iitb.gymkhana.iitbapp.adapter.RoleAdapter
;
import
in.ac.iitb.gymkhana.iitbapp.api.RetrofitInterface
;
import
in.ac.iitb.gymkhana.iitbapp.api.RetrofitInterface
;
import
in.ac.iitb.gymkhana.iitbapp.api.ServiceGenerator
;
import
in.ac.iitb.gymkhana.iitbapp.api.ServiceGenerator
;
import
in.ac.iitb.gymkhana.iitbapp.data.Body
;
import
in.ac.iitb.gymkhana.iitbapp.data.Role
;
import
in.ac.iitb.gymkhana.iitbapp.data.User
;
import
in.ac.iitb.gymkhana.iitbapp.data.User
;
import
retrofit2.Call
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
import
retrofit2.Callback
;
...
@@ -68,6 +77,24 @@ public class ProfileFragment extends BaseFragment {
...
@@ -68,6 +77,24 @@ public class ProfileFragment extends BaseFragment {
TextView
userEmailIDTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_email_profile
);
TextView
userEmailIDTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_email_profile
);
TextView
userContactNumberTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_contact_no_profile
);
TextView
userContactNumberTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_contact_no_profile
);
final
List
<
Role
>
roleList
=
user
.
getUserRoles
();
RecyclerView
userRoleRecyclerView
=
getActivity
().
findViewById
(
R
.
id
.
role_recycler_view
);
RoleAdapter
roleAdapter
=
new
RoleAdapter
(
roleList
,
new
ItemClickListener
()
{
@Override
public
void
onItemClick
(
View
v
,
int
position
)
{
Role
role
=
roleList
.
get
(
position
);
Body
roleBody
=
role
.
getRoleBodyDetails
();
BodyFragment
bodyFragment
=
BodyFragment
.
newInstance
(
roleBody
);
FragmentTransaction
ft
=
getActivity
().
getSupportFragmentManager
().
beginTransaction
();
ft
.
replace
(
R
.
id
.
framelayout_for_fragment
,
bodyFragment
,
bodyFragment
.
getTag
());
ft
.
addToBackStack
(
bodyFragment
.
getTag
());
ft
.
commit
();
}
});
userRoleRecyclerView
.
setAdapter
(
roleAdapter
);
userRoleRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
Picasso
.
with
(
getContext
()).
load
(
user
.
getUserProfilePictureUrl
()).
into
(
userProfilePictureImageView
);
Picasso
.
with
(
getContext
()).
load
(
user
.
getUserProfilePictureUrl
()).
into
(
userProfilePictureImageView
);
userNameTextView
.
setText
(
user
.
getUserName
());
userNameTextView
.
setText
(
user
.
getUserName
());
userRollNumberTextView
.
setText
(
user
.
getUserRollNumber
());
userRollNumberTextView
.
setText
(
user
.
getUserRollNumber
());
...
...
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