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

added scaling (pinch) functionality #118

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Changelog

## 0.6.4
* Flutter 3 compatibility

## 0.6.3
* The function 'addNode' returned only true. You have now modified it to return false as well.
* Prevent apps from turning off when errors other than those on your camera occur.

## 0.6.2
* Slight changes in ```AndroidARView``` dispose methods to prevent memory overflow issues when AR view is closed and reopened multiple times

## 0.6.1
* Adds ```dispose``` method to ```ARSessionManager``` to prevent memory overflow issues when AR view is closed and reopened multiple times

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Or manually add this to your `pubspec.yaml` file (and run `flutter pub get`):

```yaml
dependencies:
ar_flutter_plugin: ^0.6.3
ar_flutter_plugin: ^0.6.4
```

### Importing
Expand Down Expand Up @@ -56,7 +56,7 @@ If you have problems with permissions on iOS (e.g. with the camera view not show
'PERMISSION_SENSORS=1',

## dart: PermissionGroup.bluetooth
'PERMISSION_BLUETOOTH=1',´
'PERMISSION_BLUETOOTH=1',

# add additional permission groups if required
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ internal class AndroidARView(
}
mainHandler.post(runnable)
} catch (e: IOException) {
result.error(null, e.message, e.stackTrace);
result.error("e", e.message, e.stackTrace);
}
} else {
result.error(null, "failed to take screenshot", null);
result.error("e", "failed to take screenshot", null);
}
handlerThread.quitSafely();
}, Handler(handlerThread.looper));
Expand All @@ -151,7 +151,7 @@ internal class AndroidARView(
addNode(it).thenAccept{status: Boolean ->
result.success(status)
}.exceptionally { throwable ->
result.error(null, throwable.message, throwable.stackTrace)
result.error("e", throwable.message, throwable.stackTrace)
null
}
}
Expand All @@ -163,7 +163,7 @@ internal class AndroidARView(
addNode(dict_node, dict_anchor).thenAccept{status: Boolean ->
result.success(status)
}.exceptionally { throwable ->
result.error(null, throwable.message, throwable.stackTrace)
result.error("e", throwable.message, throwable.stackTrace)
null
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import io.flutter.plugin.platform.PlatformViewFactory

class AndroidARViewFactory(val activity: Activity, val messenger: BinaryMessenger) :
PlatformViewFactory(StandardMessageCodec.INSTANCE) {
override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
override fun create(context: Context?, viewId: Int, args: Any?): PlatformView {
val creationParams = args as Map<String?, Any?>?
return AndroidARView(activity, context, messenger, viewId, creationParams)
return AndroidARView(activity, context!!, messenger, viewId, creationParams)
}
}
14 changes: 9 additions & 5 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ if (flutterVersionName == null) {

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -37,15 +37,17 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.carius.lars.ar_flutter_plugin_example"
minSdkVersion 24
targetSdkVersion 30
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
debug {
signingConfig signingConfigs.debug
}

release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
Expand All @@ -58,3 +60,5 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

apply plugin: 'com.google.gms.google-services'
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
android:label="ar_flutter_plugin_example"
android:icon="@mipmap/ic_launcher">
<activity
android:exported="true"
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
Expand Down
6 changes: 3 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.gms:google-services:4.3.8'
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ar_flutter_plugin
description: Flutter Plugin for creating (collaborative) Augmented Reality experiences - Supports ARKit for iOS and ARCore for Android devices.
version: 0.6.3
version: 0.6.4
homepage: https://lars.carius.io
repository: https://github.com/CariusLars/ar_flutter_plugin

Expand Down