Skip to content

Commit afa8327

Browse files
committed
Update button to use MaterialButton
1 parent aa27cf4 commit afa8327

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ apply plugin: 'kotlin-android-extensions'
77
apply plugin: 'com.novoda.bintray-release'
88

99
android {
10-
compileSdkVersion 28
10+
compileSdkVersion 29
1111
defaultConfig {
1212
minSdkVersion 19
13-
targetSdkVersion 28
13+
targetSdkVersion 29
1414
}
1515
buildTypes {
1616
release {
@@ -26,8 +26,8 @@ android {
2626

2727
dependencies {
2828
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
29-
implementation 'androidx.appcompat:appcompat:1.0.0'
30-
implementation 'com.google.android.material:material:1.0.0'
29+
implementation 'androidx.appcompat:appcompat:1.1.0'
30+
implementation 'com.google.android.material:material:1.1.0'
3131
implementation 'com.github.bufferapp:CounterView:115e659a89'
3232
}
3333

@@ -36,7 +36,7 @@ publish {
3636
userOrg = 'buffer'
3737
groupId = 'org.buffer.android'
3838
artifactId = 'android-components'
39-
publishVersion = '0.3'
39+
publishVersion = '0.4'
4040
desc = 'An Android library for frequently used UI components'
4141
website = 'https://github.com/bufferapp/android-components'
4242
}

app/src/main/java/org/buffer/android/components/RoundedButton.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import androidx.core.content.ContextCompat
77
import androidx.appcompat.widget.AppCompatButton
88
import android.util.AttributeSet
99
import android.view.Gravity.CENTER
10+
import com.google.android.material.button.MaterialButton
1011

1112
class RoundedButton @JvmOverloads constructor(
1213
context: Context,
1314
attrs: AttributeSet? = null,
1415
defStyleAttr: Int = 0
15-
) : AppCompatButton(context, attrs, defStyleAttr) {
16+
) : MaterialButton(context, attrs, defStyleAttr) {
1617

1718
init {
1819
setBackground(attrs)
@@ -22,8 +23,7 @@ class RoundedButton @JvmOverloads constructor(
2223
}
2324

2425
private fun setBackground(attrs: AttributeSet? = null) {
25-
val style = ButtonStyle.fromIdentifier(getStyleIdentifierFromStyleableAttributes(attrs))
26-
when (style) {
26+
when (ButtonStyle.fromIdentifier(getStyleIdentifierFromStyleableAttributes(attrs))) {
2727
ButtonStyle.DARK -> {
2828
setTextColor(ContextCompat.getColorStateList(context,
2929
R.color.selector_dark_button_text))

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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.41'
4+
ext.kotlin_version = '1.3.61'
55
repositories {
66
google()
77
maven { url 'https://maven.fabric.io/public' }
@@ -10,7 +10,7 @@ buildscript {
1010
jcenter()
1111
}
1212
dependencies {
13-
classpath 'com.android.tools.build:gradle:3.5.1'
13+
classpath 'com.android.tools.build:gradle:3.5.3'
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1515
classpath 'com.novoda:bintray-release:0.9.1'
1616

0 commit comments

Comments
 (0)