Home>

#Appendix

<? xml version = "1.0" encoding = "utf-8"?>

        <TextView
            android: id = "@ + id/text_login"
            android: layout_width = "match_parent"
            android: layout_height = "wrap_content"
            android: layout_marginStart = "8dp"
            android: layout_marginTop = "8dp"
            android: layout_marginEnd = "8dp"
            android: textAlignment = "center"
            android: textSize = "20sp"
            app: layout_constraintEnd_toEndOf = "parent"
            app: layout_constraintStart_toStartOf = "parent"
            app: layout_constraintTop_toTopOf = "parent" />
            <WebView
                android: id = "@ + id/webview_login"
                android: layout_width = "match_parent"
                android: layout_height = "match_parent"
                />
</androidx.constraintlayout.widget.ConstraintLayout>

Thank you.
Please see the arrow part of the image.

Successfully deleted the top arrow menu. Although it was successful to erase it, there will be a margin.
It is difficult to understand because it is a Google homepage, but the color inside the arrow is slightly different. The Google homepage is not displayed inside the arrow. In other words, it is not WEBVIEW.

To display the entire web as shown in the figure below with the margins removed from the menu
How should I write the code? See the figure below. The web is displayed cleanly with no margins. I want to implement something like this.

Web display screen layout I want to implement

What you ’ve tried

onWindowFocusChanged (hasFocus: Boolean)
hideSystemUI
And added to MAINACTIVITY.KT and deleted the menu.

package com.hoge.spaceapprication
import android.os.Bundle
import android.util.Log
import android.view.View
import android.webkit.WebView
import android.webkit.WebViewClient
import com.google.android.material.bottomnavigation.BottomNavigationView
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
class MainActivity: AppCompatActivity () {
    var mWebView: WebView? = null
    override fun onCreate (savedInstanceState: Bundle?) {
        super.onCreate (savedInstanceState)
        setContentView (R.layout.activity_main)
        supportActionBar !!. hide ()
        val navView: BottomNavigationView = findViewById (R.id.nav_view)
        val navController = findNavController (R.id.nav_host_fragment)
        val appBarConfiguration = AppBarConfiguration (
            setOf (
                R.id.navigation_login, R.id.navigation_home, R.id.navigation_search, R.id.navigation_dashboard, R.id.navigation_notifications
            )
        )
        setupActionBarWithNavController (navController, appBarConfiguration)navView.setupWithNavController (navController)
        // val myWebView: WebView = findViewById (R.id.webview)
        // myWebView.loadUrl ("https://www.google.com")
    }
    override fun onWindowFocusChanged (hasFocus: Boolean) {
        super.onWindowFocusChanged (hasFocus)
        hideSystemUI ()
    }
    private fun hideSystemUI () {
        val decorView = window.decorView
        decorView.systemUiVisibility = (
                View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                        or View.SYSTEM_UI_FLAG_FULLSCREEN
                        or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                        or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                )
        window.decorView.setOnSystemUiVisibilityChangeListener {visibility->
            // Note that system bars will only be "visible" if none of the
            // LOW_PROFILE, HIDE_NAVIGATION, or FULLSCREEN flags are set.
            if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) {
                Log.d ("debug", "The system bars are visible")
            } else {
                Log.d ("debug", "The system bars are NOT visible")
            }
        }
    }
}