Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Simplified Usage of Custom Dialogs

Harmony OS Next Simplified Usage of Custom Dialogs Custom Dialogs (CustomDialog) are popup components provided by HarmonyOS, displayed using the CustomDialogController class. Below is a simplified usage guide: 1.…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Harmony OS Next






Simplified Usage of Custom Dialogs



Custom Dialogs (CustomDialog) are popup components provided by HarmonyOS, displayed using the CustomDialogController class. Below is a simplified usage guide:






1. Basic Concepts



Supported from API Version 7 (API Version 11 for meta-services). Allows developers to customize dialog appearance and content. Suitable for simple prompts but not a replacement for full pages.






2. Key Interfaces and Parameters





  • constructor(value: CustomDialogControllerOptions): Configures dialog parameters (all parameters are static). Includes:



    • builder: Required. Content builder (use @Link for data binding).


    • cancel: Optional. Callback for back/ESC key or overlay tap.


    • autoCancel: Optional. Default true. Enables overlay tap dismissal.


    • alignment: Optional. Vertical alignment (default: DialogAlignment.Default).


    • offset: Optional. Alignment offset (default: { dx: 0, dy: 0 }).


    • customStyle: Optional. Enables custom container styling (corners, dimensions).


    • gridCount: Optional. Grid width count (default: auto).

    • Additional parameters (maskColor, maskRect, openAnimation, closeAnimation) available from API 10/12 for finer control.











3. Usage Steps





  1. Create content builder:
    Define a struct with @CustomDialog and @Component, build content in build() method.


  2. Configure controller:
    Create CustomDialogController instance with parameters in parent component.


  3. Open/close dialog:
    Use controller's open() and close() methods triggered by events.






4. Example Code Breakdown






```typescript
// Second dialog structure
@CustomDialog
struct CustomDialogExampleTwo {
controllerTwo?: CustomDialogController
build() {
Column() {
Text('I am the second dialog')
.fontSize(30)
.height(100)
Button('Close this dialog')
.onClick(() => {
if (this.controllerTwo) this.controllerTwo.close()
})
.margin(20)
}
}
}

// First dialog (contains second dialog's controller)
@CustomDialog
@Component
struct CustomDialogExample {
@Link textValue: string
@Link inputValue: string
dialogControllerTwo: CustomDialogController | null = new CustomDialogController({
builder: CustomDialogExampleTwo(),
alignment: DialogAlignment.Bottom,
onWillDismiss:(action: DismissDialogAction)=> {
console.log("Dismiss reason: " + action.reason)
if ([DismissReason.PRESS_BACK, DismissReason.TOUCH_OUTSIDE].includes(action.reason)) {
action.dismiss()
}
},
offset: { dx: 0, dy: -25 }
})
controller?: CustomDialogController
cancel: () => void = () => {}
confirm: () => void = () => {}
build() {
Column() {
Text('Change text').fontSize(20).margin(10)
TextInput({ placeholder: '', text: this.textValue })
.height(60).width('90%')
.onChange((value) => this.textValue = value)
Text('Confirm changes?').fontSize(16).margin(10)
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('Cancel')
.onClick(() => {
this.controller?.close()
this.cancel()
})
Button('Confirm')
.onClick(() => {
this.inputValue = this.textValue
this.controller?.close()
this.confirm()
})
}
Button('Open second dialog')
.onClick(() => this.dialogControllerTwo?.open())
}.borderRadius(10)
}
}

// Entry component with first dialog controller
@Entry
@Component
struct CustomDialogUser {
@State textValue: string = ''
@State inputValue: string = 'click me'
dialogController: CustomDialogController | null = new CustomDialogController({
builder: CustomDialogExample({
cancel: this.onCancel,
confirm: this.onAccept,
textValue: $textValue,
inputValue: $inputValue
}),
cancel: this.exitApp,
autoCancel: true,
alignment: DialogAlignment.Bottom,
offset: { dx: 0, dy: -20 },
gridCount: 4,
customStyle: false,
cornerRadius: 10,
})

aboutToDisappear() { this.dialogController = null }
onCancel() { console.log('Cancel callback') }
onAccept() { console.log('Confirm callback') }
exitApp() { console.log('Overlay tap callback') }

build() {
Column() {
Button(this.inputValue)
.onClick(() => this.dialogController?.open())
}
}
}
```






Key features demonstrated:




  • Nested dialogs (CustomDialogExample contains CustomDialogExampleTwo)

  • Parameter configuration (alignment, offset, grid count)

  • Open/close control via button events

  • Dismissal reason handling






5. Important Notes




  • When avoiding soft keyboards, dialogs compress height at maximum limit. Fixed-height child components may overflow.

  • Dialogs don't auto-close during page navigation. Use Navigation for synchronized closing.

  • Style limitations:



    • borderWidth, borderColor, borderStyle must be used together


    • backgroundColor and backgroundBlurStyle have interdependent effects






1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Simplified Usage of Custom Dialogs
id: de947846-4608-48d5-bf58-75583d40ce0c
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "Simplified Usage of Custom Dia" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Simplified Usage of Custom Dialogs")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Simplified Usage of Custom Dialogs*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Simplified Usage of Custom Dialogs"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Simplified Usage of Custom Dialogs.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Simplified Usage of Custom Dialogs

Thematisch verwandte Begriffe: Simplified, Usage, Custom, Dialogs · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97898 | Insecure Direct Object Reference / missing object-level authorization in…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag