Пример #1
0
        //打开文件管理器 以文件类型的格式
        /// <summary>
        /// Open file explorer by file type
        /// </summary>
        /// <param name="type"></param>
        public static void OpenFileExplorer(int type)
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.OPEN_FILE);

            AddNibiruTaskParameter(task, File.OPEN_FILE_KEY_TYPE, type);
            StartNibiruTask(task);
        }
Пример #2
0
        //关闭视频播放器
        public static void CloseVideoPlayer()
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.VIDEO_PLAY);

            AddNibiruTaskParameter(task, Video.VIDEO_KEY_CONTROL, Video.VIDEO_CONTROL_CLOSE);
            StartNibiruTask(task);
        }
Пример #3
0
        //打开文件管理器 以路径的方式
        /// <summary>
        /// Open file explorer by path
        /// </summary>
        /// <param name="path"></param>
        public static void OpenFileExplorer(string path)
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.OPEN_FILE);

            AddNibiruTaskParameter(task, File.OPEN_FILE_KEY_PATH, path);
            StartNibiruTask(task);
        }
Пример #4
0
        //打开设置主界面
        /// <summary>
        /// Open settings main scene
        /// </summary>
        public static void OpenSettingsMain()
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.SETTINGS);

            AddNibiruTaskParameter(task, Setting.SETTINGS_KEY_TYPE, Setting.SETTINGS_TYPE_MAIN);
            StartNibiruTask(task);
        }
Пример #5
0
        //打开设置蓝牙
        /// <summary>
        /// Open settings bluetooth scene
        /// </summary>
        public static void OpenSettingsBluetooth()
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.SETTINGS);

            AddNibiruTaskParameter(task, Setting.SETTINGS_KEY_TYPE, Setting.SETTINGS_TYPE_BLUETOOTH);
            StartNibiruTask(task);
        }
Пример #6
0
        public void onDeviceConnectState(int state, AndroidJavaObject device)
        {
            Debug.Log("NibiruTaskApi.onDeviceConnectState:" + state + "(0=connect,1=disconnect)");
            if (!InteractionManager.IsInteractionSDKEnabled())
            {
                NxrSDKApi.Instance.ExecuteControllerStatusChangeEvent(InteractionManager.NACTION_HAND_TYPE.HAND_RIGHT, state == 0, false);
            }
            CDevice cDevice = null;

            if (device != null)
            {
                IntPtr            usbDevicePtr       = device.Call <IntPtr>("getUdevice");
                IntPtr            bluetoothDevicePtr = device.Call <IntPtr>("getBdevice");
                AndroidJavaObject usbDevice          = usbDevicePtr == IntPtr.Zero ? null : device.Call <AndroidJavaObject>("getUdevice");
                AndroidJavaObject bluetoothDevice    = bluetoothDevicePtr == IntPtr.Zero ? null : device.Call <AndroidJavaObject>("getBdevice");
                if (usbDevice != null)
                {
                    cDevice = new CDevice(usbDevice, device.Call <bool>("isQuat"), device.Call <int>("getType"));
                }
                else if (bluetoothDevice != null)
                {
                    cDevice = new CDevice(bluetoothDevice, device.Call <bool>("isQuat"), device.Call <int>("getType"), device.Call <int>("getMode"));
                }
                else
                {
                    cDevice = new CDevice(device.Call <string>("getName"), device.Call <bool>("isQuat"), device.Call <int>("getType"), device.Call <int>("getMode"));
                }
            }
            if (NibiruTaskApi.deviceConnectState != null)
            {
                NibiruTaskApi.deviceConnectState(state, cDevice);
            }
        }
Пример #7
0
        //控制播放条显示
        public static void VideoPlayerShowORHideController(string state)
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.VIDEO_PLAY);

            AddNibiruTaskParameter(task, Video.VIDEO_KEY_CONTROL, Video.VIDEO_KEY_CONTROLLER);
            AddNibiruTaskParameter(task, Video.VIDEO_KEY_SEEKTO_TIME, state);
            StartNibiruTask(task);
        }
Пример #8
0
 public void onPowerChanged(double power)
 {
     Debug.Log("onPowerChange:" + power);
     if (NibiruTaskApi.powerChangeListener != null)
     {
         NibiruTaskApi.powerChangeListener(power);
     }
 }
Пример #9
0
 public void onSysSleepApiReady(bool isReady)
 {
     Debug.Log("onSysSleepApiReady:" + isReady);
     if (NibiruTaskApi.sysSleepApiReady != null)
     {
         NibiruTaskApi.sysSleepApiReady(isReady);
     }
 }
