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
33bd4e4a
Commit
33bd4e4a
authored
Nov 30, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change NotificationsFragment to BottomSheetDialogFragment (fix #223)
parent
21c7f971
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
app/src/main/java/app/insti/activity/MainActivity.java
app/src/main/java/app/insti/activity/MainActivity.java
+1
-1
app/src/main/java/app/insti/fragment/NotificationsFragment.java
...c/main/java/app/insti/fragment/NotificationsFragment.java
+5
-4
No files found.
app/src/main/java/app/insti/activity/MainActivity.java
View file @
33bd4e4a
...
...
@@ -531,7 +531,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
if
(
id
==
R
.
id
.
action_notifications
)
{
NotificationsFragment
notificationsFragment
=
new
NotificationsFragment
();
updateFragment
(
notificationsFragment
);
notificationsFragment
.
show
(
getSupportFragmentManager
(),
TAG
);
return
true
;
}
return
super
.
onOptionsItemSelected
(
item
);
...
...
app/src/main/java/app/insti/fragment/NotificationsFragment.java
View file @
33bd4e4a
...
...
@@ -2,6 +2,7 @@ package app.insti.fragment;
import
android.os.Bundle
;
import
android.support.design.widget.BottomSheetDialogFragment
;
import
android.support.v4.app.Fragment
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
...
...
@@ -24,7 +25,7 @@ import retrofit2.Response;
/**
* A simple {@link Fragment} subclass.
*/
public
class
NotificationsFragment
extends
B
ase
Fragment
{
public
class
NotificationsFragment
extends
B
ottomSheetDialog
Fragment
{
RecyclerView
notificationsRecyclerView
;
...
...
@@ -67,13 +68,13 @@ public class NotificationsFragment extends BaseFragment {
private
void
showNotifications
(
final
List
<
Notification
>
notifications
)
{
/* Check if activity is done with */
if
(
getActivity
()
==
null
)
return
;
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
/* Hide loader */
get
Activity
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
get
View
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
NotificationsAdapter
notificationsAdapter
=
new
NotificationsAdapter
(
notifications
,
this
);
notificationsRecyclerView
=
(
RecyclerView
)
get
Activity
().
findViewById
(
R
.
id
.
notifications_recycler_view
);
notificationsRecyclerView
=
(
RecyclerView
)
get
View
().
findViewById
(
R
.
id
.
notifications_recycler_view
);
notificationsRecyclerView
.
setAdapter
(
notificationsAdapter
);
notificationsRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
}
...
...
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