Skip to content
This repository has been archived by the owner. It is now read-only.
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Mvx.Flashlight Build Status

🔦 MvvmCross Flashlight Plugin

This plugin allows you to use the device's flash in any MvvmCross project.

Installation

Install via NuGet using:

PM> Install-Package Mvx.Flashlight

Usage

Resolve it:

var flashlightService = Mvx.Resolve<IFlashlightService>();

Use it at will:

//Checks whether the user is using a phone or a toaster 
flashlightService.DeviceHasFlashlight;

//Indicates if the flashlight is currently on or not
flashlightService.IsFlashlightOn

// Those two are self explanatory
flashlightService.EnsureFlashlightOn();
flashlightService.EnsureFlashlightOff();

Check the Sample projects for a working example.

⚠️ Attention

You need to add the camera permission to your Android manifest in order to make this puglin work:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />

About

🔦 MvvmCross plugin to access the device's flash/torch

Resources

Releases

No releases published

Packages

No packages published