Skip to content

Commit 961b69c

Browse files
committed
fmt
1 parent aca3972 commit 961b69c

21 files changed

+62
-91
lines changed

android/src/main/java/jp/rdlabo/capacitor/plugin/screenshotevent/ScreenshotEvent.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
import com.google.android.gms.common.util.BiConsumer;
77

88
public class ScreenshotEvent extends FileObserver {
9+
910
protected BiConsumer<String, JSObject> notifyListenersFunction;
1011
private final JSObject emptyObject = new JSObject();
1112

12-
public ScreenshotEvent(
13-
String filepath,
14-
BiConsumer<String, JSObject> notifyListenersFunction
15-
) {
13+
public ScreenshotEvent(String filepath, BiConsumer<String, JSObject> notifyListenersFunction) {
1614
super(filepath);
1715
this.notifyListenersFunction = notifyListenersFunction;
1816
}

android/src/main/java/jp/rdlabo/capacitor/plugin/screenshotevent/ScreenshotEventPlugin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package jp.rdlabo.capacitor.plugin.screenshotevent;
22

33
import android.os.Environment;
4-
54
import com.getcapacitor.JSObject;
65
import com.getcapacitor.Plugin;
76
import com.getcapacitor.PluginCall;

demo/capacitor.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const config: CapacitorConfig = {
44
appId: 'jp.capacitor.screenshotevent',
55
appName: 'demo',
66
webDir: 'www',
7-
bundledWebRuntime: false
7+
bundledWebRuntime: false,
88
};
99

1010
export default config;

demo/karma.conf.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (config) {
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage'),
13-
require('@angular-devkit/build-angular/plugins/karma')
13+
require('@angular-devkit/build-angular/plugins/karma'),
1414
],
1515
client: {
1616
jasmine: {
@@ -19,18 +19,15 @@ module.exports = function (config) {
1919
// for example, you can disable the random execution with `random: false`
2020
// or set a specific seed with `seed: 4321`
2121
},
22-
clearContext: false // leave Jasmine Spec Runner output visible in browser
22+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
2323
},
2424
jasmineHtmlReporter: {
25-
suppressAll: true // removes the duplicated traces
25+
suppressAll: true, // removes the duplicated traces
2626
},
2727
coverageReporter: {
2828
dir: require('path').join(__dirname, './coverage/app'),
2929
subdir: '.',
30-
reporters: [
31-
{ type: 'html' },
32-
{ type: 'text-summary' }
33-
]
30+
reporters: [{ type: 'html' }, { type: 'text-summary' }],
3431
},
3532
reporters: ['progress', 'kjhtml'],
3633
port: 9876,
@@ -39,6 +36,6 @@ module.exports = function (config) {
3936
autoWatch: true,
4037
browsers: ['Chrome'],
4138
singleRun: false,
42-
restartOnFileChange: true
39+
restartOnFileChange: true,
4340
});
4441
};

demo/src/app/app-routing.module.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
44
const routes: Routes = [
55
{
66
path: 'home',
7-
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
7+
loadChildren: () => import('./home/home.module').then((m) => m.HomePageModule),
88
},
99
{
1010
path: '',
1111
redirectTo: 'home',
12-
pathMatch: 'full'
12+
pathMatch: 'full',
1313
},
1414
];
1515

1616
@NgModule({
17-
imports: [
18-
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
19-
],
20-
exports: [RouterModule]
17+
imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })],
18+
exports: [RouterModule],
2119
})
22-
export class AppRoutingModule { }
20+
export class AppRoutingModule {}

demo/src/app/app.component.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { TestBed } from '@angular/core/testing';
44
import { AppComponent } from './app.component';
55

