Skip to content

Commit 4193002

Browse files
committed
feature: sample update to v4.2.1
1 parent 45a149f commit 4193002

File tree

4 files changed

+27
-25
lines changed

4 files changed

+27
-25
lines changed

app/build.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ apply plugin: 'com.android.application'
22

33
apply plugin: 'kotlin-android'
44

5-
apply plugin: 'kotlin-android-extensions'
6-
75
apply plugin: StringCare
86

97
stringcare {
@@ -50,6 +48,10 @@ android {
5048
targetCompatibility 1.8
5149
}
5250

51+
viewBinding {
52+
enabled = true
53+
}
54+
5355
aaptOptions {
5456
noCompress "json"
5557
}
@@ -58,9 +60,9 @@ android {
5860
dependencies {
5961
implementation fileTree(dir: 'libs', include: ['*.jar'])
6062
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
61-
implementation "com.stringcare:library:$stringcare_version"
62-
implementation 'androidx.appcompat:appcompat:1.2.0'
63-
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
63+
implementation "io.github.stringcare:library:$stringcare_version"
64+
implementation 'androidx.appcompat:appcompat:1.3.0'
65+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
6466
testImplementation 'junit:junit:4.12'
6567
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
6668
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

app/src/main/java/com/stringcare/sample/MainActivity.kt

+13-11
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@ package com.stringcare.sample
33
import android.os.Bundle
44
import androidx.appcompat.app.AppCompatActivity
55
import com.stringcare.library.*
6-
import kotlinx.android.synthetic.main.activity_main.*
6+
import com.stringcare.sample.databinding.ActivityMainBinding
77

88
class MainActivity : AppCompatActivity() {
99

10+
private lateinit var binding: ActivityMainBinding
11+
1012
override fun onCreate(savedInstanceState: Bundle?) {
1113
super.onCreate(savedInstanceState)
12-
setContentView(R.layout.activity_main)
14+
15+
binding = ActivityMainBinding.inflate(layoutInflater)
16+
val view = binding.root
17+
setContentView(view)
18+
1319
SC.init { applicationContext }
1420

15-
kenobi.text = R.string.kenobi.reveal()
16-
r2d2.text = R.string.r2d2.reveal()
17-
c3po.text = R.string.c3po.reveal(false)
21+
binding.kenobi.text = R.string.kenobi.reveal()
22+
binding.r2d2.text = R.string.r2d2.reveal()
23+
binding.c3po.text = R.string.c3po.reveal(false)
1824

19-
"test.json".asyncJson { json ->
20-
tv_json.text = json.toString()
21-
}
22-
"test.json".asyncBytes({ false }) { bytes ->
23-
tv_json_original.text = String(bytes)
24-
}
25+
binding.tvJson.text = "test.json".json().toString()
26+
binding.tvJsonOriginal.text = String("test.json".bytes { false })
2527
}
2628
}

build.gradle

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.4.0'
5-
ext.stringcare_version = '4.0.1'
4+
ext.kotlin_version = '1.5.10'
5+
ext.stringcare_version = '4.2.1'
66

77
repositories {
88
google()
9-
jcenter()
9+
mavenCentral()
1010
}
1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:4.0.1'
13-
classpath "com.stringcare:plugin:$stringcare_version"
12+
classpath 'com.android.tools.build:gradle:4.2.1'
13+
classpath "io.github.stringcare:plugin:$stringcare_version"
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15-
// NOTE: Do not place your application dependencies here; they belong
16-
// in the individual module build.gradle files
1715
}
1816
}
1917

2018
allprojects {
2119
repositories {
2220
google()
23-
jcenter()
21+
mavenCentral()
2422
}
2523
}
2624

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

0 commit comments

Comments
 (0)