Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
labs
Tablexia-old
Commits
1ff18f40
Commit
1ff18f40
authored
Nov 24, 2014
by
v.tarantik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of gitlab.labs.nic.cz:labs/tablexia into devel
parents
9d3a9da1
89172b6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
src/main/java/cz/nic/tablexia/menu/mainmenu/screen/GameMenu.java
...n/java/cz/nic/tablexia/menu/mainmenu/screen/GameMenu.java
+20
-8
No files found.
src/main/java/cz/nic/tablexia/menu/mainmenu/screen/GameMenu.java
View file @
1ff18f40
...
...
@@ -102,6 +102,16 @@ public class GameMenu extends AbstractMenuFragment implements OnPageChangeListen
ambientStopped
=
true
;
}
};
SightSeeingBroadcastReceiver
receiver
=
new
SightSeeingBroadcastReceiver
()
{
@Override
protected
void
onNewUserBroadcastReceivedAction
()
{
if
(
gamesPager
!=
null
)
{
gamesPager
.
setCurrentItem
(
gamesPager
.
getAdapter
().
getCount
()
-
1
,
false
);
}
}
};
/* //////////////////////////////////////////// TABLEXIA FRAGMENT LIFECYCLE */
...
...
@@ -121,14 +131,7 @@ public class GameMenu extends AbstractMenuFragment implements OnPageChangeListen
if
((
u
==
null
)
||
!
u
.
isSightseeingShown
())
{
gamesPager
.
setCurrentItem
(
gamesPager
.
getAdapter
().
getCount
()
-
1
,
false
);
}
SightSeeingBroadcastReceiver
receiver
=
new
SightSeeingBroadcastReceiver
()
{
@Override
protected
void
onNewUserBroadcastReceivedAction
()
{
gamesPager
.
setCurrentItem
(
gamesPager
.
getAdapter
().
getCount
()
-
1
,
false
);
}
};
IntentFilter
filter
=
new
IntentFilter
(
"cz.nic.tablexia.action.NEW_USER_CREATED"
);
LocalBroadcastManager
.
getInstance
(
getActivity
()).
registerReceiver
(
receiver
,
filter
);
...
...
@@ -180,6 +183,8 @@ public class GameMenu extends AbstractMenuFragment implements OnPageChangeListen
gamesPager
.
setOnPageChangeListener
(
this
);
goToPage
(
selectedPageNumber
,
false
);
}
/* //////////////////////////////////////////// ANDROID FRAGMENT LIFECYCLE */
@Override
public
void
onBackPressed
()
{
...
...
@@ -190,6 +195,13 @@ public class GameMenu extends AbstractMenuFragment implements OnPageChangeListen
}
}
}
@Override
public
void
onDestroy
()
{
LocalBroadcastManager
.
getInstance
(
getActivity
()).
unregisterReceiver
(
receiver
);
LocalBroadcastManager
.
getInstance
(
getActivity
()).
unregisterReceiver
(
receiverAmbient
);
super
.
onDestroy
();
}
/* //////////////////////////////////////////// INTRO ANIMATION */
...
...
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