Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/1.7.0 #60

Merged
merged 20 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/kotlin_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
ruby-version: "3.0"
architecture: "x64"
- name: Setup JDK
uses: actions/setup-java@v3
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test-flutter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test flutter

on:
workflow_dispatch:
workflow_call:

permissions:
contents: read

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: flutter
uses: subosito/[email protected]
with:
architecture: arm64
- name: test-flutter
run: |
cd ./flutter
flutter pub get
flutter test
29 changes: 29 additions & 0 deletions .github/workflows/test-kmp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test kmp

on:
workflow_dispatch:
workflow_call:

permissions:
contents: read

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build and Test with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: testReleaseUnitTest
- name: Archive code coverage results
if: always()
uses: actions/upload-artifact@v1
with:
name: test-kmp-report
path: kotlin-multiplatform/build/reports/tests/testReleaseUnitTest
25 changes: 6 additions & 19 deletions .github/workflows/test-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,9 @@ permissions:
contents: read

jobs:
build:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build and Test with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: testReleaseUnitTest
- name: Archive code coverage results
if: always()
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: kotlin-multiplatform/build/reports/tests/testReleaseUnitTest
call-test-kmp:
uses: ./.github/workflows/test-kmp.yaml
call-test-rn:
uses: ./.github/workflows/test-rn.yaml
call-test-flutter:
uses: ./.github/workflows/test-flutter.yaml
29 changes: 29 additions & 0 deletions .github/workflows/test-rn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test react native

on:
workflow_dispatch:
workflow_call:

permissions:
contents: read

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: test-rn
run: |
cd ./react-native
yarn install
yarn test --collectCoverage
- name: Archive code coverage results
if: always()
uses: actions/upload-artifact@v1
with:
name: test-react-native-report
path: react-native/coverage
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"[dart]": {
"editor.formatOnSave": true
},

"[javascript][javascriptreact][typescript][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
}
2 changes: 1 addition & 1 deletion config/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ complexity:
active: true
ComplexCondition:
active: true
threshold: 10
threshold: 20
# ComplexInterface:
# active: false
# threshold: 10
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies {
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'io.coil-kt:coil-compose:2.2.2'
implementation "io.ktor:ktor-client-cio:2.1.3"
implementation "com.ricoh360.thetaclient:theta-client:1.6.0"
implementation "com.ricoh360.thetaclient:theta-client:1.7.0"

testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.material.FloatingActionButton
import androidx.compose.material.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -55,6 +56,11 @@ fun PreviewScreen(toPhoto: (photoUrl: String) -> Unit, viewModel: ThetaViewModel
}
}

LaunchedEffect(Unit) {
viewModel.startPreview()
//viewModel.startPreviewWithCallback()
}

DisposableEffect(LocalLifecycleOwner.current) {
onDispose {
viewModel.stopPreview()
Expand All @@ -76,8 +82,6 @@ fun PreviewScreen(toPhoto: (photoUrl: String) -> Unit, viewModel: ThetaViewModel
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
viewModel.startPreview()
//viewModel.startPreviewWithCallback()
val bitmap by viewModel.previewFlow.collectAsState()
bitmap?.let {
// Viewer360(bitmap!!)
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
16 changes: 5 additions & 11 deletions demos/demo-flutter/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,27 @@ PODS:
- Flutter (1.0.0)
- theta_client_flutter (1.6.0):
- Flutter
- THETAClient (= 1.6.0)
- THETAClient (1.6.0)
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- Flutter (from `Flutter`)
- theta_client_flutter (from `.symlinks/plugins/theta_client_flutter/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)

SPEC REPOS:
trunk:
- THETAClient
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter
theta_client_flutter:
:path: ".symlinks/plugins/theta_client_flutter/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/ios"
:path: ".symlinks/plugins/video_player_avfoundation/darwin"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
theta_client_flutter: b5ee80b54aa65b2242977fc6a16434658e09aeec
THETAClient: ec3017833a6a4295be859b024e4991270fcf600b
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
theta_client_flutter: c907d880746a822002ee370cce37587ed496bd3e
video_player_avfoundation: e9e6f9cae7d7a6d9b43519b0aab382bca60fcfd1

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

Expand Down
8 changes: 5 additions & 3 deletions demos/demo-flutter/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -68,7 +68,6 @@
4C0661A8B4EA6BD98CA30345 /* Pods-Runner.release.xcconfig */,
519524CB33792C83879372DF /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -156,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -200,10 +199,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down Expand Up @@ -253,6 +254,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
9 changes: 6 additions & 3 deletions demos/demo-flutter/lib/capture_video_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:theta_client_flutter/theta_client_flutter.dart';
import 'message_box.dart';

class CaptureVideoScreen extends StatefulWidget {
const CaptureVideoScreen({Key? key}) : super(key: key);
const CaptureVideoScreen({super.key});

@override
State<StatefulWidget> createState() {
Expand Down Expand Up @@ -70,7 +70,8 @@ class _CaptureVideoScreen extends State<CaptureVideoScreen>

@override
Widget build(BuildContext context) {
return WillPopScope(
return PopScope(
canPop: true,
child: Scaffold(
appBar: AppBar(title: const Text('Capture Video')),
body: Stack(
Expand Down Expand Up @@ -114,7 +115,9 @@ class _CaptureVideoScreen extends State<CaptureVideoScreen>
],
),
),
onWillPop: () => backButtonPress(context),
onPopInvoked: (didPop) async {
backButtonPress(context);
},
);
}

Expand Down
3 changes: 2 additions & 1 deletion demos/demo-flutter/lib/file_list_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:theta_client_flutter/theta_client_flutter.dart';
import 'message_box.dart';

class FileListScreen extends StatefulWidget {
const FileListScreen({Key? key}) : super(key: key);
const FileListScreen({super.key});

@override
State<StatefulWidget> createState() {
Expand All @@ -32,6 +32,7 @@ class _FileListScreen extends State<FileListScreen> {
var result = await _thetaClientFlutter.listFiles(FileTypeEnum.all, 10000);
fileInfoList = result.fileList;
} on PlatformException {
if (!mounted) return;
Navigator.pop(context);
MessageBox.show(context, 'Error listFiles', () {
Navigator.pop(context);
Expand Down
4 changes: 2 additions & 2 deletions demos/demo-flutter/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ class Home extends StatelessWidget {
final ThetaModel? thetaModel;

const Home({
Key? key,
super.key,
required this.platformVersion,
required this.isInitialized,
required this.connectTheta,
required this.thetaModel,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
3 changes: 1 addition & 2 deletions demos/demo-flutter/lib/message_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ class MessageBox extends StatelessWidget {
final String title;
final Function? onClose;

const MessageBox({Key? key, required this.title, this.onClose})
: super(key: key);
const MessageBox({super.key, required this.title, this.onClose});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions demos/demo-flutter/lib/photo_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class PhotoScreen extends StatelessWidget {
final String fileUrl;

const PhotoScreen({
Key? key,
super.key,
required this.name,
required this.fileUrl,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
9 changes: 6 additions & 3 deletions demos/demo-flutter/lib/take_picture_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:theta_client_flutter/theta_client_flutter.dart';

class TakePictureScreen extends StatefulWidget {
const TakePictureScreen({Key? key}) : super(key: key);
const TakePictureScreen({super.key});

@override
State<StatefulWidget> createState() {
Expand Down Expand Up @@ -68,7 +68,8 @@ class _TakePictureScreen extends State<TakePictureScreen>

@override
Widget build(BuildContext context) {
return WillPopScope(
return PopScope(
canPop: true,
child: Scaffold(
appBar: AppBar(title: const Text('Take Picture')),
body: Stack(
Expand Down Expand Up @@ -112,7 +113,9 @@ class _TakePictureScreen extends State<TakePictureScreen>
],
),
),
onWillPop: () => backButtonPress(context),
onPopInvoked: (didPop) async {
backButtonPress(context);
},
);
}

Expand Down
Loading
Loading