Skip to content

Commit

Permalink
Merge pull request #84 from ricohapi/dev/1.10.0
Browse files Browse the repository at this point in the history
Dev/1.10.0
  • Loading branch information
LassicYM authored Jul 17, 2024
2 parents 5576683 + 9025a22 commit dcd3ff6
Show file tree
Hide file tree
Showing 157 changed files with 4,967 additions and 1,068 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-kmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Build and Test with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: testReleaseUnitTest
arguments: testReleaseUnitTest --info
- name: Archive code coverage results
if: always()
uses: actions/upload-artifact@v1
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 @@ -75,7 +75,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.3.9"
implementation "com.ricoh360.thetaclient:theta-client:1.9.1"
implementation "com.ricoh360.thetaclient:theta-client:1.10.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 @@ -18,6 +18,7 @@ import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalLifecycleOwner
import com.ricoh360.thetaclient.ThetaRepository
import com.ricoh360.thetaclient.capture.CapturingStatusEnum
import com.ricoh360.thetaclient.capture.PhotoCapture
import com.ricoh360.thetaclient.thetaClientDemo.ui.theme.ThetaSimpleAndroidAppTheme
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -51,6 +52,10 @@ fun PreviewScreen(toPhoto: (photoUrl: String) -> Unit, viewModel: ThetaViewModel
}
}

override fun onCapturing(status: CapturingStatusEnum) {
Timber.i("takePicture onCapturing: ${status.name}")
}

override fun onError(exception: ThetaRepository.ThetaRepositoryException) {
Timber.e(exception)
}
Expand Down
2 changes: 2 additions & 0 deletions demos/demo-flutter/lib/take_picture_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ class _TakePictureScreen extends State<TakePictureScreen>
shooting = false;
});
debugPrint(exception.toString());
}, onCapturing: (status) {
debugPrint("onCapturing: $status");
});
}
}
2 changes: 1 addition & 1 deletion demos/demo-ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ target 'SdkSample' do
use_frameworks!

# Pods for SdkSample
pod 'THETAClient', '1.9.1'
pod 'THETAClient', '1.10.0'
end
4 changes: 3 additions & 1 deletion demos/demo-ios/SdkSample/ThetaSdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ class Theta {
callback(fileUrl, nil)
}

func onProgress(completion _: Float) {}
func onCapturing(status: CapturingStatusEnum) {
print("takePicture onCapturing: " + status.name)
}

func onError(exception: ThetaException) {
callback(nil, exception.asError())
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@react-navigation/native": "^6.1.0",
"@react-navigation/native-stack": "^6.9.5",
"theta-client-react-native": "1.9.1",
"theta-client-react-native": "1.10.0",
"react": "18.2.0",
"react-native": "0.71.14",
"react-native-safe-area-context": "^4.4.1",
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-react-native/src/ListPhotos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
getThetaInfo,
FileTypeEnum,
FileInfo,
} from 'theta-client-react-native';
} from './modules/theta-client';

