@@ -389,7 +389,7 @@ impl Modals {
389
389
/// <details>
390
390
/// <summary>Example Image</summary>
391
391
///
392
- /// 
392
+ /// 
393
393
///
394
394
/// </details>
395
395
///
@@ -428,7 +428,7 @@ impl Modals {
428
428
/// <details>
429
429
/// <summary>Example Image</summary>
430
430
///
431
- /// 
431
+ /// 
432
432
///
433
433
/// </details>
434
434
///
@@ -616,7 +616,7 @@ impl Modals {
616
616
/// <details>
617
617
/// <summary>Example Image</summary>
618
618
///
619
- /// 
619
+ /// 
620
620
///
621
621
/// </details>
622
622
///
@@ -692,7 +692,7 @@ impl Modals {
692
692
/// <details>
693
693
/// <summary>Example Image</summary>
694
694
///
695
- /// 
695
+ /// 
696
696
///
697
697
/// </details>
698
698
///
@@ -789,6 +789,37 @@ impl Modals {
789
789
}
790
790
}
791
791
792
+ /// Notification modal with title and text that can be updated.
793
+ /// - Modal cannot be dismissed by the user, you must close this dialog using `dynamic_notification_close`
794
+ /// - Burden is on the consumer to not exceed available space.
795
+ ///
796
+ /// <details>
797
+ /// <summary>Example Image</summary>
798
+ ///
799
+ /// 
800
+ ///
801
+ /// </details>
802
+ ///
803
+ /// # Example
804
+ /// ```
805
+ /// use modals::Modals;
806
+ /// use xous_names::XousNames;
807
+ /// let xns = XousNames::new().unwrap();
808
+ /// let modals = Modals::new(&xns).unwrap();
809
+ ///
810
+ /// modals
811
+ /// .dynamic_notification(Some("TITLE OF NOTIFICATION"), Some("Important details go here..."))
812
+ /// .unwrap();
813
+ /// /// do some stuff
814
+ /// modals
815
+ /// .dynamic_notification_update(
816
+ /// Some("Important update!"),
817
+ /// Some("We're almost there, please hold.."),
818
+ /// )
819
+ /// .unwrap();
820
+ /// /// do more stuff
821
+ /// modals.dynamic_notification_close().unwrap();
822
+ /// ```
792
823
pub fn dynamic_notification ( & self , title : Option < & str > , text : Option < & str > ) -> Result < ( ) , xous:: Error > {
793
824
self . lock ( ) ;
794
825
let spec = DynamicNotification {
@@ -802,6 +833,8 @@ impl Modals {
802
833
Ok ( ( ) )
803
834
}
804
835
836
+ /// - Calling this to update the dynamic_notification dialog is optional.
837
+ /// - See documentation for `dynamic_notification` for a code example.
805
838
pub fn dynamic_notification_update (
806
839
& self ,
807
840
title : Option < & str > ,
@@ -818,6 +851,8 @@ impl Modals {
818
851
Ok ( ( ) )
819
852
}
820
853
854
+ /// - You must call this method to dismiss `dynamic_notification` when it is no longer needed.
855
+ /// - See documentation for `dynamic_notification` for a code example.
821
856
pub fn dynamic_notification_close ( & self ) -> Result < ( ) , xous:: Error > {
822
857
send_message (
823
858
self . conn ,
0 commit comments