Skip to content

Commit 3aa077f

Browse files
authored
Merge pull request #1523 from sultanmyrza/feature-custom-camera-ux
Feature custom camera ux
2 parents 11c83e6 + 51838c7 commit 3aa077f

21 files changed

+525
-6
lines changed

android/app/capacitor.build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dependencies {
2525
implementation project(':capacitor-share')
2626
implementation project(':capacitor-splash-screen')
2727
implementation project(':capacitor-storage')
28+
implementation project(':numbersprotocol-preview-camera')
2829
implementation project(':numbersprotocol-preview-video')
2930
implementation project(':capacitor-blob-writer')
3031

android/app/src/main/assets/capacitor.plugins.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
"pkg": "@capacitor/storage",
6464
"classpath": "com.capacitorjs.plugins.storage.StoragePlugin"
6565
},
66+
{
67+
"pkg": "@numbersprotocol/preview-camera",
68+
"classpath": "io.numbersprotocol.capturelite.plugins.previewcamera.PreviewCameraPlugin"
69+
},
6670
{
6771
"pkg": "@numbersprotocol/preview-video",
6872
"classpath": "io.numbersprotocol.capturelite.plugins.previewvideo.PreviewVideoPlugin"

android/capacitor.settings.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capa
5050
include ':capacitor-storage'
5151
project(':capacitor-storage').projectDir = new File('../node_modules/@capacitor/storage/android')
5252

53+
include ':numbersprotocol-preview-camera'
54+
project(':numbersprotocol-preview-camera').projectDir = new File('../node_modules/@numbersprotocol/preview-camera/android')
55+
5356
include ':numbersprotocol-preview-video'
5457
project(':numbersprotocol-preview-video').projectDir = new File('../node_modules/@numbersprotocol/preview-video/android')
5558

android/variables.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ext {
22
minSdkVersion = 21
3-
compileSdkVersion = 30
3+
compileSdkVersion = 31
44
targetSdkVersion = 30
55
androidxActivityVersion = '1.2.0'
66
androidxAppCompatVersion = '1.2.0'

ios/App/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def capacitor_pods
2525
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
2626
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
2727
pod 'CapacitorStorage', :path => '../../node_modules/@capacitor/storage'
28+
pod 'NumbersprotocolPreviewCamera', :path => '../../node_modules/@numbersprotocol/preview-camera'
2829
pod 'NumbersprotocolPreviewVideo', :path => '../../node_modules/@numbersprotocol/preview-video'
2930
pod 'CapacitorBlobWriter', :path => '../../node_modules/capacitor-blob-writer'
3031
end

package-lock.json

Lines changed: 37 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"@ngx-formly/core": "^5.10.22",
5858
"@ngx-formly/material": "^5.10.22",
5959
"@ngx-formly/schematics": "^5.10.22",
60+
"@numbersprotocol/preview-camera": "github:numbersprotocol/preview-camera",
6061
"@numbersprotocol/preview-video": "github:numbersprotocol/preview-video",
6162
"async-mutex": "^0.3.2",
6263
"buffer": "^5.7.1",
@@ -65,6 +66,7 @@
6566
"immutable": "^4.0.0-rc.14",
6667
"lodash-es": "^4.17.21",
6768
"material-design-icons-iconfont": "^6.1.0",
69+
"ng-circle-progress": "^1.6.0",
6870
"ngx-long-press2": "^2.0.0",
6971
"ngx-pinch-zoom": "^2.6.0",
7072
"process": "^0.11.10",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { CustomCameraPage } from './custom-camera.page';
5+
6+
const routes: Routes = [
7+
{
8+
path: '',
9+
component: CustomCameraPage,
10+
},
11+
];
12+
13+
@NgModule({
14+
imports: [RouterModule.forChild(routes)],
15+
exports: [RouterModule],
16+
})
17+
export class CustomCameraPageRoutingModule {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { NgModule } from '@angular/core';
2+
import { NgCircleProgressModule } from 'ng-circle-progress';
3+
import { NgxLongPress2Module } from 'ngx-long-press2';
4+
import { SharedModule } from '../../../shared/shared.module';
5+
import { CustomCameraPageRoutingModule } from './custom-camera-routing.module';
6+
import { CustomCameraPage } from './custom-camera.page';
7+
import { CustomCameraService } from './custom-camera.service';
8+
9+
@NgModule({
10+
imports: [
11+
SharedModule,
12+
CustomCameraPageRoutingModule,
13+
NgxLongPress2Module,
14+
NgCircleProgressModule.forRoot({}),
15+
],
16+
providers: [CustomCameraService],
17+
declarations: [CustomCameraPage],
18+
})
19+
export class CustomCameraPageModule {}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<ion-content [fullscreen]="true" [style.--background]="'transparent'">
2+
<div
3+
class="select-from-go-pro-camera-button"
4+
*ngIf="lastConnectedGoProDevice$ | ngrxPush"
5+
(click)="captureFromGoPro()"
6+
>
7+
GoPro
8+
<mat-icon> featured_video </mat-icon>
9+
</div>
10+
11+
<mat-icon class="close-camera-button" (click)="leaveCustomCamera()">
12+
close
13+
</mat-icon>
14+
15+
<div class="camera-buttons-container">
16+
<mat-icon class="temporarily-hidden" id="gallery-icon">
17+
video_collection
18+
</mat-icon>
19+
20+
<circle-progress
21+
(click)="onPress()"
22+
[maxTime]="maxRecordTimeInMilliseconds"
23+
ngxLongPress2
24+
(onLongPress)="onLongPress()"
25+
(onLongPressing)="onLongPressing($event)"
26+
(onReleasePressing)="onReleasePressing()"
27+
[percent]="curRecordTimeInPercent"
28+
[radius]="38"
29+
[outerStrokeWidth]="6"
30+
[innerStrokeWidth]="4"
31+
[outerStrokeColor]="'#78C000'"
32+
[innerStrokeColor]="'#F2F2F2'"
33+
[showTitle]="false"
34+
[showUnits]="false"
35+
[showSubtitle]="false"
36+
[animation]="false"
37+
[animationDuration]="0"
38+
></circle-progress>
39+
40+
<mat-icon (click)="flipCamera()">flip_camera_android</mat-icon>
41+
</div>
42+
</ion-content>

0 commit comments

Comments
 (0)