@ -7,6 +7,9 @@ import android.app.Activity
import android.content.Context
import android.content.Context
import android.content.Intent
import android.content.Intent
import android.content.RestrictionsManager
import android.content.RestrictionsManager
import android.content.pm.ActivityInfo
import android.content.res.Configuration.SCREENLAYOUT_SIZE_LARGE
import android.content.res.Configuration.SCREENLAYOUT_SIZE_MASK
import android.net.Uri
import android.net.Uri
import android.net.VpnService
import android.net.VpnService
import android.os.Bundle
import android.os.Bundle
@ -71,9 +74,20 @@ class MainActivity : ComponentActivity() {
private const val TAG = " Main Activity "
private const val TAG = " Main Activity "
}
}
private fun Context . isLandscapeCapable ( ) : Boolean {
return ( resources . configuration . screenLayout and SCREENLAYOUT _SIZE _MASK ) >=
SCREENLAYOUT _SIZE _LARGE
}
override fun onCreate ( savedInstanceState : Bundle ? ) {
override fun onCreate ( savedInstanceState : Bundle ? ) {
super . onCreate ( savedInstanceState )
super . onCreate ( savedInstanceState )
// (jonathan) TODO: Force the app to be portrait on small screens until we have
// proper landscape layout support
if ( !is LandscapeCapable ( ) ) {
requestedOrientation = ActivityInfo . SCREEN _ORIENTATION _PORTRAIT
}
setContent {
setContent {
AppTheme {
AppTheme {
val navController = rememberNavController ( )
val navController = rememberNavController ( )