Skip to content

Commit

Permalink
Merge pull request #2816 from numbersprotocol/milestone-v230413
Browse files Browse the repository at this point in the history
  • Loading branch information
shc261392 authored May 25, 2023
2 parents 36d2f3e + 2e921d6 commit 02ae4e7
Show file tree
Hide file tree
Showing 22 changed files with 232 additions and 28 deletions.
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.79.0] - 2023-05-25

### Added

1. Feat add status bar in ionic page between image and caption (#2810)

### Fixed

1. Refactor pre publish component (#2809)
1. Fix issue flip camera for oppo and other devices if any (#2811)
1. Fix issue error message when without device permission (#2812)

## [0.78.0] - 2023-04-24

### Added

1. Feat capture app flavours should be built automatically by CI/CD (#2731)
1. Feat set device information when user signing up (#2732)
1. Feat should be able to view photos even if the registration fails (#2733)
1. Feat asset saved to device camera roll (#2734)
1. Feat when user first open capture app pop up to encourage users to take a photo (#2735)

## [0.77.2] - 2023-04-18

### Fixed
Expand Down Expand Up @@ -2098,7 +2120,10 @@ This is the first release! _Capture Lite_ is a cross-platform app adapted from [
- Web - see the demo [here](https://github.com/numbersprotocol/capture-lite#demo-app)
- Android - the APK file `app-debug.apk` is attached to this release

[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.77.1...HEAD
[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.79.0...HEAD
[0.79.0]: https://github.com/numbersprotocol/capture-lite/compare/0.78.0...0.79.0
[0.78.0]: https://github.com/numbersprotocol/capture-lite/compare/0.77.2...0.78.0
[0.77.2]: https://github.com/numbersprotocol/capture-lite/compare/0.77.1...0.77.2
[0.77.1]: https://github.com/numbersprotocol/capture-lite/compare/0.77.0...0.77.1
[0.77.0]: https://github.com/numbersprotocol/capture-lite/compare/0.75.2...0.77.0
[0.75.2]: https://github.com/numbersprotocol/capture-lite/compare/0.75.1...0.75.2
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "io.numbersprotocol.capturelite"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 772
versionName "0.77.2"
versionCode 790
versionName "0.79.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
Expand Down
1 change: 1 addition & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {
implementation project(':numbersprotocol-preview-video')
implementation project(':appsflyer-capacitor-plugin')
implementation project(':capacitor-blob-writer')
implementation project(':capacitor-native-settings')
implementation "com.android.billingclient:billing:4.0.0"
}

Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,9 @@
{
"pkg": "capacitor-blob-writer",
"classpath": "com.equimaps.capacitorblobwriter.BlobWriter"
},
{
"pkg": "capacitor-native-settings",
"classpath": "nl.raphael.settings.NativeSettingsPlugin"
}
]
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ project(':appsflyer-capacitor-plugin').projectDir = new File('../node_modules/ap

include ':capacitor-blob-writer'
project(':capacitor-blob-writer').projectDir = new File('../node_modules/capacitor-blob-writer/android')

include ':capacitor-native-settings'
project(':capacitor-native-settings').projectDir = new File('../node_modules/capacitor-native-settings/android')
2 changes: 1 addition & 1 deletion android/variables.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ext {
minSdkVersion = 28
compileSdkVersion = 32
compileSdkVersion = 33
targetSdkVersion = 32
androidxActivityVersion = '1.4.0'
androidxAppCompatVersion = '1.4.2'
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 772;
CURRENT_PROJECT_VERSION = 790;
DEVELOPMENT_TEAM = G7NB5YCKAP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.77.2;
MARKETING_VERSION = 0.79.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -395,13 +395,13 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 772;
CURRENT_PROJECT_VERSION = 790;
DEVELOPMENT_TEAM = G7NB5YCKAP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.77.2;
MARKETING_VERSION = 0.79.0;
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = NumbersAppDistributionV4;
Expand Down
1 change: 1 addition & 0 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def capacitor_pods
pod 'NumbersprotocolPreviewVideo', :path => '../../node_modules/@numbersprotocol/preview-video'
pod 'AppsflyerCapacitorPlugin', :path => '../../node_modules/appsflyer-capacitor-plugin'
pod 'CapacitorBlobWriter', :path => '../../node_modules/capacitor-blob-writer'
pod 'CapacitorNativeSettings', :path => '../../node_modules/capacitor-native-settings'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
end

Expand Down
29 changes: 22 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "capture-lite",
"version": "0.77.2",
"version": "0.79.0",
"author": "numbersprotocol",
"homepage": "https://numbersprotocol.io/",
"scripts": {
Expand Down Expand Up @@ -61,7 +61,7 @@
"@ngx-formly/core": "^5.10.22",
"@ngx-formly/material": "^5.10.22",
"@ngx-formly/schematics": "^5.10.22",
"@numbersprotocol/preview-camera": "github:numbersprotocol/preview-camera#0.0.12",
"@numbersprotocol/preview-camera": "github:numbersprotocol/preview-camera#0.0.15",
"@numbersprotocol/preview-video": "github:numbersprotocol/preview-video",
"@pqina/angular-pintura": "^8.44.1",
"@pqina/pintura": "^8.44.1",
Expand All @@ -70,6 +70,7 @@
"async-mutex": "^0.3.2",
"buffer": "^5.7.1",
"capacitor-blob-writer": "^1.0.4",
"capacitor-native-settings": "^4.0.3",
"compressorjs": "^1.0.7",
"cordova-plugin-purchase": "^11.0.0",
"hammerjs": "^2.0.8",
Expand Down
47 changes: 47 additions & 0 deletions src/app/features/home/custom-camera/custom-camera.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import {
CustomOrientation,
PreviewCamera,
} from '@numbersprotocol/preview-camera';
import {
AndroidSettings,
IOSSettings,
NativeSettings,
} from 'capacitor-native-settings';
import { BehaviorSubject, Subscription, combineLatest, interval } from 'rxjs';
import {
finalize,
Expand Down Expand Up @@ -200,11 +205,53 @@ export class CustomCameraPage implements OnInit, OnDestroy {
}

async startPreviewCamera() {
if ((await this.canStartPreviewCamera()) === false) {
return;
}

await this.customCameraService.startPreviewCamera();
await this.customCameraService.setCameraQuality(this.cameraQuality$.value);
await this.syncCameraState();
}

async canStartPreviewCamera() {
try {
const permissions = await this.customCameraService.requestPermissions();
if (
permissions.camera !== 'granted' ||
permissions.microphone !== 'granted'
) {
const confirmed = await this.confirmAlert.present({
header: this.translocoService.translate(
'customCamera.requestCameraPermissions.title'
),
message: this.translocoService.translate(
'customCamera.requestCameraPermissions.explanation'
),
confirmButtonText: this.translocoService.translate(
'customCamera.requestCameraPermissions.openSettings'
),
});
if (confirmed) {
NativeSettings.open({
optionAndroid: AndroidSettings.ApplicationDetails,
optionIOS: IOSSettings.App,
});
}
this.leaveCustomCamera();
return false;
}
return true;
} catch (_error: unknown) {
// FIXME: report _error to crashlytics.
const errMsg = this.translocoService.translate(
'customCamera.error.canNotStartCamera'
);
this.errorService.toastError$(errMsg).subscribe();
return false;
}
}

stopPreviewCamera() {
this.customCameraService.stopPreviewCamera();
}
Expand Down
5 changes: 5 additions & 0 deletions src/app/features/home/custom-camera/custom-camera.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ export class CustomCameraService {
}
}

// eslint-disable-next-line class-methods-use-this
async requestPermissions() {
return PreviewCamera.requestPermissions();
}

async startPreviewCamera() {
return PreviewCamera.startPreview()
.then(this.changeGlobalCSSBackgroundToTransparent.bind(this))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class PrePublishModeComponent {

private editorImageState: any;

private toggleCropFeature = false;
private isCropFeatureEnabled = false;

private toggleBlackAndWhiteFilter = true;

Expand Down Expand Up @@ -143,7 +143,7 @@ export class PrePublishModeComponent {
}

async toggleCropImageFeature() {
this.toggleCropFeature = !this.toggleCropFeature;
this.isCropFeatureEnabled = !this.isCropFeatureEnabled;
this.pinturaEditorOptions$.next({
...getEditorDefaults({
enableUtils: false,
Expand All @@ -152,7 +152,7 @@ export class PrePublishModeComponent {
cropEnableZoomInput: false,
cropEnableButtonFlipHorizontal: false,
cropEnableButtonRotateLeft: false,
cropEnableImageSelection: this.toggleCropFeature,
cropEnableImageSelection: this.isCropFeatureEnabled,
enableToolbar: false,
}),
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="capture-details">
<ng-container *ngIf="detailedCapture$ | ngrxPush as capture">
<ng-container *ngIf="detailedCapture$ | ngrxPush as capture">
<div class="capture-details">
<div
class="capture-thumbnail"
[routerLink]="[
Expand All @@ -21,7 +21,11 @@
broken_image
</mat-icon>
</div>
</div>

<app-details-uploading-bar></app-details-uploading-bar>

<div class="capture-details">
<section class="caption">
<ng-container *ngIf="captionOn">
<ng-container *ngrxLet="capture.caption$ as caption">
Expand Down Expand Up @@ -117,5 +121,7 @@
<ion-button fill="clear" (click)="toggleShowMore()" mode="md">
{{ informationShowMore ? 'Show less' : 'Show more...' }}
</ion-button>
</ng-container>
</div>
</div>

<div class="bottom-spacer"></div>
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@

div.capture-details {
max-width: 90%;
margin: 0 auto 256px;
margin: 8px auto;

.capture-thumbnail {
border-radius: 20px;
overflow: hidden;
aspect-ratio: 1;
position: relative;

img {
Expand Down Expand Up @@ -105,3 +104,7 @@ div.capture-details {
}
}
}

.bottom-spacer {
height: 256px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ng-container *ngIf="(networkConnected$ | ngrxPush) === false">
<mat-toolbar color="background" class="thin-upload-bar" id="thin-upload-bar">
<span class="text">
{{ 'message.networkNotConnected' | transloco }}
</span>
</mat-toolbar>
</ng-container>
Loading

0 comments on commit 02ae4e7

Please sign in to comment.