守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 3242|回复: 1

Android 全屏ANE

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

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

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

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

    开源英雄守望者

    发表于 2015-1-26 21:04:09 | 显示全部楼层 |阅读模式
    应用下载
    应用名称: air-fullscreen-ane
    支持64位:
    当前版本: 1.3.3
    运行平台: Android 
    开发语言: ActionScript 3 
    应用类别: ANE-JAVA
    应用简介: ANE for Adobe AIR to enable true full screen on Android
    本帖最后由 破晓 于 2015-6-11 09:29 编辑

    Full Screen ANE for Adobe AIR

    One of the most common complaints you hear from Adobe AIR developers is that they can't get true full screen on Android devices that have an on-screen navigation bar (the one that contains the back, home and task buttons), with full screen usually meaning that the buttons are simply replaced with a series of grey dots.

    If you're one of those developers, then this AIR Native Extension (ANE) may be the solution you've been looking for.

    Released under BSD license. Requires Adobe AIR 13+.

    Just give me the ANE!

    If you don't care about the source code and just want to download the latest, ready-built ANE, click thereleases link at the top of this project's page on GitHub.

    How does it work?

    This ANE enables developers to offer users a true full screen experience in the Adobe AIR apps for Android.

    Using Android 4.0+, you can use true full screen in "lean mode", the way you see in apps like YouTube, expanding the app right to the edges of the screen, hiding the status and navigation bars until the user next interacts. This is ideally suited to video or cut-scene content.

    In Android 4.4+, however, you can now enter true full screen, fully interactive immersive mode. In this mode, your app will remain in true full screen until you choose otherwise; users can swipe down from the top of the screen to temporarily display the system UI.

    If you need to fix it, fork it!

    This is a free, open-source project, so if you find the ANE doesn't work as you might like with a specific device, configuration or library you're using: fork it, fix it, let us know.

    Before you start

    To avoid cropping, ensure that you're using <fullScreen>false</fullScreen> in your app.xml andstage.displayState is set to StageDisplayState.NORMAL when using any of the full screen modes invoked by this ANE.

    The examples below show how to achieve the best possible full screen experience.

    Code example

    Using the ANE in your app couldn't be easier:

    1. import com.mesmotronic.ane.AndroidFullScreen;

    2. AndroidFullScreen.isSupported; // Is this ANE supported?
    3. AndroidFullScreen.isImmersiveModeSupported; // Is immersive mode supported?
    4. AndroidFullScreen.immersiveWidth; // The width of the screen in immersive mode
    5. AndroidFullScreen.immersiveHeight; // The height of the screen in immersive mode

    6. AndroidFullScreen.hideSystemUI(); // Hide system UI until user interacts
    7. AndroidFullScreen.showSystemUI(); // Show system UI
    8. AndroidFullScreen.showUnderSystemUI(); // Extend your app underneath the system UI (Android 4.4+ only)
    9. AndroidFullScreen.immersiveMode(); // Hide system UI and keep it hidden (Android 4.4+ only)
    10. AndroidFullScreen.immersiveMode(false); // Hide system UI until user swipes from top (Android 4.4+ only)
    复制代码

    All methods return Boolean values: true if the action was successful, false if it wasn't (or isn't supported); if you're using the ANE in an app for a platform other than Android, all properties and methods will return false.

    The immersiveWidth and immersiveHeight properties return the screen width and height available in immersive mode (or with the system UI hidden), or 0 if the ANE isn't supported.

    Therefore, the simplest way to give users the best possible interactive full screen experience in your app is:

    1. if (AndroidFullScreen.immersiveMode())
    2. {
    3.     stage.displayState = StageDisplayState.NORMAL;
    4. }
    5. else
    6. {
    7.     stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    8. }
    复制代码

    An easy way to extend your app underneath the status and navigation bars is:

    1. if (AndroidFullScreen.showUnderSystemUI())
    2. {
    3.     stage.displayState = StageDisplayState.NORMAL;
    4. }
    5. else
    6. {
    7.     stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    8. }
    复制代码

    And a great way to offer full screen video playback is:

    1. if (AndroidFullScreen.hideSystemUI())
    2. {
    3.     stage.displayState = StageDisplayState.NORMAL;
    4. }
    5. else
    6. {
    7.     stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    8. }
    复制代码
    Getting the immersive screen size

    You can use the immersiveWidth and immersiveHeight properties to find out the dimensions of the screen with the system UI hidden, regardless of the current screen state.

    To find out the stage size after calling immersiveMode() or hideSystemUI(), you must wait until the nextRESIZE event before the stage.stageWidth and stage.stageHeight properties are updated; the properties of the Capabilities object are not updated and are therefore incorrect.

    Starling

    To use this ANE with Starling, add Starling.handleLostContext = true; at the start of your ActionScript code to prevent Stage3D lost context errors breaking your app when switching between the normal app state and true full screen.

    License

    This project has been released under BSD license; see LICENSE for details.








    相关链接:


    https://github.com/mesmotronic/air-fullscreen-ane



    下载


    本帖子中包含更多资源

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

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

    使用道具 举报

  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

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

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

    开源英雄守望者

     楼主| 发表于 2015-2-2 16:25:48 | 显示全部楼层
    相关下载:

    Mac OS全屏ANE
    守望者AIR技术交流社区(www.airmyth.com)
    回复 支持 反对

    使用道具 举报

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

    本版积分规则

    
    关闭

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

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

    GMT+8, 2024-3-29 20:20 , Processed in 0.059214 second(s), 37 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

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