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
3c4771b5
Commit
3c4771b5
authored
Sep 30, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select item in menu on opening from FCM
parent
9a3193a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
app/src/main/java/app/insti/activity/MainActivity.java
app/src/main/java/app/insti/activity/MainActivity.java
+14
-6
No files found.
app/src/main/java/app/insti/activity/MainActivity.java
View file @
3c4771b5
...
@@ -96,6 +96,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
...
@@ -96,6 +96,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
private
Menu
menu
;
private
Menu
menu
;
private
RetrofitInterface
retrofitInterface
;
private
RetrofitInterface
retrofitInterface
;
/** which menu item should be checked on activity start */
private
int
initMenuChecked
=
R
.
id
.
nav_feed
;
public
RetrofitInterface
getRetrofitInterface
()
{
public
RetrofitInterface
getRetrofitInterface
()
{
return
retrofitInterface
;
return
retrofitInterface
;
}
}
...
@@ -280,17 +283,19 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
...
@@ -280,17 +283,19 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
switch
(
type
)
{
switch
(
type
)
{
case
DATA_TYPE_BODY:
case
DATA_TYPE_BODY:
openBodyFragment
(
id
);
openBodyFragment
(
id
);
break
;
return
;
case
DATA_TYPE_USER:
case
DATA_TYPE_USER:
openUserFragment
(
id
);
openUserFragment
(
id
);
break
;
return
;
case
DATA_TYPE_EVENT:
case
DATA_TYPE_EVENT:
openEventFragment
(
id
);
openEventFragment
(
id
);
break
;
return
;
case
DATA_TYPE_NEWS:
case
DATA_TYPE_NEWS:
initMenuChecked
=
R
.
id
.
nav_news
;
updateFragment
(
new
NewsFragment
());
updateFragment
(
new
NewsFragment
());
break
;
return
;
}
}
Log
.
e
(
"NOTIFICATIONS"
,
"Server sent invalid notification?"
);
}
}
/** Open the proper fragment from given type, id and extra */
/** Open the proper fragment from given type, id and extra */
...
@@ -301,12 +306,15 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
...
@@ -301,12 +306,15 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
switch
(
type
)
{
switch
(
type
)
{
case
DATA_TYPE_PT:
case
DATA_TYPE_PT:
if
(
extra
.
contains
(
"/trainingblog"
))
{
if
(
extra
.
contains
(
"/trainingblog"
))
{
initMenuChecked
=
R
.
id
.
nav_training_blog
;
openTrainingBlog
();
openTrainingBlog
();
}
else
{
}
else
{
initMenuChecked
=
R
.
id
.
nav_placement_blog
;
openPlacementBlog
();
openPlacementBlog
();
}
}
break
;
return
;
}
}
chooseIntent
(
type
,
id
);
}
}
}
}
...
@@ -409,7 +417,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
...
@@ -409,7 +417,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
private
void
initNavigationView
()
{
private
void
initNavigationView
()
{
NavigationView
navigationView
=
(
NavigationView
)
findViewById
(
R
.
id
.
nav_view
);
NavigationView
navigationView
=
(
NavigationView
)
findViewById
(
R
.
id
.
nav_view
);
navigationView
.
setNavigationItemSelectedListener
(
this
);
navigationView
.
setNavigationItemSelectedListener
(
this
);
navigationView
.
setCheckedItem
(
R
.
id
.
nav_fe
ed
);
navigationView
.
setCheckedItem
(
initMenuCheck
ed
);
}
}
private
void
updateNavigationView
()
{
private
void
updateNavigationView
()
{
...
...
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