/*
* Copyright (C) <year> <copyright holders>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package net.digitalprimates.volume;
import net.digitalprimates.volume.monitor.SettingsContentObserver;
import android.content.Context;
import android.media.AudioManager;
import android.util.Log;
import com.adobe.fre.FREContext;
import com.adobe.fre.FREExtension;
public class VolumeExtension implements FREExtension {
public static final String TAG = "VolumeExtension";
public static FREContext extensionContext;
public static Context appContext;
public static SettingsContentObserver mSettingsWatcher;
private static float NO_VALUE = (float)-1.0;
private static Float lastSystemVolume = NO_VALUE;
public static void notifyVolumeChange() {
AudioManager aManager = (AudioManager) appContext.getSystemService(Context.AUDIO_SERVICE);
Float maxVolume = Float.valueOf(aManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC));
Float systemVolume = Float.valueOf(aManager.getStreamVolume(AudioManager.STREAM_MUSIC));
// Only dispatch the event if the volume actually changed.
// The settings watcher is going to see *any* settings change,
// so it's possible that we'll get in here but the volume hasn't
// changed. We shouldn't tell Flash if that's the case.
if (systemVolume != lastSystemVolume) {
lastSystemVolume = systemVolume;
Float flashVolume = systemVolume / maxVolume;
Log.i(TAG, "system volume: " + systemVolume);
Log.i(TAG, "adjusted volume: " + flashVolume);
String volume = String.valueOf( flashVolume );
String eventName = "volumeChanged";
extensionContext.dispatchStatusEventAsync(eventName, volume);
}
}
@Override
public FREContext createContext(String contextType) {
return new VolumeExtensionContext();
}
@Override
public void dispose() {
Log.d(TAG, "Extension disposed.");
// Stop watching settings for volume changes.
VolumeExtension.appContext.getContentResolver().unregisterContentObserver(mSettingsWatcher);
appContext = null;
extensionContext = null;
mSettingsWatcher = null;
lastSystemVolume = NO_VALUE;
}
@Override
public void initialize() {
Log.d(TAG, "Extension initialized.");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
与iOS和Android设备的系统卷交互的AIR本机扩展。.zip
共82个文件
class:10个
xml:9个
ds_store:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 148 浏览量
2023-03-29
23:12:18
上传
评论
收藏 7.44MB ZIP 举报
温馨提示
与iOS和Android设备的系统卷交互的AIR本机扩展。.zip
资源推荐
资源详情
资源评论
收起资源包目录
与iOS和Android设备的系统卷交互的AIR本机扩展。.zip (82个子文件)
SystemVolumeNativeExtension-master
IOSVolumeLib
.DS_Store 6KB
IOSVolumeLib.xcodeproj
project.pbxproj 9KB
xcuserdata
digitalprimates.xcuserdatad
xcschemes
xcschememanagement.plist 484B
IOSVolumeLib.xcscheme 2KB
project.xcworkspace
contents.xcworkspacedata 157B
xcuserdata
digitalprimates.xcuserdatad
UserInterfaceState.xcuserstate 18KB
IOSVolumeLib
._IOSVolumeLib.m 4KB
IOSVolumeLib.m 4KB
._IOSVolumeLib-Prefix.pch 4KB
IOSVolumeLib-Prefix.pch 165B
README 5KB
AndroidVolumeLib
project.properties 360B
.classpath 425B
src
net
digitalprimates
volume
VolumeExtensionContext.java 2KB
VolumeExtension.java 3KB
functions
InitFunction.java 2KB
SetVolumeFunction.java 2KB
monitor
SettingsContentObserver.java 2KB
libs
FlashRuntimeExtensions.jar 10KB
res
drawable-mdpi
ic_launcher.png 3KB
drawable-ldpi
ic_launcher.png 2KB
values
strings.xml 166B
layout
main.xml 387B
drawable-hdpi
ic_launcher.png 4KB
bin
classes
net
digitalprimates
volume
VolumeExtensionContext.class 1KB
VolumeExtension.class 3KB
functions
SetVolumeFunction.class 1KB
InitFunction.class 2KB
monitor
SettingsContentObserver.class 973B
com
adobe
volume
R$string.class 421B
R$layout.class 388B
R$attr.class 334B
R$drawable.class 401B
R.class 477B
proguard.cfg 1KB
.project 819B
AndroidManifest.xml 380B
gen
com
adobe
volume
R.java 622B
build
.DS_Store 6KB
platformoptions.xml 287B
android
libAndroidVolumeLib.jar 43KB
library.swf 2KB
default
library.swf 2KB
debug
libIOSVolumeLib.a 44KB
library.swf 2KB
ios
libIOSVolumeLib.a 44KB
library.swf 2KB
VolumeLib.swc 3KB
extension.xml 832B
VolumeLib
.settings
org.eclipse.core.resources.prefs 91B
src
net
digitalprimates
volume
VolumeController.as 4KB
events
VolumeEvent.as 2KB
extension.xml 832B
.actionScriptProperties 4KB
bin
.DS_Store 6KB
._.DS_Store 4KB
VolumeLib.swc 3KB
.flexLibProperties 241B
.project 493B
VolumeTest
.DS_Store 6KB
iphone_dev.p12 3KB
.settings
org.eclipse.core.resources.prefs 91B
src
VolumeTest.mxml 2KB
VolumeTest-app.xml 12KB
.actionScriptProperties 6KB
bin-debug
VolumeTest.ipa 5.01MB
VolumeTest.apk 1.13MB
VolumeTest.swf 2.58MB
DebugHostInfo.xml 137B
VolumeTest-app.xml 12KB
._.DS_Store 4KB
NathanDemo.mobileprovision 7KB
.project 772B
.flexProperties 200B
Volume.ane 57KB
VolumeDefault
.settings
org.eclipse.core.resources.prefs 85B
src
net
digitalprimates
volume
VolumeController.as 3KB
events
VolumeEvent.as 2KB
.actionScriptProperties 4KB
bin
VolumeDefault.swc 3KB
.flexLibProperties 229B
.project 461B
共 82 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 01-spring-boot-overview
- vgg模型-基于深度学习AI算法对猫的动作行为识别-不含数据集图片-含逐行注释和说明文档.zip
- vgg模型-CNN图像分类识别人脸-不含数据集图片-含逐行注释和说明文档.zip
- Detect It Easy v3.03
- shufflenet模型-基于人工智能的卷积网络训练识别鞋类-不含数据集图片-含逐行注释和说明文档.zip
- shufflenet模型-python语言pytorch框架训练识别樱桃新鲜度-不含数据集图片-含逐行注释和说明文档.zip
- 优质资源,让 .NET 开发更简单,更通用,更流行
- resnet模型-基于深度学习对苹果颜色识别-不含数据集图片-含逐行注释和说明文档.zip
- mobilenet模型-基于图像分类算法对食物美食识别-不含数据集图片-含逐行注释和说明文档.zip
- ImmunityDebugger
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功