-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
|
||
import { TorchPage } from './torch.page'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: TorchPage, | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class TorchPageRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { SharedModule } from '@app/shared'; | ||
import { TorchPageRoutingModule } from './torch-routing.module'; | ||
import { TorchPage } from './torch.page'; | ||
|
||
@NgModule({ | ||
imports: [SharedModule, TorchPageRoutingModule], | ||
declarations: [TorchPage], | ||
}) | ||
export class TorchPageModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-buttons slot="start"> | ||
<ion-back-button defaultHref="home"></ion-back-button> | ||
</ion-buttons> | ||
<ion-title>Torch</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<ion-card> | ||
<ion-card-header> | ||
<ion-card-title>About</ion-card-title> | ||
</ion-card-header> | ||
<ion-card-content> | ||
⚡️ Capacitor plugin for switching the flashlight on and off. | ||
</ion-card-content> | ||
<ion-row class="ion-no-padding"> | ||
<ion-col> | ||
<ion-button | ||
fill="clear" | ||
(click)="openOnGithub()" | ||
class="ion-float-right" | ||
>GitHub</ion-button | ||
> | ||
</ion-col> | ||
</ion-row> | ||
</ion-card> | ||
<ion-card> | ||
<ion-card-header> | ||
<ion-card-title>Demo</ion-card-title> | ||
</ion-card-header> | ||
<ion-card-content> | ||
<ion-button expand="block" (click)="enable()">Enable</ion-button> | ||
<ion-button expand="block" (click)="disable()">Disable</ion-button> | ||
<ion-button expand="block" (click)="isAvailable()" | ||
>Is Available</ion-button | ||
> | ||
<ion-button expand="block" (click)="isEnabled()">Is Enabled</ion-button> | ||
<ion-button expand="block" (click)="toggle()">Toggle</ion-button> | ||
</ion-card-content> | ||
</ion-card> | ||
</ion-content> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { SharedTestingModule } from '@tests/modules'; | ||
import { TorchPage } from './torch.page'; | ||
|
||
describe('TorchPage', () => { | ||
let component: TorchPage; | ||
let fixture: ComponentFixture<TorchPage>; | ||
|
||
beforeEach(async () => { | ||
TestBed.configureTestingModule({ | ||
declarations: [TorchPage], | ||
imports: [SharedTestingModule], | ||
providers: [], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(TorchPage); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Component } from '@angular/core'; | ||
import { Torch } from '@capawesome/capacitor-torch'; | ||
|
||
@Component({ | ||
selector: 'app-torch', | ||
templateUrl: './torch.page.html', | ||
styleUrls: ['./torch.page.scss'], | ||
}) | ||
export class TorchPage { | ||
private readonly GH_URL = | ||
'https://github.com/capawesome-team/capacitor-plugins'; | ||
|
||
constructor() {} | ||
|
||
public openOnGithub(): void { | ||
window.open(this.GH_URL, '_blank'); | ||
} | ||
|
||
public async enable(): Promise<void> { | ||
await Torch.enable(); | ||
} | ||
|
||
public async disable(): Promise<void> { | ||
await Torch.disable(); | ||
} | ||
|
||
public async isAvailable(): Promise<void> { | ||
await Torch.isAvailable(); | ||
} | ||
|
||
public async isEnabled(): Promise<void> { | ||
await Torch.isEnabled(); | ||
} | ||
|
||
public async toggle(): Promise<void> { | ||
await Torch.toggle(); | ||
} | ||
} |