Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Swordfish90 committed May 29, 2021
2 parents 70bd2a1 + e712504 commit 3ff418d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lemuroid-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

android {
defaultConfig {
versionCode = 147
versionCode = 148
versionName = "1.11.1"
applicationId = "com.swordfish.lemuroid"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class GameActivity : BaseGameActivity() {

tiltSensor = TiltSensor(applicationContext)

serviceController = GameService.startService(applicationContext, game)
startGameService()

setupVirtualGamePadVisibility()
setupVirtualGamePads()
Expand Down Expand Up @@ -286,11 +286,24 @@ class GameActivity : BaseGameActivity() {
}

override fun onDestroy() {
serviceController = GameService.stopService(applicationContext, serviceController)
stopGameService()
virtualControllerDisposables.clear()
super.onDestroy()
}

private fun startGameService() {
serviceController = GameService.startService(applicationContext, game)
}

private fun stopGameService() {
serviceController = GameService.stopService(applicationContext, serviceController)
}

override fun onFinishTriggered() {
super.onFinishTriggered()
stopGameService()
}

private fun getGamePadTheme(context: Context): RadialGamePadTheme {
val accentColor = GraphicsUtils.colorToRgb(context.getColor(R.color.colorPrimary))
val alpha = (255 * PRESSED_COLOR_ALPHA).roundToInt()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ abstract class BaseGameActivity : ImmersiveActivity() {
}

private fun finishAndExitProcess() {
onFinishTriggered()
GlobalScope.launch {
sleep(animationDuration().toLong())
exitProcess(0)
Expand All @@ -689,6 +690,8 @@ abstract class BaseGameActivity : ImmersiveActivity() {
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
}

open fun onFinishTriggered() { }

private fun cancelBackgroundWork() {
SaveSyncWork.cancelAutoWork(applicationContext)
SaveSyncWork.cancelManualWork(applicationContext)
Expand Down

0 comments on commit 3ff418d

Please sign in to comment.