Skip to content

Commit 2f68247

Browse files
updated sdks...
1 parent 1ec6930 commit 2f68247

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

.idea/caches/build_file_checksums.ser

0 Bytes
Binary file not shown.

.idea/caches/gradle_models.ser

-24 Bytes
Binary file not shown.

AutoFitTextViewLibrary/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ android {
3737

3838
dependencies {
3939
implementation 'androidx.appcompat:appcompat:1.0.2'
40-
compile "androidx.core:core-ktx:1.0.1"
40+
implementation "androidx.core:core-ktx:1.0.1"
4141
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
4242
}
4343
repositories {

AutoFitTextViewLibrary/src/com/lb/auto_fit_textview/AutoResizeTextView.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ class AutoResizeTextView @JvmOverloads constructor(context: Context, attrs: Attr
6969
textRect.bottom = textPaint!!.fontSpacing
7070
textRect.right = textPaint!!.measureText(text)
7171
} else {
72-
val layout = StaticLayout(text, textPaint, widthLimit, Alignment.ALIGN_NORMAL, spacingMult, spacingAdd, true)
72+
val layout: StaticLayout = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
73+
StaticLayout.Builder.obtain(text, 0, text.length, textPaint!!, widthLimit).setLineSpacing(spacingAdd, spacingMult).setAlignment(Alignment.ALIGN_NORMAL).setIncludePad(true).build()
74+
} else StaticLayout(text, textPaint, widthLimit, Alignment.ALIGN_NORMAL, spacingMult, spacingAdd, true)
7375
// return early if we have more lines
7476
if (maxLines != NO_LINE_LIMIT && layout.lineCount > maxLines)
7577
return 1

build.gradle

+2-2
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.20'
4+
ext.kotlin_version = '1.3.21'
55
repositories {
66
jcenter()
77
google()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.0'
10+
classpath 'com.android.tools.build:gradle:3.3.1'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1212

1313
// NOTE: Do not place your application dependencies here; they belong

0 commit comments

Comments
 (0)