-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11bde04
commit 11b1436
Showing
24 changed files
with
364 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ru.hyst329.openfool | ||
|
||
import android.os.Bundle | ||
import com.badlogic.gdx.backends.android.AndroidApplication | ||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration | ||
|
||
class AndroidLauncher : AndroidApplication() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
val config = AndroidApplicationConfiguration() | ||
config.useAccelerometer = false | ||
config.useCompass = false | ||
initialize(OpenFoolGame(AndroidOrientationHelper(this)), config) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
android/src/ru/hyst329/openfool/AndroidOrientationHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ru.hyst329.openfool | ||
|
||
import OrientationHelper | ||
import android.app.Activity | ||
import android.content.pm.ActivityInfo | ||
|
||
class AndroidOrientationHelper(val activity: Activity) : OrientationHelper { | ||
override fun requestOrientation(orientation: OrientationHelper.Orientation?): Boolean { | ||
this.orientation = orientation | ||
//return when (orientation) { | ||
if (orientation == OrientationHelper.Orientation.LANDSCAPE) { | ||
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE | ||
return true | ||
} | ||
if (orientation == OrientationHelper.Orientation.PORTRAIT) { | ||
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT | ||
return true | ||
} | ||
else { | ||
return false | ||
} | ||
//} | ||
} | ||
|
||
override var orientation: OrientationHelper.Orientation? = OrientationHelper.Orientation.LANDSCAPE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.