const listPhotos = async () => {
const {fileList} = await listFiles(FileTypeEnum.IMAGE, 0, 1000);
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-react-native/src/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from 'react-native';
import {SafeAreaView} from 'react-native-safe-area-context';
import styles from './Styles';
import {initialize} from 'theta-client-react-native';
import {initialize} from './modules/theta-client';

const MainMenu = ({navigation}) => {
const goTake = () => {
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-react-native/src/TakePhoto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
getPhotoCaptureBuilder,
THETA_EVENT_NAME,
isInitialized,
} from 'theta-client-react-native';
} from './modules/theta-client';
import {useIsFocused} from '@react-navigation/native';
import WebView from 'react-native-webview';

Expand Down
1 change: 1 addition & 0 deletions demos/demo-react-native/src/modules/theta-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from 'theta-client-react-native';
1 change: 1 addition & 0 deletions demos/demo-react-native/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"extends": "@tsconfig/react-native/tsconfig.json", /* Recommended React Native TSConfig base */
"compilerOptions": {
"jsx": "react",
/* Visit https://aka.ms/tsconfig.json to read more about this file */

/* Completeness */
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-android.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- モジュールの`build.gradle``dependencies`に次を追加します。
```
implementation "com.ricoh360.thetaclient:theta-client:1.9.1"
implementation "com.ricoh360.thetaclient:theta-client:1.10.0"
```
- 本 SDK を使用したアプリケーションが動作するスマートフォンと THETA を無線 LAN 接続しておきます。

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Add following descriptions to the `dependencies` of your module's `build.gradle`.

```
implementation "com.ricoh360.thetaclient:theta-client:1.9.1"
implementation "com.ricoh360.thetaclient:theta-client:1.10.0"
```

- Connect the wireless LAN between THETA and the smartphone that runs on the application using this SDK.
Expand Down
2 changes: 1 addition & 1 deletion flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ dependencies {
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.9")
implementation("com.soywiz.korlibs.krypto:krypto:4.0.10")

implementation("com.ricoh360.thetaclient:theta-client:1.9.1")
implementation("com.ricoh360.thetaclient:theta-client:1.10.0")
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const val KEY_NOTIFY_PARAMS = "params"
const val KEY_NOTIFY_PARAM_COMPLETION = "completion"
const val KEY_NOTIFY_PARAM_IMAGE = "image"
const val KEY_NOTIFY_PARAM_MESSAGE = "message"
const val KEY_NOTIFY_PARAM_STATUS = "status"
const val KEY_GPS_INFO = "gpsInfo"
const val KEY_STATE_EXTERNAL_GPS_INFO = "externalGpsInfo"
const val KEY_STATE_INTERNAL_GPS_INFO = "internalGpsInfo"
Expand Down Expand Up @@ -344,6 +345,11 @@ fun <T> setCaptureBuilderParams(call: MethodCall, builder: Capture.Builder<T>) {
}

fun setPhotoCaptureBuilderParams(call: MethodCall, builder: PhotoCapture.Builder) {
call.argument<Int>("_capture_interval")?.let {
if (it >= 0) {
builder.setCheckStatusCommandInterval(it.toLong())
}
}
call.argument<String>(OptionNameEnum.Filter.name)?.let { enumName ->
FilterEnum.values().find { it.name == enumName }?.let {
builder.setFilter(it)
Expand Down Expand Up @@ -382,6 +388,11 @@ fun setTimeShiftCaptureBuilderParams(call: MethodCall, builder: TimeShiftCapture
}

fun setVideoCaptureBuilderParams(call: MethodCall, builder: VideoCapture.Builder) {
call.argument<Int>("_capture_interval")?.let {
if (it >= 0) {
builder.setCheckStatusCommandInterval(it.toLong())
}
}
call.argument<String>(OptionNameEnum.MaxRecordableTime.name)?.let { enumName ->
MaxRecordableTimeEnum.values().find { it.name == enumName }?.let {
builder.setMaxRecordableTime(it)
Expand All @@ -395,6 +406,11 @@ fun setVideoCaptureBuilderParams(call: MethodCall, builder: VideoCapture.Builder
}

fun setLimitlessIntervalCaptureBuilderParams(call: MethodCall, builder: LimitlessIntervalCapture.Builder) {
call.argument<Int>("_capture_interval")?.let {
if (it >= 0) {
builder.setCheckStatusCommandInterval(it.toLong())
}
}
call.argument<Int>(OptionNameEnum.CaptureInterval.name)?.also {
builder.setCaptureInterval(it)
}
Expand Down Expand Up @@ -906,3 +922,9 @@ fun toMessageNotifyParam(message: String): Map<String, Any> {
KEY_NOTIFY_PARAM_MESSAGE to message
)
}

fun toCapturingNotifyParam(status: CapturingStatusEnum): Map<String, Any> {
return mapOf<String, Any>(
KEY_NOTIFY_PARAM_STATUS to status.name
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,26 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
const val notifyIdLivePreview = 10001
const val notifyIdTimeShiftProgress = 10011
const val notifyIdTimeShiftStopError = 10012
const val notifyIdVideoCaptureStopError = 10003
const val notifyIdTimeShiftCapturing = 10013
const val notifyIdLimitlessIntervalCaptureStopError = 10004
const val notifyIdLimitlessIntervalCaptureCapturing = 10005
const val notifyIdShotCountSpecifiedIntervalCaptureProgress = 10021
const val notifyIdShotCountSpecifiedIntervalCaptureStopError = 10022
const val notifyIdShotCountSpecifiedIntervalCaptureCapturing = 10023
const val notifyIdCompositeIntervalCaptureProgress = 10031;
const val notifyIdCompositeIntervalCaptureStopError = 10032;
const val notifyIdCompositeIntervalCaptureCapturing = 10033;
const val notifyIdMultiBracketCaptureProgress = 10041;
const val notifyIdMultiBracketCaptureStopError = 10042;
const val notifyIdMultiBracketCaptureCapturing = 10043;
const val notifyIdBurstCaptureProgress = 10051;
const val notifyIdBurstCaptureStopError = 10052;
const val notifyIdBurstCaptureCapturing = 10053
const val notifyIdContinuousCaptureProgress = 10061;
const val notifyIdContinuousCaptureCapturing = 10062;
const val notifyIdPhotoCapturing = 10071
const val notifyIdVideoCaptureStopError = 10081
const val notifyIdVideoCaptureCapturing = 10082
}

fun sendNotifyEvent(id: Int, params: Map<String, Any?>) {
Expand Down Expand Up @@ -666,6 +675,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
result.success(fileUrl)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdPhotoCapturing,
toCapturingNotifyParam(status)
)
}

override fun onError(exception: ThetaRepository.ThetaRepositoryException) {
result.error(exception.javaClass.simpleName, exception.message, null)
}
Expand Down Expand Up @@ -726,6 +742,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdTimeShiftCapturing,
toCapturingNotifyParam(status)
)
}

override fun onCaptureCompleted(fileUrl: String?) {
result.success(fileUrl)
}
Expand Down Expand Up @@ -789,6 +812,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
toMessageNotifyParam(exception.message ?: exception.toString())
)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdVideoCaptureCapturing,
toCapturingNotifyParam(status)
)
}
})
}

Expand Down Expand Up @@ -849,6 +879,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
toMessageNotifyParam(exception.message ?: exception.toString())
)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdLimitlessIntervalCaptureCapturing,
toCapturingNotifyParam(status)
)
}
})
}

Expand Down Expand Up @@ -917,6 +954,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdShotCountSpecifiedIntervalCaptureCapturing,
toCapturingNotifyParam(status)
)
}

override fun onCaptureCompleted(fileUrls: List<String>?) {
result.success(fileUrls)
}
Expand Down Expand Up @@ -990,6 +1034,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdCompositeIntervalCaptureCapturing,
toCapturingNotifyParam(status)
)
}

override fun onCaptureCompleted(fileUrls: List<String>?) {
result.success(fileUrls)
}
Expand Down Expand Up @@ -1097,6 +1148,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdBurstCaptureCapturing,
toCapturingNotifyParam(status)
)
}

override fun onCaptureCompleted(fileUrls: List<String>?) {
result.success(fileUrls)
}
Expand Down Expand Up @@ -1168,6 +1226,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdMultiBracketCaptureCapturing,
toCapturingNotifyParam(status)
)
}

override fun onCaptureCompleted(fileUrls: List<String>?) {
result.success(fileUrls)
}
Expand Down Expand Up @@ -1231,6 +1296,13 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
)
}

override fun onCapturing(status: CapturingStatusEnum) {
sendNotifyEvent(
notifyIdContinuousCaptureCapturing,
toCapturingNotifyParam(status)
)
}

override fun onCaptureCompleted(fileUrls: List<String>?) {
result.success(fileUrls)
}
Expand Down
22 changes: 22 additions & 0 deletions flutter/ios/Classes/ConvertUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let KEY_NOTIFY_PARAMS = "params"
let KEY_NOTIFY_PARAM_COMPLETION = "completion"
let KEY_NOTIFY_PARAM_IMAGE = "image"
let KEY_NOTIFY_PARAM_MESSAGE = "message"
let KEY_NOTIFY_PARAM_STATUS = "status"
let KEY_GPS_INFO = "gpsInfo"
let KEY_STATE_EXTERNAL_GPS_INFO = "externalGpsInfo"
let KEY_STATE_INTERNAL_GPS_INFO = "internalGpsInfo"
Expand Down Expand Up @@ -254,6 +255,11 @@ func setCaptureBuilderParams<T>(params: [String: Any], builder: CaptureBuilder<T
}

func setPhotoCaptureBuilderParams(params: [String: Any], builder: PhotoCapture.Builder) {
if let interval = params["_capture_interval"] as? Int,
interval >= 0
{
builder.setCheckStatusCommandInterval(timeMillis: Int64(interval))
}
if let value = params[ThetaRepository.OptionNameEnum.filter.name] as? String {
if let enumValue = getEnumValue(values: ThetaRepository.FilterEnum.values(), name: value) {
builder.setFilter(filter: enumValue)
Expand Down Expand Up @@ -292,6 +298,11 @@ func setTimeShiftCaptureBuilderParams(params: [String: Any], builder: TimeShiftC
}

func setVideoCaptureBuilderParams(params: [String: Any], builder: VideoCapture.Builder) {
if let interval = params["_capture_interval"] as? Int,
interval >= 0
{
builder.setCheckStatusCommandInterval(timeMillis: Int64(interval))
}
if let value = params[ThetaRepository.OptionNameEnum.maxrecordabletime.name] as? String {
if let enumValue = getEnumValue(values: ThetaRepository.MaxRecordableTimeEnum.values(), name: value) {
builder.setMaxRecordableTime(time: enumValue)
Expand All @@ -305,6 +316,11 @@ func setVideoCaptureBuilderParams(params: [String: Any], builder: VideoCapture.B
}

func setLimitlessIntervalCaptureBuilderParams(params: [String: Any], builder: LimitlessIntervalCapture.Builder) {
if let interval = params["_capture_interval"] as? Int,
interval >= 0
{
builder.setCheckStatusCommandInterval(timeMillis: Int64(interval))
}
if let value = params[ThetaRepository.OptionNameEnum.captureinterval.name] as? Int32 {
builder.setCaptureInterval(interval: value)
}
Expand Down Expand Up @@ -1104,3 +1120,9 @@ func toMessageNotifyParam(message: String) -> [String: Any] {
KEY_NOTIFY_PARAM_MESSAGE: message,
]
}

func toCapturingNotifyParam(value: CapturingStatusEnum) -> [String: Any] {
return [
KEY_NOTIFY_PARAM_STATUS: value.name,
]
}
Loading

0 comments on commit dcd3ff6

Please sign in to comment.