Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.example.gutenbergkit

import android.content.Intent
import android.os.Bundle
import android.view.ViewGroup
import android.webkit.WebView
import android.content.pm.ApplicationInfo
import androidx.activity.ComponentActivity
Expand Down Expand Up @@ -209,6 +210,12 @@ fun EditorScreen(
AndroidView(
factory = { context ->
GutenbergView(context).apply {
// Explicitly set layoutParams to MATCH_PARENT to ensure proper
// viewport dimension communication to the WebView for CSS units.
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
gutenbergViewRef = this
setModalDialogStateListener(object : GutenbergView.ModalDialogStateListener {
override fun onModalDialogOpened(dialogType: String) {
Expand Down