mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-21 12:36:15 -04:00
Initial commit
I cleared the project history to start fresh on the public version
This commit is contained in:
commit
d2cfce2a0e
34 changed files with 11578 additions and 0 deletions
33
app/src/main/java/me/lecaro/breakout/MainActivity.kt
Normal file
33
app/src/main/java/me/lecaro/breakout/MainActivity.kt
Normal file
|
@ -0,0 +1,33 @@
|
|||
package me.lecaro.breakout
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import android.webkit.ConsoleMessage
|
||||
import android.webkit.WebChromeClient
|
||||
import android.webkit.WebView
|
||||
class MainActivity : android.app.Activity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN
|
||||
);
|
||||
// WebView.setWebContentsDebuggingEnabled(true)
|
||||
val webView = WebView(this)
|
||||
webView.settings.javaScriptEnabled = true
|
||||
webView.settings.domStorageEnabled = true
|
||||
webView.loadUrl("file:///android_asset/index.html")
|
||||
webView.webChromeClient = object : WebChromeClient() {
|
||||
override fun onConsoleMessage(consoleMessage: ConsoleMessage): Boolean {
|
||||
Log.d(
|
||||
"WebView", "${consoleMessage.message()} -- From line " +
|
||||
"${consoleMessage.lineNumber()} of ${consoleMessage.sourceId()}"
|
||||
)
|
||||
return true
|
||||
}
|
||||
}
|
||||
setContentView(webView)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue