鸿蒙开源组件——提醒库

jacksky
发布于 2022-2-18 18:33
浏览
0收藏

Alerter

An  Alerting Library

General

With simplicity in mind, the Alerter employs the builder pattern to facilitate easy integration into any app. A customisable Alert View is dynamically added to the Decor View of the Window, overlaying all content.

概述

  • 支持原有的核心功能,动画没有原组件的体验好,这里是用鸿蒙的写法自己改写的。
  • 不支持进出场动画自定义设置。
  • 使用媒体文件格式支持:图片:png,jpg 音频:mp3。

演示鸿蒙开源组件——提醒库-鸿蒙开发者社区

集成

方式一:
通过library生成har包,添加har包到libs文件夹内
在entry的gradle内添加如下代码
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])

方式二:
allprojects{
    repositories{
        mavenCentral()
    }
}
implementation 'io.openharmony.tpc.thirdlib:Alerter:1.0.0' 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.

entry运行要求

通过DevEco studio,并下载SDK 将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即你的IDE新建项目中所用的版本)

示例

     //默认
                        Button btnDefalut = (Button) findComponentById(ResourceTable.Id_btn_alert1);
                        btnDefalut.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .show();
                            }
                        });

                        //点击事件
                        Button btnOnClick = (Button) findComponentById(ResourceTable.Id_btn_alert2);
                        btnOnClick.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .setDuration(10000)
                                        .setOnClickListener(new Component.ClickedListener() {
                                            @Override
                                            public void onClick(Component component) {
                                                new ToastDialog(getContext()).setText("CLICK").show();
                                            }
                                        })
                                        .show();
                            }
                        });

                        //自定义图标
                        Button btnCustomIcon = (Button) findComponentById(ResourceTable.Id_btn_alert3);
                        btnCustomIcon.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                try {
                                    Alerter.create(MainAbilitySlice.this, componentContainer)
                                            .setCustomLeftIconBig(ResourceTable.Media_custom_icon_big)
                                            .setCustomLeftIconSmall(ResourceTable.Media_custom_icon_small)
                                            .setEnableCustomLeftIconAnim(true)
                                            .setEnableIconAnim(true)
                                            .setTitle("Alert Title")
                                            .setText("Alert text...")
                                            .setIconSize(500) 
                                            .show();
                                } catch (Exception e) {

                                }

                            }
                        });


                        //自定义背景色
                        Button btnBackGround = (Button) findComponentById(ResourceTable.Id_btn_alert4);
                        btnBackGround.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .setDuration(5000)
                                        .setBackgroundColorInt(0xffF99143)
                                        .show();
                            }
                        });

                        //Progress
                        Button btnProgress = (Button) findComponentById(ResourceTable.Id_btn_alert5);
                        btnProgress.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .setDuration(5000)
                                        .enableProgress(true)
                //                        .setProgressColorInt(0xff2c9cac)
                                        .show();
                            }
                        });

                        //字体
                        Button btnFONT = (Button) findComponentById(ResourceTable.Id_btn_alert6);
                        btnFONT.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                copyTTF();
                                Alert alert = Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .setDuration(5000)
                                        .setBackgroundColorInt(0xffF99143)
                                        .show();
                                Font.Builder builder = new Font.Builder(new File(ttfPath));
                                alert.getText().setFont(builder.build());
                                alert.getTitle().setFont(builder.build());
                            }
                        });

                        //回调
                        Button btnCallBack = (Button) findComponentById(ResourceTable.Id_btn_alert7);
                        btnCallBack.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .setDuration(5000)
                                        .setOnShowListener(new OnShowAlertListener() {
                                            @Override
                                            public void onShow() {
                                                new ToastDialog(getContext()).setText("show").show();
                                            }
                                        })
                                        .setOnHideListener(new OnHideAlertListener() {
                                            @Override
                                            public void onHide() {
                                                new ToastDialog(getContext()).setText("hide").show();
                                            }
                                        })
                                        .show();
                            }
                        });

                        //增加按钮
                        Button btnAddButton = (Button) findComponentById(ResourceTable.Id_btn_alert8);
                        btnAddButton.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .setDuration(5000)
                                        .addButton("YES", 0xffffffff, 0xffF99143, 200, 60, new Component.ClickedListener() {
                                            @Override
                                            public void onClick(Component component) {
                                                new ToastDialog(getContext()).setText("yes").show();
                                            }
                                        })
                                        .addButton("NO", 0xffffffff, 0xffF99143, 200, 60, new Component.ClickedListener() {
                                            @Override
                                            public void onClick(Component component) {
                                                new ToastDialog(getContext()).setText("no").show();
                                            }
                                        })
                                        .show();
                            }
                        });

                        //自定义布局
                        Button btnCustomLayout = (Button) findComponentById(ResourceTable.Id_btn_alert9);
                        btnCustomLayout.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer, ResourceTable.Layout_customer_layout)
                                        .setDuration(5000)
                                        .show();
                            }
                        });

                        //VERBOSE
                        Button btnVerbose = (Button) findComponentById(ResourceTable.Id_btn_alert10);
                        btnVerbose.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("The alert scales to accommodate larger bodies of text. " +
                                                "The alert scales to accommodate larger bodies of text. " +
                                                "The alert scales to accommodate larger bodies of text.")
                                        .show();
                            }
                        });

                        //中间弹窗
                        Button btnCenter = (Button) findComponentById(ResourceTable.Id_btn_alert11);
                        btnCenter.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .setContentGravity(DependentLayout.LayoutConfig.CENTER_IN_PARENT)
                                        .show();
                            }
                        });

                        //底部弹窗
                        Button btnBottom = (Button) findComponentById(ResourceTable.Id_btn_alert12);
                        btnBottom.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .setContentGravity(DependentLayout.LayoutConfig.ALIGN_PARENT_BOTTOM)
                                        .show();
                            }
                        });

                        //带右图标弹窗
                        Button btnWithRightIcon = (Button) findComponentById(ResourceTable.Id_btn_alert13);
                        btnWithRightIcon.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setCustomRightIconBig(ResourceTable.Media_custom_icon_big)
                                        .setCustomRightIconSmall(ResourceTable.Media_custom_icon_small)
                                        .setEnableCustomRightIconAnim(true)
                                        .setEnableRightIcon(true)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .show();
                            }
                        });

                        //只有右图标弹窗
                        Button btnOnlyRightIcon = (Button) findComponentById(ResourceTable.Id_btn_alert14);
                        btnOnlyRightIcon.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setCustomRightIconBig(ResourceTable.Media_custom_icon_big)
                                        .setCustomRightIconSmall(ResourceTable.Media_custom_icon_small)
                                        .setEnableCustomRightIconAnim(true)
                                        .setEnableOnlyRightIcon(true)
                                        .setEnableRightIcon(true)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .show();
                            }
                        });

                        //右上角图标弹窗
                        Button btnRightOnTopIcon = (Button) findComponentById(ResourceTable.Id_btn_alert15);
                        btnRightOnTopIcon.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setCustomRightIconBig(ResourceTable.Media_custom_icon_big)
                                        .setCustomRightIconSmall(ResourceTable.Media_custom_icon_small)
                                        .setRightIconTop()
                                        .setEnableCustomRightIconAnim(true)
                                        .setEnableOnlyRightIcon(true)
                                        .setEnableRightIcon(true)
                                        .setEnableIconAnim(true)
                                        .setText("The alert scales to accommodate larger bodies of text. " +
                                                "The alert scales to accommodate larger bodies of text. " +
                                                "The alert scales to accommodate larger bodies of text.")
                                        .show();
                            }
                        });

                        //只有文本
                        Button btnOnlyText = (Button) findComponentById(ResourceTable.Id_btn_alert16);
                        btnOnlyText.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setText("Alert text...")
                                        .show();
                            }
                        });

                        //带铃声
                        Button btnSound = (Button) findComponentById(ResourceTable.Id_btn_alert17);
                        btnSound.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                copyMp3File();
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setSoundUri(Uri.parse(getFilesDir() + File.separator + "ringtone.mp3"))
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .show();
                            }
                        });

                        //SWIPE DISMISS
                        Button btnSwipeDismiss = (Button) findComponentById(ResourceTable.Id_btn_alert18);
                        btnSwipeDismiss.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .enableSwipeToDismiss()
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .show();
                            }
                        });

                        //自定义标题内容颜色
                        Button btnCustomTextColor= (Button) findComponentById(ResourceTable.Id_btn_alert19);
                        btnCustomTextColor.setClickedListener(new Component.ClickedListener() {
                            @Override
                            public void onClick(Component component) {
                                Alert alert =  Alerter.create(MainAbilitySlice.this, componentContainer)
                                        .setEnableIconAnim(true)
                                        .setTitle("Alert Title")
                                        .setText("Alert text...")
                                        .show();
                                alert.getTitle().setTextColor(new Color(0xffF99143));
                                alert.getText().setTextColor(new Color(0xffcc0000));
                            }
                        });
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110.
  • 111.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119.
  • 120.
  • 121.
  • 122.
  • 123.
  • 124.
  • 125.
  • 126.
  • 127.
  • 128.
  • 129.
  • 130.
  • 131.
  • 132.
  • 133.
  • 134.
  • 135.
  • 136.
  • 137.
  • 138.
  • 139.
  • 140.
  • 141.
  • 142.
  • 143.
  • 144.
  • 145.
  • 146.
  • 147.
  • 148.
  • 149.
  • 150.
  • 151.
  • 152.
  • 153.
  • 154.
  • 155.
  • 156.
  • 157.
  • 158.
  • 159.
  • 160.
  • 161.
  • 162.
  • 163.
  • 164.
  • 165.
  • 166.
  • 167.
  • 168.
  • 169.
  • 170.
  • 171.
  • 172.
  • 173.
  • 174.
  • 175.
  • 176.
  • 177.
  • 178.
  • 179.
  • 180.
  • 181.
  • 182.
  • 183.
  • 184.
  • 185.
  • 186.
  • 187.
  • 188.
  • 189.
  • 190.
  • 191.
  • 192.
  • 193.
  • 194.
  • 195.
  • 196.
  • 197.
  • 198.
  • 199.
  • 200.
  • 201.
  • 202.
  • 203.
  • 204.
  • 205.
  • 206.
  • 207.
  • 208.
  • 209.
  • 210.
  • 211.
  • 212.
  • 213.
  • 214.
  • 215.
  • 216.
  • 217.
  • 218.
  • 219.
  • 220.
  • 221.
  • 222.
  • 223.
  • 224.
  • 225.
  • 226.
  • 227.
  • 228.
  • 229.
  • 230.
  • 231.
  • 232.
  • 233.
  • 234.
  • 235.
  • 236.
  • 237.
  • 238.
  • 239.
  • 240.
  • 241.
  • 242.
  • 243.
  • 244.
  • 245.
  • 246.
  • 247.
  • 248.
  • 249.
  • 250.
  • 251.
  • 252.
  • 253.
  • 254.
  • 255.
  • 256.
  • 257.
  • 258.
  • 259.
  • 260.
  • 261.
  • 262.
  • 263.
  • 264.
  • 265.
  • 266.
  • 267.
  • 268.
  • 269.
  • 270.
  • 271.
  • 272.
  • 273.
  • 274.
  • 275.
  • 276.
  • 277.
  • 278.
  • 279.
  • 280.
  • 281.
  • 282.
  • 283.
  • 284.
  • 285.
  • 286.
  • 287.
  • 288.
  • 289.
  • 290.
  • 291.
  • 292.
  • 293.
  • 294.
  • 295.
  • 296.
  • 297.
  • 298.
  • 299.
  • 300.
  • 301.
  • 302.
  • 303.
  • 304.
  • 305.
  • 306.
  • 307.
  • 308.
  • 309.
  • 310.
  • 311.
  • 312.
  • 313.
  • 314.
  • 315.
  • 316.
  • 317.
  • 318.
  • 319.
  • 320.
  • 321.
  <?xml version="1.0" encoding="utf-8"?>
             <DependentLayout
                     xmlns:ohos="http://schemas.huawei.com/res/ohos"
                     ohos:id="$+id:dl_group"
                     ohos:height="match_parent"
                     ohos:width="match_parent"
                     ohos:background_element="#fff"
             >


                 <DependentLayout
                         ohos:id="$+id:titlebar"
                         ohos:top_margin="50vp"
                         ohos:height="50vp"
                         ohos:width="match_parent"
                         ohos:background_element="#2c9cac"
                 >
                     <Text
                             ohos:text_color="#fff"
                             ohos:text="Alert"
                             ohos:text_alignment="horizontal_center"
                             ohos:center_in_parent="true"
                             ohos:align_parent_left="true"
                             ohos:left_margin="20vp"
                             ohos:text_size="20fp"
                             ohos:height="match_content"
                             ohos:width="match_content"/>
                 </DependentLayout>


                 <ScrollView
                         ohos:below="$id:titlebar"
                         ohos:layout_alignment="horizontal_center"
                         ohos:top_margin="10vp"
                         ohos:height="match_parent"
                         ohos:width="match_parent">


                     <DependentLayout
                             ohos:height="match_content"
                             ohos:width="match_parent">

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:id="$+id:btn_alert1"
                                 ohos:text="DEFAULT ALERT"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:top_margin="10vp"
                                 ohos:text_size="18fp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:id="$+id:btn_alert2"
                                 ohos:below="$+id:btn_alert1"
                                 ohos:top_margin="10vp"
                                 ohos:text="ON CLICK ALERT"
                                 ohos:height="50vp"
                                 ohos:text_size="18fp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>


                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:id="$+id:btn_alert3"
                                 ohos:below="$+id:btn_alert2"
                                 ohos:top_margin="10vp"
                                 ohos:text_size="18fp"
                                 ohos:text="CUSTOM ICON ALERT"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>


                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert3"
                                 ohos:id="$+id:btn_alert4"
                                 ohos:top_margin="10vp"
                                 ohos:text="COLOURED ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert4"
                                 ohos:id="$+id:btn_alert5"
                                 ohos:top_margin="10vp"
                                 ohos:text="PROGRESS ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert5"
                                 ohos:id="$+id:btn_alert6"
                                 ohos:top_margin="10vp"
                                 ohos:text="FONT ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert6"
                                 ohos:id="$+id:btn_alert7"
                                 ohos:top_margin="10vp"
                                 ohos:text="CALLBACK ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert7"
                                 ohos:id="$+id:btn_alert8"
                                 ohos:top_margin="10vp"
                                 ohos:text="WITH BUTTON ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert8"
                                 ohos:id="$+id:btn_alert9"
                                 ohos:top_margin="10vp"
                                 ohos:text="CUSTOM LAYOUT ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert9"
                                 ohos:id="$+id:btn_alert10"
                                 ohos:top_margin="10vp"
                                 ohos:text="VERBOSE ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert10"
                                 ohos:id="$+id:btn_alert11"
                                 ohos:top_margin="10vp"
                                 ohos:text="CENTER ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert11"
                                 ohos:id="$+id:btn_alert12"
                                 ohos:top_margin="10vp"
                                 ohos:text="BOTTOM ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert12"
                                 ohos:id="$+id:btn_alert13"
                                 ohos:top_margin="10vp"
                                 ohos:text="WITH RIGHT ICON"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert13"
                                 ohos:id="$+id:btn_alert14"
                                 ohos:top_margin="10vp"
                                 ohos:text="WITH ONLY RIGHT ICON"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert14"
                                 ohos:id="$+id:btn_alert15"
                                 ohos:top_margin="10vp"
                                 ohos:text="RIGHT ICON ON TOP"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert15"
                                 ohos:id="$+id:btn_alert16"
                                 ohos:top_margin="10vp"
                                 ohos:text="TEXT ONLY ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert16"
                                 ohos:id="$+id:btn_alert17"
                                 ohos:top_margin="10vp"
                                 ohos:text="SOUND ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert17"
                                 ohos:id="$+id:btn_alert18"
                                 ohos:top_margin="10vp"
                                 ohos:text="SWIPE DISMISS ALERT"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>

                         <Button
                                 ohos:background_element="$graphic:background_element"
                                 ohos:text_color="#fff"
                                 ohos:below="$+id:btn_alert18"
                                 ohos:id="$+id:btn_alert19"
                                 ohos:top_margin="10vp"
                                 ohos:text="CUSTOM TEXT COLOR"
                                 ohos:bottom_margin="20vp"
                                 ohos:text_size="18fp"
                                 ohos:height="50vp"
                                 ohos:left_margin="30vp"
                                 ohos:right_margin="30vp"
                                 ohos:width="match_parent"/>
                     </DependentLayout>
                 </ScrollView>

             </DependentLayout>
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110.
  • 111.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119.
  • 120.
  • 121.
  • 122.
  • 123.
  • 124.
  • 125.
  • 126.
  • 127.
  • 128.
  • 129.
  • 130.
  • 131.
  • 132.
  • 133.
  • 134.
  • 135.
  • 136.
  • 137.
  • 138.
  • 139.
  • 140.
  • 141.
  • 142.
  • 143.
  • 144.
  • 145.
  • 146.
  • 147.
  • 148.
  • 149.
  • 150.
  • 151.
  • 152.
  • 153.
  • 154.
  • 155.
  • 156.
  • 157.
  • 158.
  • 159.
  • 160.
  • 161.
  • 162.
  • 163.
  • 164.
  • 165.
  • 166.
  • 167.
  • 168.
  • 169.
  • 170.
  • 171.
  • 172.
  • 173.
  • 174.
  • 175.
  • 176.
  • 177.
  • 178.
  • 179.
  • 180.
  • 181.
  • 182.
  • 183.
  • 184.
  • 185.
  • 186.
  • 187.
  • 188.
  • 189.
  • 190.
  • 191.
  • 192.
  • 193.
  • 194.
  • 195.
  • 196.
  • 197.
  • 198.
  • 199.
  • 200.
  • 201.
  • 202.
  • 203.
  • 204.
  • 205.
  • 206.
  • 207.
  • 208.
  • 209.
  • 210.
  • 211.
  • 212.
  • 213.
  • 214.
  • 215.
  • 216.
  • 217.
  • 218.
  • 219.
  • 220.
  • 221.
  • 222.
  • 223.
  • 224.
  • 225.
  • 226.
  • 227.
  • 228.
  • 229.
  • 230.
  • 231.
  • 232.
  • 233.
  • 234.
  • 235.
  • 236.
  • 237.
  • 238.
  • 239.
  • 240.
  • 241.
  • 242.
  • 243.
  • 244.
  • 245.
  • 246.
  • 247.
  • 248.
  • 249.
  • 250.
  • 251.
  • 252.
  • 253.
  • 254.
  • 255.
  • 256.
  • 257.
  • 258.
  • 259.
  • 260.
  • 261.
  • 262.
  • 263.
  • 264.
  • 265.
  • 266.
  • 267.
  • 268.
  • 269.
  • 270.
  • 271.
  • 272.
  • 273.
  • 274.
  • 275.
  • 276.
  • 277.
  • 278.
  • 279.
  • 280.
  • 281.
  • 282.
  • 283.
  • 284.
  • 285.
  • 286.
  • 287.
  • 288.
  • 289.
  • 290.
  • 291.
  • 292.
  • 293.
  • 294.

 

Licence

See the LICENSE file for license rights and limitations (MIT).

Copyright 2017 Tapadoo, Dublin.

Alerter-master.zip 12.2M 10次下载
已于2022-2-18 18:33:41修改
收藏
回复
举报


回复
    相关推荐