1
- namespace Sample
2
- {
3
- using Android . Views ;
4
- using Com . Skydoves . Balloon ;
5
- using Microsoft . Maui . Platform ;
1
+ namespace Sample ;
6
2
7
- public partial class MainPage : ContentPage
8
- {
9
- public MainPage ( )
10
- {
11
- InitializeComponent ( ) ;
12
- }
3
+ using Android . Views ;
4
+ using Com . Skydoves . Balloon ;
5
+ using Microsoft . Maui . Platform ;
13
6
14
- private void OnCounterClicked ( object sender , EventArgs e )
15
- {
16
- var balloon = new Balloon . Builder ( Platform . AppContext )
17
- . SetText ( "Edit your profile here!" )
18
- . SetTextSize ( 15f )
19
- . SetArrowPositionRules ( ArrowPositionRules . AlignAnchor )
20
- . SetArrowSize ( 10 )
21
- . SetArrowPosition ( 0.5f )
22
- . SetPadding ( 12 )
23
- . SetCornerRadius ( 8f )
24
- . SetBalloonAnimation ( BalloonAnimation . Elastic )
25
- . SetOnBalloonDismissListener ( new BallonDismissListener ( ( ) =>
26
- {
27
- var balloon2 = new Balloon . Builder ( Platform . AppContext )
28
- . SetWidthRatio ( 1.0f )
29
- . SetHeight ( BalloonSizeSpec . Wrap )
30
- . SetLayout ( new BallonContent ( ) . ToPlatform ( Handler . MauiContext ) )
31
- . SetArrowPositionRules ( ArrowPositionRules . AlignAnchor )
32
- . SetArrowSize ( 10 )
33
- . SetArrowPosition ( 0.5f )
34
- . SetPadding ( 12 )
35
- . SetCornerRadius ( 8f )
36
- . SetBalloonAnimation ( BalloonAnimation . Fade )
37
- . Build ( ) ;
38
- balloon2 . ShowAtCenter ( MauiLabel . ToPlatform ( MauiLabel . Handler . MauiContext ) ) ;
39
- } ) )
40
- . Build ( ) ;
41
- balloon . ShowAtCenter ( CounterBtn . ToPlatform ( CounterBtn . Handler . MauiContext ) ) ;
42
- }
7
+ public partial class MainPage : ContentPage
8
+ {
9
+ public MainPage ( )
10
+ {
11
+ InitializeComponent ( ) ;
43
12
}
44
13
45
- internal class BallonDismissListener ( Action action ) : Java . Lang . Object , IOnBalloonDismissListener
14
+ private void OnCounterClicked ( object sender , EventArgs e )
46
15
{
47
- public void OnBalloonDismiss ( )
48
- {
49
- action ( ) ;
50
- }
16
+ var balloon = new Balloon . Builder ( Platform . AppContext )
17
+ . SetText ( "Edit your profile here!" )
18
+ . SetTextSize ( 15f )
19
+ . SetArrowPositionRules ( ArrowPositionRules . AlignAnchor )
20
+ . SetArrowSize ( 10 )
21
+ . SetArrowPosition ( 0.5f )
22
+ . SetPadding ( 12 )
23
+ . SetCornerRadius ( 8f )
24
+ . SetBalloonAnimation ( BalloonAnimation . Elastic )
25
+ . SetOnBalloonDismissListener ( new BallonDismissListener ( ( ) =>
26
+ {
27
+ var balloon2 = new Balloon . Builder ( Platform . AppContext )
28
+ . SetWidthRatio ( 1.0f )
29
+ . SetHeight ( BalloonSizeSpec . Wrap )
30
+ . SetLayout ( new BallonContent ( ) . ToPlatform ( Handler . MauiContext ) )
31
+ . SetArrowPositionRules ( ArrowPositionRules . AlignAnchor )
32
+ . SetArrowSize ( 10 )
33
+ . SetArrowPosition ( 0.5f )
34
+ . SetPadding ( 12 )
35
+ . SetCornerRadius ( 8f )
36
+ . SetBalloonAnimation ( BalloonAnimation . Fade )
37
+ . Build ( ) ;
38
+ balloon2 . ShowAtCenter ( MauiLabel . ToPlatform ( MauiLabel . Handler . MauiContext ) ) ;
39
+ } ) )
40
+ . Build ( ) ;
41
+ balloon . ShowAtCenter ( CounterBtn . ToPlatform ( CounterBtn . Handler . MauiContext ) ) ;
51
42
}
52
43
}
44
+
45
+ internal class BallonDismissListener ( Action action ) : Java . Lang . Object , IOnBalloonDismissListener
46
+ {
47
+ public void OnBalloonDismiss ( )
48
+ {
49
+ action ( ) ;
50
+ }
51
+ }
0 commit comments