Пример #10
0
 public void onServerApiReady(bool isReady)
 {
     Debug.Log("onServerApiReady:" + isReady);
     if (NibiruTaskApi.serverApiReady != null)
     {
         NibiruTaskApi.serverApiReady(isReady);
     }
 }
Пример #11
0
        //打开图库
        /// <summary>
        /// Open image gallery
        /// </summary>
        /// <param name="path"></param>
        /// <param name="type"></param>
        public static void OpenImageGallery(string path, int type = Gallery.SHOW_IMAGE_KEY_2D)
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.SHOW_IMAGE);

            AddNibiruTaskParameter(task, Gallery.SHOW_IMAGE_KEY_PATH, path);
            AddNibiruTaskParameter(task, Gallery.SHOW_IMAGE_KEY_TYPE, type);
            StartNibiruTask(task);
        }
Пример #12
0
        //播放器快进快退
        public static void VideoPlayerSeekto(long time)
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.VIDEO_PLAY);

            AddNibiruTaskParameter(task, Video.VIDEO_KEY_CONTROL, Video.VIDEO_CONTROL_SEEKTO);
            AddNibiruTaskParameter(task, Video.VIDEO_KEY_SEEKTO_TIME, time);
            StartNibiruTask(task);
        }
Пример #13
0
        //获取文件路径
        /// <summary>
        /// Get file's path
        /// </summary>
        /// <param name="basePath"></param>
        public static void GetFilePath(string basePath)
        {
            Debug.Log("GetFilePath:" + basePath);
            AndroidJavaObject task = NibiruTaskApi.GetNibiruSelectionTask(SELECTION_TASK_ACTION.FILE);

            AddNibiruTaskParameter(task, File.OPEN_FILE_KEY_PATH, basePath);
            StartNibiruTask(task);
        }
Пример #14
0
        //打开浏览器
        /// <summary>
        /// Open browser explorer
        /// </summary>
        /// <param name="url"></param>
        /// <param name="actionBarState"></param>
        public static void OpenBrowerExplorer(string url, string actionBarState = Brower.EXPLORER_KEY_ACTIONBAR_SHOW)
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.EXPLORER);

            AddNibiruTaskParameter(task, Brower.EXPLORER_KEY_URL, url);
            AddNibiruTaskParameter(task, Brower.EXPLORER_KEY_ACTIONBAR, actionBarState);
            StartNibiruTask(task);
        }
Пример #15
0
 public void onSelectionResult(AndroidJavaObject task)
 {
     Debug.Log("onSelectionResult");
     if (NibiruTaskApi.selectionCallback != null)
     {
         NibiruTaskApi.selectionCallback(task);
     }
     //NibiruTaskApi.GetResultValueFromSelectionTask(task);
 }
Пример #16
0
        //打开视频播放器 参数详细说明参考Video类
        /// <summary>
        /// Open system's VideoPlayer to play video
        /// </summary>
        /// <param name="path"></param>
        /// <param name="loop"></param>
        /// <param name="decode"></param>
        /// <param name="mode"></param>
        /// <param name="type"></param>
        public static void OpenVideoPlayer(string path, int loop = Video.VIDEO_KEY_LOOP_ON, int decode = Video.VIDEO_PARAMETERS_DECODE_HARDWARE, int mode = Video.VIDEO_PARAMETERS_MODE_NORMAL, int type = Video.VIDEO_PARAMETERS_TYPE_2D)
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.VIDEO_PLAY);

            AddNibiruTaskParameter(task, Video.VIDEO_KEY_CONTROL, Video.VIDEO_CONTROL_START);
            AddNibiruTaskParameter(task, Video.VIDEO_KEY_LOOP, loop);
            AddNibiruTaskParameter(task, Video.VIDEO_KEY_PARAMETERS_DECODE, decode);
            AddNibiruTaskParameter(task, Video.VIDEO_KEY_PARAMETERS_MODE, mode);
            AddNibiruTaskParameter(task, Video.VIDEO_KEY_PARAMETERS_TYPE, type);
            AddNibiruTaskParameter(task, Video.VIDEO_KEY_PATH, path);
            StartNibiruTask(task);
        }
Пример #17
0
        /// <summary>
        /// Quick interface.Open peripheral driver
        /// </summary>
        public static void OpenDeviceDriver()
        {
            AndroidJavaObject task = NibiruTaskApi.GetNibiruTask(TASK_ACTION.DEVICE_DRIVER);

            StartNibiruTask(task);
        }