Skip to content

Commit 40d8279

Browse files
committed
- Update kotlin dependency version
- Fix icon not showing issue (4a9550d)
1 parent aef4c54 commit 40d8279

File tree

9 files changed

+34
-33
lines changed

9 files changed

+34
-33
lines changed

.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44

55
android {
6-
compileSdkVersion 29
6+
compileSdkVersion 30
77
defaultConfig {
88
applicationId "com.alessandrosperotti.expandablecardviewexample"
99
minSdkVersion 22
10-
targetSdkVersion 29
10+
targetSdkVersion 30
1111
versionCode 1
1212
versionName "1.0"
1313
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -23,14 +23,14 @@ android {
2323
dependencies {
2424
implementation fileTree(dir: 'libs', include: ['*.jar'])
2525
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
26-
implementation 'androidx.appcompat:appcompat:1.1.0'
27-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
28-
implementation "com.google.android.material:material:1.1.0"
29-
testImplementation 'junit:junit:4.13'
30-
androidTestImplementation 'androidx.test:runner:1.2.0'
31-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
26+
implementation 'androidx.appcompat:appcompat:1.3.0'
27+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
28+
implementation "com.google.android.material:material:1.4.0"
29+
testImplementation 'junit:junit:4.13.2'
30+
androidTestImplementation 'androidx.test:runner:1.4.0'
31+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
3232
implementation project(':expandablecardview')
3333

3434
// https://mvnrepository.com/artifact/com.google.android.material/material
35-
implementation 'com.google.android.material:material:1.1.0'
35+
implementation 'com.google.android.material:material:1.4.0'
3636
}

app/src/main/java/host/stjin/expandablecardviewexample/MainActivity.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class MainActivity : AppCompatActivity() {
5353
return true
5454
}
5555

56-
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
57-
when(item?.itemId){
56+
override fun onOptionsItemSelected(item: MenuItem): Boolean {
57+
when(item.itemId){
5858

5959
R.id.aboutme -> {
6060
uri = Uri.parse("https://stjin.host")

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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.3.61'
4+
ext.kotlin_version = '1.5.20'
55
repositories {
66
google()
7-
jcenter()
7+
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.6.0'
10+
classpath 'com.android.tools.build:gradle:4.2.2'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1212

1313
// NOTE: Do not place your application dependencies here; they belong
@@ -18,7 +18,7 @@ buildscript {
1818
allprojects {
1919
repositories {
2020
google()
21-
jcenter()
21+
mavenCentral()
2222
}
2323
}
2424

expandablecardview/build.gradle

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ apply plugin: 'kotlin-android-extensions'
55
ext {
66
PUBLISH_GROUP_ID = 'host.stjin'
77
PUBLISH_ARTIFACT_ID = 'expandable-cardview'
8-
PUBLISH_VERSION = '1.3.0-beta02'
8+
PUBLISH_VERSION = '1.3.1'
99
}
1010

1111
android {
12-
compileSdkVersion 29
12+
compileSdkVersion 30
1313

1414
defaultConfig {
1515
minSdkVersion 18
16-
targetSdkVersion 29
16+
targetSdkVersion 30
1717
versionCode 1
1818
versionName PUBLISH_VERSION
1919

@@ -33,18 +33,18 @@ android {
3333
dependencies {
3434
implementation fileTree(dir: 'libs', include: ['*.jar'])
3535

36-
implementation 'androidx.appcompat:appcompat:1.1.0'
36+
implementation 'androidx.appcompat:appcompat:1.3.0'
3737
implementation "androidx.cardview:cardview:1.0.0"
38-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
39-
testImplementation 'junit:junit:4.13'
40-
androidTestImplementation 'androidx.test:runner:1.2.0'
41-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
38+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
39+
testImplementation 'junit:junit:4.13.2'
40+
androidTestImplementation 'androidx.test:runner:1.4.0'
41+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
4242

4343
apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
4444
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
4545

4646
// https://mvnrepository.com/artifact/com.google.android.material/material
47-
implementation 'com.google.android.material:material:1.1.0'
47+
implementation 'com.google.android.material:material:1.4.0'
4848
}
4949
repositories {
5050
mavenCentral()

expandablecardview/src/main/java/host/stjin/expandablecardview/ExpandableCardView.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class ExpandableCardView @JvmOverloads constructor(context: Context, attrs: Attr
134134

135135
override fun onFinishInflate() {
136136
super.onFinishInflate()
137-
val density = resources.displayMetrics.density;
137+
val density = resources.displayMetrics.density
138138

139139
//Setting attributes
140140
if (!TextUtils.isEmpty(title)) card_title.text = title
@@ -159,7 +159,7 @@ class ExpandableCardView @JvmOverloads constructor(context: Context, attrs: Attr
159159

160160
iconDrawable?.let { drawable ->
161161
card_header.visibility = View.VISIBLE
162-
card_icon.background = drawable
162+
card_icon.setImageDrawable(drawable)
163163
}
164164

165165
setInnerView(innerViewRes)
@@ -364,9 +364,9 @@ class ExpandableCardView @JvmOverloads constructor(context: Context, attrs: Attr
364364
fun setIcon(@DrawableRes drawableRes: Int = -1, drawable: Drawable? = null) {
365365
if (drawableRes != -1) {
366366
iconDrawable = ContextCompat.getDrawable(context, drawableRes)
367-
card_icon.background = iconDrawable
367+
card_icon.setImageDrawable(iconDrawable)
368368
} else {
369-
card_icon.background = drawable
369+
card_icon.setImageDrawable(iconDrawable)
370370
iconDrawable = drawable
371371
}
372372

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-5.6.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

0 commit comments

Comments
 (0)