Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.Memories.NoActionBar"
android:configChanges="orientation|screenSize">
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|density|screenSize|smallestScreenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
14 changes: 9 additions & 5 deletions android/app/src/main/java/gallery/memories/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(binding.root)

// Set fullscreen mode if in landscape
val orientation = resources.configuration.orientation
setFullscreen(orientation == Configuration.ORIENTATION_LANDSCAPE)

// Restore last known look
restoreTheme()

Expand All @@ -99,9 +103,9 @@ class MainActivity : AppCompatActivity() {

override fun onDestroy() {
super.onDestroy()
binding.webview.removeAllViews();
binding.webview.removeAllViews()
binding.coordinator.removeAllViews()
binding.webview.destroy();
binding.webview.destroy()
nativex.destroy()
}

Expand Down Expand Up @@ -132,7 +136,7 @@ class MainActivity : AppCompatActivity() {
}

override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (event.action == KeyEvent.ACTION_DOWN) {
when (keyCode) {
KeyEvent.KEYCODE_BACK -> {
if (binding.webview.canGoBack()) {
Expand Down Expand Up @@ -268,7 +272,7 @@ class MainActivity : AppCompatActivity() {
if (BuildConfig.DEBUG) {
Toast.makeText(this, "Debugging enabled", Toast.LENGTH_SHORT).show()
binding.webview.clearCache(true)
WebView.setWebContentsDebuggingEnabled(true);
WebView.setWebContentsDebuggingEnabled(true)
}

// Welcome page or actual app
Expand All @@ -288,7 +292,7 @@ class MainActivity : AppCompatActivity() {
if (host != null) return true

// Load welcome page
binding.webview.loadUrl("file:///android_asset/welcome.html");
binding.webview.loadUrl("file:///android_asset/welcome.html")
return false
}

Expand Down