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.6.0 #53

Merged
merged 8 commits into from
Nov 21, 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
4 changes: 2 additions & 2 deletions .github/workflows/buildAndTest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build and Test with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/kotlin_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
with:
ruby-version: "2.7"
architecture: "x64"
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: install danger
run: |
gem install bundler
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
with:
path: gh-pages
ref: gh-pages
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "11"
java-version: "17"
distribution: "temurin"
- name: Setup for build
run: |
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# THETA Client

[![theta-client CI with Gradle](https://github.com/ricohapi/theta-client/actions/workflows/buildAndTest.yaml/badge.svg)](https://github.com/ricohapi/theta-client/actions/workflows/buildAndTest.yaml)
[![KDoc](https://img.shields.io/badge/API_reference-KDoc-green.svg)](https://ricohapi.github.io/theta-client/)

[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.10-navy.svg?style=flat&logo=kotlin)](https://kotlinlang.org)
[![Swift](https://img.shields.io/badge/for_Swift-5-FF9900.svg)](https://kotlinlang.org)
[![Flutter](https://img.shields.io/badge/for_Flutter->=2.5.0-blue.svg)](https://ricohapi.github.io/theta-client/)
[![React Native](https://img.shields.io/badge/for_React_Native-0.70.8-aqua.svg)](https://ricohapi.github.io/theta-client/)


This library provides a way to control RICOH THETA using [RICOH THETA API v2.1](https://github.com/ricohapi/theta-api-specs/tree/main/theta-web-api-v2.1).
Your app can perform the following actions:
* Take a photo and video
Expand Down Expand Up @@ -54,8 +63,16 @@ theta-client$ ./gradlew testReleaseUnitTest
```

## How to Use
See tutorials in `docs` directory and [KDoc](https://ricohapi.github.io/theta-client/) of this library.
See tutorials in `docs` directory and [API reference](https://ricohapi.github.io/theta-client/) of this library.
Demo applications in `demos` directory may help you understand how to use this library.

## Verification tool
A tool, written in React Native, is prepared to verify the responses and behavior of Theta to verious requests.
Using this verification tool, you can select and send a command with its parameters then its response is displayed in JSON converted from Android or iOS object.

![menu screen](docs/assets/screen_menu.jpg)
![info screen](docs/assets/screen_info.jpg)
![capture screen](docs/assets/screen_capture.jpg)

## License

Expand Down
26 changes: 9 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20")
classpath("com.android.tools.build:gradle:7.2.2")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.8.20")
classpath("org.jetbrains.dokka:versioning-plugin:1.8.20")
}
plugins {
//trick: for the same plugin versions in all sub-modules
id("com.android.library").version("8.1.2").apply(false)
kotlin("multiplatform").version("1.9.10").apply(false)
kotlin("plugin.serialization").version("1.9.10").apply(false)
id("org.jetbrains.dokka").version("1.9.10")
}

allprojects {
repositories {
google()
mavenCentral()
buildscript {
dependencies {
classpath("org.jetbrains.dokka:versioning-plugin:1.9.10")
}
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
25 changes: 13 additions & 12 deletions demos/demo-android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {
}

android {
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.ricoh360.thetaclient.thetaClientDemo"
minSdk 26
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0.0"

Expand All @@ -36,6 +36,7 @@ android {
}
buildFeatures {
compose true
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
Expand All @@ -57,18 +58,18 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.core:core-ktx:1.12.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation "androidx.navigation:navigation-compose:2.5.3"
implementation 'androidx.webkit:webkit:1.5.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2'
implementation 'androidx.activity:activity-compose:1.8.0'
implementation "androidx.navigation:navigation-compose:2.7.5"
implementation 'androidx.webkit:webkit:1.8.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0'
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"
Expand All @@ -77,8 +78,8 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
testImplementation 'org.junit.jupiter:junit-jupiter'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
Expand Down
8 changes: 4 additions & 4 deletions demos/demo-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext {
compose_version = '1.3.1' // depends on Kotlin 1.7.10
kotlin_version = '1.7.10'
compose_version = '1.5.3' // depends on Kotlin 1.7.10
kotlin_version = '1.9.10'
coroutines_version = '1.6.4'
}
dependencies {
Expand All @@ -12,8 +12,8 @@ buildscript {

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'com.android.application' version '8.1.2' apply false
id 'com.android.library' version '8.1.2' apply false
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jul 05 14:22:13 JST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
1 change: 1 addition & 0 deletions demos/demo-react-native/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ module.exports = {
},
},
],
ignorePatterns: ['marzipano.js'],
};
3 changes: 3 additions & 0 deletions demos/demo-react-native/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ buck-out/
# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/

# live preview
marzipano.js
25 changes: 15 additions & 10 deletions demos/demo-react-native/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os

/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
Expand Down Expand Up @@ -155,6 +155,7 @@ android {
}
if (!enableSeparateBuildPerCPUArchitecture) {
ndk {
//noinspection ChromeOsAbiSupport
abiFilters (*reactNativeArchitectures())
}
}
Expand Down Expand Up @@ -207,6 +208,7 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
//noinspection ChromeOsAbiSupport
include (*reactNativeArchitectures())
}
}
Expand Down Expand Up @@ -246,15 +248,21 @@ android {

}
}

sourceSets {
main {
assets.srcDirs = ["../../web/Web.bundle"]
}
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])

//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
Expand All @@ -270,10 +278,7 @@ dependencies {
}

if (enableHermes) {
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
Expand All @@ -283,7 +288,7 @@ if (isNewArchitectureEnabled()) {
// If new architecture is enabled, we let you build RN from source
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
// This will be applied to all the imported transtitive dependency.
configurations.all {
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
substitute(module("com.facebook.react:react-native"))
.using(project(":ReactAndroid"))
Expand All @@ -297,7 +302,7 @@ if (isNewArchitectureEnabled()) {

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
tasks.register('copyDownloadableDepsToLibs', Copy) {
from configurations.implementation
into 'libs'
}
Expand Down
19 changes: 8 additions & 11 deletions demos/demo-react-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@

buildscript {
ext {
buildToolsVersion = "31.0.0"
buildToolsVersion = "33.0.0"
minSdkVersion = 26
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 33
targetSdkVersion = 33

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"

ext.kotlinVersion = "1.9.10"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
7699B88040F8A987B510C191 /* libPods-DemoReactNative-DemoReactNativeTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-DemoReactNative-DemoReactNativeTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
C92A28D12AF0D16800EFE8E2 /* Web.bundle in Resources */ = {isa = PBXBuildFile; fileRef = C92A28D02AF0D16800EFE8E2 /* Web.bundle */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -43,6 +44,7 @@
5DCACB8F33CDC322A6C60F78 /* libPods-DemoReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DemoReactNative.a"; sourceTree = BUILT_PRODUCTS_DIR; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = DemoReactNative/LaunchScreen.storyboard; sourceTree = "<group>"; };
89C6BE57DB24E9ADA2F236DE /* Pods-DemoReactNative-DemoReactNativeTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoReactNative-DemoReactNativeTests.release.xcconfig"; path = "Target Support Files/Pods-DemoReactNative-DemoReactNativeTests/Pods-DemoReactNative-DemoReactNativeTests.release.xcconfig"; sourceTree = "<group>"; };
C92A28D02AF0D16800EFE8E2 /* Web.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Web.bundle; path = ../web/Web.bundle; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -92,6 +94,7 @@
13B07FB61A68108700A75B9A /* Info.plist */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
13B07FB71A68108700A75B9A /* main.m */,
C92A28D02AF0D16800EFE8E2 /* Web.bundle */,
);
name = DemoReactNative;
sourceTree = "<group>";
Expand Down Expand Up @@ -242,6 +245,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C92A28D12AF0D16800EFE8E2 /* Web.bundle in Resources */,
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
);
Expand Down
4 changes: 2 additions & 2 deletions demos/demo-react-native/ios/DemoReactNative/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTAppSetupPrepareApp(application);
RCTAppSetupPrepareApp(application, true);

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];

Expand All @@ -44,7 +44,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
#endif

NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"DemoReactNative", initProps);
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"DemoReactNative", initProps, true);

if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
Expand Down
Loading
Loading