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
f805defa
Commit
f805defa
authored
Jul 01, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide irrelevant card list titles in Body Fragment
parent
375c4f61
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/BodyFragment.java
...va/in/ac/iitb/gymkhana/iitbapp/fragment/BodyFragment.java
+14
-0
app/src/main/res/layout/fragment_body.xml
app/src/main/res/layout/fragment_body.xml
+12
-0
No files found.
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/BodyFragment.java
View file @
f805defa
...
...
@@ -130,6 +130,14 @@ public class BodyFragment extends Fragment {
});
}
private
void
setVisibleIfHasElements
(
int
[]
viewIds
,
List
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
int
viewId:
viewIds
){
getActivity
().
findViewById
(
viewId
).
setVisibility
(
View
.
VISIBLE
);
}
}
}
private
void
displayBody
(
final
Body
body
)
{
TextView
bodyName
=
(
TextView
)
getView
().
findViewById
(
R
.
id
.
body_name
);
TextView
bodyDescription
=
(
TextView
)
getView
().
findViewById
(
R
.
id
.
body_description
);
...
...
@@ -138,6 +146,12 @@ public class BodyFragment extends Fragment {
ImageButton
shareBodyButton
=
getActivity
().
findViewById
(
R
.
id
.
share_body_button
);
final
Button
followButton
=
getActivity
().
findViewById
(
R
.
id
.
follow_button
);
/* Show relevant card titles */
setVisibleIfHasElements
(
new
int
[]{
R
.
id
.
body_events_title
,
R
.
id
.
event_card_recycler_view
},
body
.
getBodyEvents
());
setVisibleIfHasElements
(
new
int
[]{
R
.
id
.
body_orgs_title
,
R
.
id
.
org_card_recycler_view
},
body
.
getBodyChildren
());
setVisibleIfHasElements
(
new
int
[]{
R
.
id
.
body_parents_title
,
R
.
id
.
parentorg_card_recycler_view
},
body
.
getBodyParents
());
setVisibleIfHasElements
(
new
int
[]{
R
.
id
.
body_people_title
,
R
.
id
.
people_card_recycler_view
},
body
.
getBodyRoles
());
/* Set body information */
bodyName
.
setText
(
body
.
getBodyName
());
Picasso
.
with
(
getContext
()).
load
(
body
.
getBodyImageURL
()).
into
(
eventPicture
);
...
...
app/src/main/res/layout/fragment_body.xml
View file @
f805defa
...
...
@@ -127,6 +127,8 @@
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/body_events_title"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
...
...
@@ -136,12 +138,15 @@
<android.support.v7.widget.RecyclerView
android:id=
"@+id/event_card_recycler_view"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:nestedScrollingEnabled=
"false"
/>
<TextView
android:id=
"@+id/body_orgs_title"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
...
...
@@ -151,12 +156,15 @@
<android.support.v7.widget.RecyclerView
android:id=
"@+id/org_card_recycler_view"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:nestedScrollingEnabled=
"false"
/>
<TextView
android:id=
"@+id/body_people_title"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
...
...
@@ -166,12 +174,15 @@
<android.support.v7.widget.RecyclerView
android:id=
"@+id/people_card_recycler_view"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:nestedScrollingEnabled=
"false"
/>
<TextView
android:id=
"@+id/body_parents_title"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
...
...
@@ -181,6 +192,7 @@
<android.support.v7.widget.RecyclerView
android:id=
"@+id/parentorg_card_recycler_view"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
...
...
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