守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 1325|回复: 0

Android-Notification 本机扩展

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    52683
    钢镚
    1422

    开源英雄守望者

    发表于 2015-3-4 11:41:47 | 显示全部楼层 |阅读模式
    应用下载
    应用名称: Android-Notification-Extension-ANE
    支持64位: 不支持
    当前版本: 未知
    运行平台: Android 
    开发语言: ActionScript 3 JAVA 
    应用类别: ANE-JAVA
    应用简介: Android ANE. Toast, alert dialog, list dialog
    Android-Notification-Extension-ANE

    Native Extension for Adobe AIR

    Features:

    1. - toast
    2. - alert dialog (without buttons or with from 1 to 3 buttons)
    3. - list dialog (with any number of buttons)
    复制代码


    Important! Be shure you are using latest version of AIR SDK. This ANE builded for 15.0.356How to use:Connect com.illuzor.extensions.NotificationExtension.ane file to your android air project. Imports: import com.illuzor.notificationextension.NotificationExtension; import com.illuzor.notificationextension.ToastDuration; import com.illuzor.notificationextension.ToastGravity;1) Toast:
    1. import com.illuzor.notificationextension.ToastDuration;

    2. NotificationExtension.showToast("Toast text");
    3. // or
    4. NotificationExtension.showToast("Toast text", ToastDuration.TOAST_SHORT);
    5. // or
    6. NotificationExtension.showToast("Toast text", ToastDuration.TOAST_LONG);
    7. // also you can add toast gravity:
    8. NotificationExtension.showToast("Toast text", ToastDuration.TOAST_LONG, ToastGravity.TOP) // or ToastGravity.BOTTOM, or ToastGravity.LEFT etc.
    复制代码
    2) Alert dialog:Example 1, Alert without buttons:
    1. import com.illuzor.notificationextension.AlertDialog;

    2. var alert:AlertDialog = NotificationExtension.getAlertDialog("Alert title", "Alert Message");
    3. alert.show();
    复制代码
    Example 2, Alert with OK button
    1. import com.illuzor.notificationextension.AlertDialog;
    2. import com.illuzor.notificationextension.AlertActionType;

    3. var alert:AlertDialog = NotificationExtension.getAlertDialog("Alert title", "Alert Message");
    4. alert.setButton(AlertActionType.NEUTRAL_BUTTON, "OK");
    5. alert.show();
    复制代码
    Example 3, Alert with three buttons with callback functions:
    1. import com.illuzor.notificationextension.AlertDialog;
    2. import com.illuzor.notificationextension.AlertActionType;

    3. var alert:AlertDialog = NotificationExtension.getAlertDialog("Alert title", "Alert Message");
    4. alert.setButton(AlertActionType.NEGATIVE_BUTTON, "Negative Button", button1Pressed);
    5. alert.setButton(AlertActionType.POSITIVE_BUTTOND, "Positive Button", button2Pressed);
    6. alert.setButton(AlertActionType.NEUTRAL_BUTTON, "Neutral Button", button3Pressed);
    7. alert.show();

    8. private function button1Pressed():void {
    9.     trace("Negative Button Pressed");
    10. }

    11. private function button2Pressed():void {
    12.     trace("Positive Button Pressed");
    13. }

    14. private function button3Pressed():void {
    15.     trace("Neutral Button Pressed");
    16. }
    复制代码
    You can add three buttons maximum with callback functions or without.Parameters:
    1. alert.title = "title";
    2. alert.message = "message";
    3. alert.cancelable = true;

    4. // also you can add callback function for cancel:

    5. alert.cancelFunction = cancelFunc;

    6. private function cancelFunc():void {
    7.     trace("Alert Canceled");
    8. }
    复制代码
    3) List Dialog:
    1. import com.illuzor.notificationextension.ListDialog;

    2. var dialog:ListDialog = NotificationExtension.getListDialog(titleText.text, cancelableBox.value);
    3. var buttonsNumber:uint = 5;

    4. for (var i:int = 0; i < buttonsNumber; i++) {
    5.     dialog.addButton("Button ".concat(i+1));
    6. }

    7. dialog.show();
    8. dialog.addEventListener(Event.SELECT, onSelected);

    9. private function onSelected(e:Event):void {
    10.     e.target.removeEventListener(Event.SELECT, onSelected);
    11.     trace("Button " + String(e.target.selectedID + 1) + " Pressed");
    12. }

    13. // you can add cancel callback function:
    14. dialog.cancelable = true;

    15. private function cancelFunc():void {
    16.     dialog.removeEventListener(Event.SELECT, onSelected);
    17.     trace("Dialog Canceled");
    18. }
    复制代码
    4) Dispose. If you don`t need extension after use, dispose it:
    1. NotificationExtension.dispose();
    复制代码
    Demo app - http://yadi.sk/d/Se_LR8fm1lgsD






    相关链接:
    https://github.com/illuzor/Android-Notification-Extension-ANE

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2024-4-17 02:11 , Processed in 0.046120 second(s), 34 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表