66
describe('AppComponent', () => {
7-
87
beforeEach(async () => {
98
await TestBed.configureTestingModule({
109
declarations: [AppComponent],
@@ -17,5 +16,4 @@ describe('AppComponent', () => {
1716
const app = fixture.componentInstance;
1817
expect(app).toBeTruthy();
1918
});
20-
2119
});

demo/src/app/home/home-routing.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const routes: Routes = [
66
{
77
path: '',
88
component: HomePage,
9-
}
9+
},
1010
];
1111

1212
@NgModule({
1313
imports: [RouterModule.forChild(routes)],
14-
exports: [RouterModule]
14+
exports: [RouterModule],
1515
})
1616
export class HomePageRoutingModule {}

demo/src/app/home/home.module.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ import { HomePage } from './home.page';
66

77
import { HomePageRoutingModule } from './home-routing.module';
88

9-
109
@NgModule({
11-
imports: [
12-
CommonModule,
13-
FormsModule,
14-
IonicModule,
15-
HomePageRoutingModule
16-
],
17-
declarations: [HomePage]
10+
imports: [CommonModule, FormsModule, IonicModule, HomePageRoutingModule],
11+
declarations: [HomePage],
1812
})
1913
export class HomePageModule {}

demo/src/app/home/home.page.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<ion-header>
22
<ion-toolbar>
3-
<ion-title>
4-
Blank
5-
</ion-title>
3+
<ion-title> Blank </ion-title>
64
</ion-toolbar>
75
</ion-header>
86

@@ -14,7 +12,12 @@
1412
</ion-item>
1513
<ion-item>
1614
<ion-label>Notificaation</ion-label>
17-
<ion-icon slot="end" name="checkmark-circle" *ngIf="didNoticed" [color]="didNoticed ? 'success' : 'danger'"></ion-icon>
15+
<ion-icon
16+
slot="end"
17+
name="checkmark-circle"
18+
*ngIf="didNoticed"
19+
[color]="didNoticed ? 'success' : 'danger'"
20+
></ion-icon>
1821
</ion-item>
1922
</ion-list>
2023
</ion-content>

demo/src/app/home/home.page.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('HomePage', () => {
1010
beforeEach(async () => {
1111
await TestBed.configureTestingModule({
1212
declarations: [HomePage],
13-
imports: [IonicModule.forRoot()]
13+
imports: [IonicModule.forRoot()],
1414
}).compileComponents();
1515

1616
fixture = TestBed.createComponent(HomePage);

demo/src/app/home/home.page.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, NgZone} from '@angular/core';
1+
import { Component, NgZone } from '@angular/core';
22
import { ScreenshotEvent } from '@rdlabo/capacitor-screenshot-event';
33

44
@Component({
@@ -9,11 +9,9 @@ import { ScreenshotEvent } from '@rdlabo/capacitor-screenshot-event';
99
export class HomePage {
1010
isEnabled = false;
1111
didNoticed = false;
12-
constructor(
13-
private zone: NgZone,
14-
) {
12+
constructor(private zone: NgZone) {
1513
ScreenshotEvent.addListener('userDidTakeScreenshot', () => {
16-
this.zone.run(() => this.didNoticed = true);
14+
this.zone.run(() => (this.didNoticed = true));
1715
});
1816
}
1917

@@ -25,5 +23,4 @@ export class HomePage {
2523
ScreenshotEvent.removeWatchEvent();
2624
}
2725
}
28-
2926
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const environment = {
2-
production: true
2+
production: true,
33
};

demo/src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// The list of file replacements can be found in `angular.json`.
44

55
export const environment = {
6-
production: false
6+
production: false,
77
};
88

99
/*

demo/src/index.html

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Ionic App</title>
36

4-
<head>
5-
<meta charset="utf-8" />
6-
<title>Ionic App</title>
7+
<base href="/" />
78

8-
<base href="/" />
9+
<meta name="color-scheme" content="light dark" />
10+
<meta
11+
name="viewport"
12+
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
13+
/>
14+
<meta name="format-detection" content="telephone=no" />
15+
<meta name="msapplication-tap-highlight" content="no" />
916

10-
<meta name="color-scheme" content="light dark" />
11-
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
12-
<meta name="format-detection" content="telephone=no" />
13-
<meta name="msapplication-tap-highlight" content="no" />
17+
<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
1418

15-
<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
16-
17-
<!-- add to homescreen for ios -->
18-
<meta name="apple-mobile-web-app-capable" content="yes" />
19-
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
20-
</head>
21-
22-
<body>
23-
<app-root></app-root>
24-
</body>
19+
<!-- add to homescreen for ios -->
20+
<meta name="apple-mobile-web-app-capable" content="yes" />
21+
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
22+
</head>
2523

24+
<body>
25+
<app-root></app-root>
26+
</body>
2627
</html>

demo/src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ if (environment.production) {
88
enableProdMode();
99
}
1010

11-
platformBrowserDynamic().bootstrapModule(AppModule)
12-
.catch(err => console.log(err));
11+
platformBrowserDynamic()
12+
.bootstrapModule(AppModule)
13+
.catch((err) => console.log(err));

demo/src/polyfills.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
/***************************************************************************************************
4646
* Zone JS is required by default for Angular itself.
4747
*/
48-
import 'zone.js'; // Included with Angular CLI.
49-
48+
import 'zone.js'; // Included with Angular CLI.
5049

5150
/***************************************************************************************************
5251
* APPLICATION IMPORTS

demo/src/test.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
import 'zone.js/testing';
44
import { getTestBed } from '@angular/core/testing';
5-
import {
6-
BrowserDynamicTestingModule,
7-
platformBrowserDynamicTesting
8-
} from '@angular/platform-browser-dynamic/testing';
5+
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
96

107
// First, initialize the Angular testing environment.
11-
getTestBed().initTestEnvironment(
12-
BrowserDynamicTestingModule,
13-
platformBrowserDynamicTesting(),
14-
);
8+
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"verify:android": "cd android && ./gradlew clean build test && cd ..",
3434
"verify:web": "npm run build",
3535
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
36-
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- autocorrect --format",
36+
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix",
3737
"eslint": "eslint . --ext ts",
3838
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
3939
"swiftlint": "node-swiftlint",

src/definitions.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import type {PluginListenerHandle} from '@capacitor/core';
1+
import type { PluginListenerHandle } from '@capacitor/core';
22

33
export interface ScreenshotEventPlugin {
44
startWatchEvent(): Promise<void>;
55
removeWatchEvent(): Promise<void>;
66

7-
addListener(
8-
eventName: 'userDidTakeScreenshot',
9-
listenerFunc: () => void,
10-
): PluginListenerHandle;
7+
addListener(eventName: 'userDidTakeScreenshot', listenerFunc: () => void): PluginListenerHandle;
118
}

src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ import { registerPlugin } from '@capacitor/core';
22

33
import type { ScreenshotEventPlugin } from './definitions';
44

5-
const ScreenshotEvent = registerPlugin<ScreenshotEventPlugin>(
6-
'ScreenshotEvent',
7-
{
8-
web: () => import('./web').then(m => new m.ScreenshotEventWeb()),
9-
},
10-
);
5+
const ScreenshotEvent = registerPlugin<ScreenshotEventPlugin>('ScreenshotEvent', {
6+
web: () => import('./web').then((m) => new m.ScreenshotEventWeb()),
7+
});
118

129
export * from './definitions';
1310
export { ScreenshotEvent };

src/web.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { WebPlugin } from '@capacitor/core';
22

33
import type { ScreenshotEventPlugin } from './definitions';
44

5-
export class ScreenshotEventWeb
6-
extends WebPlugin
7-
implements ScreenshotEventPlugin {
5+
export class ScreenshotEventWeb extends WebPlugin implements ScreenshotEventPlugin {
86
async startWatchEvent(): Promise<void> {
97
console.log('startWatchEvent');
108
}

0 commit comments

Comments
 (0)