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
cbac1a8e
Commit
cbac1a8e
authored
Feb 04, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some null checks
parent
ecafd9b9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
app/src/main/java/app/insti/fragment/CalendarFragment.java
app/src/main/java/app/insti/fragment/CalendarFragment.java
+2
-0
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+3
-1
app/src/main/java/app/insti/fragment/UserFragment.java
app/src/main/java/app/insti/fragment/UserFragment.java
+3
-0
No files found.
app/src/main/java/app/insti/fragment/CalendarFragment.java
View file @
cbac1a8e
...
@@ -230,6 +230,8 @@ public class CalendarFragment extends BaseFragment {
...
@@ -230,6 +230,8 @@ public class CalendarFragment extends BaseFragment {
@Override
@Override
public
void
onResponse
(
Call
<
NewsFeedResponse
>
call
,
Response
<
NewsFeedResponse
>
response
)
{
public
void
onResponse
(
Call
<
NewsFeedResponse
>
call
,
Response
<
NewsFeedResponse
>
response
)
{
if
(
response
.
isSuccessful
())
{
if
(
response
.
isSuccessful
())
{
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
// Concatenate the response
// Concatenate the response
NewsFeedResponse
newsFeedResponse
=
response
.
body
();
NewsFeedResponse
newsFeedResponse
=
response
.
body
();
List
<
Event
>
eventList
=
newsFeedResponse
.
getEvents
();
List
<
Event
>
eventList
=
newsFeedResponse
.
getEvents
();
...
...
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
cbac1a8e
...
@@ -231,7 +231,7 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -231,7 +231,7 @@ public class MapFragment extends Fragment implements TextWatcher,
@Override
@Override
public
void
onResponse
(
Call
<
List
<
Venue
>>
call
,
Response
<
List
<
Venue
>>
response
)
{
public
void
onResponse
(
Call
<
List
<
Venue
>>
call
,
Response
<
List
<
Venue
>>
response
)
{
if
(
response
.
isSuccessful
())
{
if
(
response
.
isSuccessful
())
{
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
if
(
getActivity
()
==
null
||
getView
()
==
null
||
getContext
()
==
null
)
return
;
// Setup fade animation for background
// Setup fade animation for background
int
colorFrom
=
Utils
.
getAttrColor
(
getContext
(),
R
.
attr
.
themeColor
);
int
colorFrom
=
Utils
.
getAttrColor
(
getContext
(),
R
.
attr
.
themeColor
);
...
@@ -241,6 +241,7 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -241,6 +241,7 @@ public class MapFragment extends Fragment implements TextWatcher,
colorAnimation
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
colorAnimation
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
@Override
@Override
public
void
onAnimationUpdate
(
ValueAnimator
animator
)
{
public
void
onAnimationUpdate
(
ValueAnimator
animator
)
{
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
getView
().
findViewById
(
R
.
id
.
main_container
).
setBackgroundColor
(
getView
().
findViewById
(
R
.
id
.
main_container
).
setBackgroundColor
(
(
int
)
animator
.
getAnimatedValue
()
(
int
)
animator
.
getAnimatedValue
()
);
);
...
@@ -249,6 +250,7 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -249,6 +250,7 @@ public class MapFragment extends Fragment implements TextWatcher,
colorAnimation
.
start
();
colorAnimation
.
start
();
// Show the location fab
// Show the location fab
if
(
getView
()
==
null
)
return
;
((
FloatingActionButton
)
getView
().
findViewById
(
R
.
id
.
locate_fab
)).
show
();
((
FloatingActionButton
)
getView
().
findViewById
(
R
.
id
.
locate_fab
)).
show
();
// Show the map and data
// Show the map and data
...
...
app/src/main/java/app/insti/fragment/UserFragment.java
View file @
cbac1a8e
...
@@ -116,6 +116,7 @@ public class UserFragment extends BackHandledFragment implements TransitionTarge
...
@@ -116,6 +116,7 @@ public class UserFragment extends BackHandledFragment implements TransitionTarge
@Override
@Override
public
void
onResponse
(
Call
<
User
>
call
,
Response
<
User
>
response
)
{
public
void
onResponse
(
Call
<
User
>
call
,
Response
<
User
>
response
)
{
if
(
response
.
isSuccessful
())
{
if
(
response
.
isSuccessful
())
{
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
user
=
response
.
body
();
user
=
response
.
body
();
populateViews
();
populateViews
();
getActivity
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
getActivity
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
...
@@ -145,6 +146,8 @@ public class UserFragment extends BackHandledFragment implements TransitionTarge
...
@@ -145,6 +146,8 @@ public class UserFragment extends BackHandledFragment implements TransitionTarge
}
}
private
void
populateViews
()
{
private
void
populateViews
()
{
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
userProfilePictureImageView
=
getActivity
().
findViewById
(
R
.
id
.
user_profile_picture_profile
);
userProfilePictureImageView
=
getActivity
().
findViewById
(
R
.
id
.
user_profile_picture_profile
);
TextView
userNameTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_name_profile
);
TextView
userNameTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_name_profile
);
TextView
userRollNumberTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_rollno_profile
);
TextView
userRollNumberTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_rollno_profile
);
...
...
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