mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
Document printText and its page callback
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRRekyRUhR43KbmGNXK
This commit is contained in:
1 file changed
+3
-2
@@ -434,14 +434,15 @@ private fun SessionTabs(sessions: List<TerminalSession>, active: TerminalSession
|
||||
}
|
||||
}
|
||||
|
||||
/** [text] printed (Android's print dialog: a printer or a PDF), as HyperTerminal's Print, in a monospaced font */
|
||||
/** the view of the page being printed, kept until the print job has it */
|
||||
private var printing: android.webkit.WebView? = null
|
||||
|
||||
/** [text] printed (Android's print dialog: a printer or a PDF), as HyperTerminal's Print, in a monospaced font */
|
||||
private fun printText(context: android.content.Context, name: String, text: String) {
|
||||
val w = android.webkit.WebView(context)
|
||||
// (the view kept until the print job has the page)
|
||||
printing = w
|
||||
w.webViewClient = object : android.webkit.WebViewClient() {
|
||||
/** the page ready: the print dialog opened on it */
|
||||
override fun onPageFinished(view: android.webkit.WebView, url: String?) {
|
||||
val pm = context.getSystemService(android.content.Context.PRINT_SERVICE) as android.print.PrintManager
|
||||
val job = name.ifBlank { "Terminal" }
|
||||
|
||||
Reference in new issue
Block a user