Options
All
  • Public
  • Public/Protected
  • All
Menu

Module floating_window

floating_window module provides the function to show floating window, check if the user has permission to show floating window, etc.

Because floating window module involves UI interaction, the function to show floating window needs to be run in UI thread, so at the start of the file you need to specify:

  • "ui-thread nodejs";:only floating window, no UI page activity
  • "ui nodejs"; :both floating window and UI page activity
  • "ui-thread";:only floating window, no UI page activity, and the file name ends with .node.js
  • "ui"; :both floating window and UI page activity, and the file name ends with .node.js
example
"ui-thread nodejs";

const { createWindow } = require("floating_window");
const window = createWindow();
window.setViewFromXml(`
  <vertical bg="#ffffff">
      <text text="Node.js: ${process.version}" textColor="#aa0000" textSize="16" width="*"/>                
  </vertical>
`);
window.show();
$autojs.keepRunning();

Index

Type aliases

KeepToEdgeType

KeepToEdgeType: "bounce" | boolean

Whether to automatically stick to the edge. If true, when dragging ends, the floating window will stick to the edge; if is "bounce", it will bounce multiple times and stick to the edge, like Auto.js Pro's floating window.

Functions

canDrawOverlays

  • canDrawOverlays(): boolean
  • Whether the app has floating window permission.

    Returns boolean

    true if the app has floating window permission, otherwise false

createWindow

manageDrawOverlays

  • manageDrawOverlays(): void
  • Jump to the page to manage floating window permission.

    Returns void

Generated using TypeDoc