Skip to content

Commit

Permalink
Update dep versions for translate showcase.
Browse files Browse the repository at this point in the history
Change-Id: Ie45e26d25714fc81e48e507ab52dae82919307ce
  • Loading branch information
zhouyiself committed Apr 23, 2021
1 parent 1e79fb6 commit 7c71153
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
27 changes: 13 additions & 14 deletions android/translate-showcase/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
compileSdkVersion 30
defaultConfig {
applicationId "com.google.mlkit.showcase.translate"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -50,24 +50,23 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.fragment:fragment-ktx:1.2.5'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.fragment:fragment-ktx:1.3.3'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

// Add CameraX dependencies
def camerax_version = "1.0.0-beta07"
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-lifecycle:$camerax_version"
implementation "androidx.camera:camera-view:1.0.0-alpha12"
implementation "androidx.camera:camera-core:"
implementation "androidx.camera:camera-camera2:1.1.0-alpha04"
implementation "androidx.camera:camera-lifecycle:1.1.0-alpha04"
implementation "androidx.camera:camera-view:1.0.0-alpha24"

// Add ML Kit dependencies
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.1'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.3'
implementation 'com.google.mlkit:language-id:16.1.1'
implementation 'com.google.mlkit:translate:16.1.2'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ class MainFragment : Fragment() {
holder.setFormat(PixelFormat.TRANSPARENT)
holder.addCallback(object : SurfaceHolder.Callback {
override fun surfaceChanged(
holder: SurfaceHolder?,
holder: SurfaceHolder,
format: Int,
width: Int,
height: Int
) {
}

override fun surfaceDestroyed(holder: SurfaceHolder?) {}
override fun surfaceDestroyed(holder: SurfaceHolder) {}

override fun surfaceCreated(holder: SurfaceHolder?) {
override fun surfaceCreated(holder: SurfaceHolder) {
holder?.let {
drawOverlay(
it,
Expand All @@ -192,7 +192,6 @@ class MainFragment : Fragment() {
)
}
}

})
}
}
Expand Down Expand Up @@ -261,7 +260,7 @@ class MainFragment : Fragment() {
camera = cameraProvider.bindToLifecycle(
this, cameraSelector, preview, imageAnalyzer
)
preview.setSurfaceProvider(viewFinder.createSurfaceProvider())
preview.setSurfaceProvider(viewFinder.surfaceProvider)
} catch (exc: IllegalStateException) {
Log.e(TAG, "Use case binding failed. This must be running on main thread.", exc)
}
Expand Down
6 changes: 3 additions & 3 deletions android/translate-showcase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.72'
ext.kotlin_version = '1.4.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:4.2.0-rc01'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.1'
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
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.1.1-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip

0 comments on commit 7c71153

Please sign in to comment.