Skip to content

Commit

Permalink
Merge pull request #1542 from numbersprotocol/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
shc261392 authored Apr 22, 2022
2 parents 409b472 + f765b10 commit a6d1928
Show file tree
Hide file tree
Showing 29 changed files with 278 additions and 55 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.54.2 - 2022-04-21

### Changed

- Hide buy NUM button at wallets page

### Removed

- Temporarely remove custom camera ux

## 0.54.1 - 2022-04-07

### Removed
Expand Down
7 changes: 5 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ android {
applicationId "io.numbersprotocol.capturelite"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 371
versionName "0.54.1"
versionCode 372
versionName "0.54.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
dataBinding true
}
buildTypes {
release {
minifyEnabled false
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 @@ -25,6 +25,7 @@ dependencies {
implementation project(':capacitor-share')
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-storage')
implementation project(':numbersprotocol-preview-video')
implementation project(':capacitor-blob-writer')

}
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 @@ -63,6 +63,10 @@
"pkg": "@capacitor/storage",
"classpath": "com.capacitorjs.plugins.storage.StoragePlugin"
},
{
"pkg": "@numbersprotocol/preview-video",
"classpath": "io.numbersprotocol.capturelite.plugins.previewvideo.PreviewVideoPlugin"
},
{
"pkg": "capacitor-blob-writer",
"classpath": "com.equimaps.capacitorblobwriter.BlobWriter"
Expand Down
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capa
include ':capacitor-storage'
project(':capacitor-storage').projectDir = new File('../node_modules/@capacitor/storage/android')

include ':numbersprotocol-preview-video'
project(':numbersprotocol-preview-video').projectDir = new File('../node_modules/@numbersprotocol/preview-video/android')

include ':capacitor-blob-writer'
project(':capacitor-blob-writer').projectDir = new File('../node_modules/capacitor-blob-writer/android')
1 change: 1 addition & 0 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def capacitor_pods
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
pod 'CapacitorStorage', :path => '../../node_modules/@capacitor/storage'
pod 'NumbersprotocolPreviewVideo', :path => '../../node_modules/@numbersprotocol/preview-video'
pod 'CapacitorBlobWriter', :path => '../../node_modules/capacitor-blob-writer'
end

Expand Down
29 changes: 21 additions & 8 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.54.1",
"version": "0.54.2",
"author": "numbersprotocol",
"homepage": "https://numbersprotocol.io/",
"scripts": {
Expand Down Expand Up @@ -29,7 +29,7 @@
"@angular/platform-browser-dynamic": "^12.2.4",
"@angular/router": "^12.2.4",
"@capacitor-community/bluetooth-le": "^1.7.0",
"@capacitor-community/http": "^1.4.1",
"@capacitor-community/http": "github:numbersprotocol/http#fix-catch-disabled-Local-Network-case-on-iOS",
"@capacitor-community/wifi": "github:numbersprotocol/community-capacitor-wifi#capacitor3",
"@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-3.4.1-range-request-fix",
"@capacitor/app": "^1.1.0",
Expand Down Expand Up @@ -57,6 +57,7 @@
"@ngx-formly/core": "^5.10.22",
"@ngx-formly/material": "^5.10.22",
"@ngx-formly/schematics": "^5.10.22",
"@numbersprotocol/preview-video": "github:numbersprotocol/preview-video",
"async-mutex": "^0.3.2",
"buffer": "^5.7.1",
"capacitor-blob-writer": "^1.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@
name="hourglass-outline"
class="collecting"
></ion-icon>
<ion-icon
*ngIf="hasUploaded$ | ngrxPush"
src="/assets/images/media-id.svg"
class="uploaded"
>
</ion-icon>
<ion-icon
*ngIf="hasGeolocation$ | ngrxPush"
src="/assets/images/location.svg"
class="located"
></ion-icon>

<div class="bottom-left-icons">
<ion-icon
*ngIf="hasUploaded$ | ngrxPush"
src="/assets/images/media-id.svg"
class="uploaded"
>
</ion-icon>
<ion-icon
*ngIf="hasGeolocation$ | ngrxPush"
src="/assets/images/location.svg"
class="located"
></ion-icon>
<ion-icon
*ngIf="hasCaption$ | ngrxPush"
name="document-text-outline"
class="with-caption"
></ion-icon>
</div>

<ion-icon
*ngIf="isVideo$ | ngrxPush"
name="videocam"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,30 @@ ion-icon.collecting {
font-size: 24px;
}

ion-icon.uploaded {
.bottom-left-icons {
bottom: 9px;
left: 5px;
font-size: 13px;
}
position: absolute;
display: flex;

ion-icon.located {
bottom: 8px;
left: 23px;
font-size: 16px;
ion-icon.uploaded {
position: relative;
font-size: 13px;
}

ion-icon.located {
left: 4px;
bottom: 2px;
position: relative;
font-size: 16px;
}

ion-icon.with-caption {
left: 6px;
bottom: 1px;
position: relative;
font-size: 14px;
}
}

ion-icon.is-video {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
switchMap,
} from 'rxjs/operators';
import { CaptureService } from '../../../../shared/capture/capture.service';
import { DiaBackendAssetRepository } from '../../../../shared/dia-backend/asset/dia-backend-asset-repository.service';
import { getOldProof } from '../../../../shared/repositories/proof/old-proof-adapter';
import { Proof } from '../../../../shared/repositories/proof/proof';
import { normalizeGeolocation } from '../../details/information/session/information-session.service';
Expand Down Expand Up @@ -70,6 +71,11 @@ export class CaptureItemComponent {
)
);

readonly hasCaption$ = this.proof$.pipe(
switchMap(proof => this.diaBackendAssetRepository.fetchByProof$(proof)),
map(asset => asset.caption !== '')
);

readonly isVideo$ = this.proof$.pipe(
concatMap(proof => proof.getFirstAssetMeta()),
map(meta => meta.mimeType.startsWith('video'))
Expand All @@ -81,7 +87,8 @@ export class CaptureItemComponent {
private readonly captureService: CaptureService,
private readonly router: Router,
private readonly route: ActivatedRoute,
private readonly sanitizer: DomSanitizer
private readonly sanitizer: DomSanitizer,
private readonly diaBackendAssetRepository: DiaBackendAssetRepository
) {}

@HostListener('click')
Expand Down
4 changes: 2 additions & 2 deletions src/app/features/home/details/details.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export class DetailsPage {
buttons.push({
text: messageCopyIpfsAddress,
handler: () => {
const ipfsAddress = `https://ipfs.io/ipfs/${diaBackendAsset.cid}`;
const ipfsAddress = `https://ipfs-pin.numbersprotocol.io/ipfs/${diaBackendAsset.cid}`;
this.copyToClipboard(ipfsAddress);
resolve();
},
Expand Down Expand Up @@ -431,7 +431,7 @@ export class DetailsPage {
return Browser.open({
url: diaBackendAsset.supporting_file.replace(
'ipfs://',
'https://ipfs.io/ipfs/'
'https://ipfs-pin.numbersprotocol.io/ipfs/'
),
toolbarColor: '#564dfc',
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/home/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class HomePage {
takePicture: null,
recordVideo: null,
}),
this.goProBluetoothService.connectedDevice$,
this.goProBluetoothService.lastConnectedDevice$,
]).pipe(
first(),
concatMap(([translations, connectedDevice]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
loading="lazy"
></ion-img>

<video
*ngIf="mediaType === 'video'"
controls
playsinline
preload="metadata"
>
<source src="{{ mediaFile!.url }}#t=0.1" type="video/mp4" />
Your browser does not support the video tag.
</video>
<div class="video-placeholder" (click)="playVideoFullScreen()">
<div class="play-icon"></div>
<ion-img
*ngIf="mediaType === 'video'"
[src]="mediaFile!.thumbnailUrl"
decoding="async"
loading="lazy"
></ion-img>
<mat-icon class="play-icon">play_circle_outline</mat-icon>
</div>

<div class="spacer"></div>
<ion-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ ion-img {
height: 350px;
}

.video-placeholder {
height: 350px;
position: relative;
}

.play-icon {
position: absolute;
left: 0;
right: 0;
top: 175px; // half of video-placeholder height
transform: translateY(-36px); // half of play-icon height
margin: 0 auto;
font-size: 72px;
height: 72px;
width: 72px;
}

video {
background-color: black;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ export class GoProMediaItemDetailOnCameraComponent implements OnInit {
this.mediaType = getFileType(this.mediaFile?.url);
}

// eslint-disable-next-line class-methods-use-this
playVideoFullScreen() {
this.router.navigate(['/settings', 'go-pro', 'media-item-viewer'], {
state: { goProMediaFile: this.mediaFile },
});
}

async uploadToCapture() {
const allowed = await this.allowUploadWithMobileInternet();
if (allowed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ <h4>{{ t('gopro.connectedWiFi') }}: {{ connectedWifiSSID }}</h4>
<ion-button
*ngIf="!isConnectedToGoProWifi"
(click)="connectToGoProWifi()"
[disabled]="isConnectingToGoProWifi"
class="connect-to-go-pro-wifi-btn"
>
{{ t('gopro.connectToGoProWiFi') }}
Expand All @@ -40,7 +41,6 @@ <h4>{{ t('gopro.connectedWiFi') }}: {{ connectedWifiSSID }}</h4>
{{ t('gopro.uploadToCapture') }}
</ion-button>

<!-- TODO: att translate text -->
<h4 *ngIf="shouldConnectToWiFi" class="should-connect-to-wifi-text">
{{ t('gopro.makeSureYouAreConnectedToGoProWiFiFirst') }}
</h4>
Expand Down
Loading

0 comments on commit a6d1928

Please sign in to comment.