Skip to content

Commit bcbdffb

Browse files
committed
Use rounded button style by default
1 parent 91ee5c6 commit bcbdffb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import android.content.Context
55
import androidx.core.content.ContextCompat
66
import android.util.AttributeSet
77
import android.view.Gravity.CENTER
8+
import androidx.appcompat.view.ContextThemeWrapper
89
import com.google.android.material.button.MaterialButton
910

1011
class RoundedButton @JvmOverloads constructor(
1112
context: Context,
12-
attrs: AttributeSet? = null,
13+
attrs: AttributeSet,
1314
defStyleAttr: Int = 0
14-
) : MaterialButton(context, attrs, defStyleAttr) {
15+
) : MaterialButton(ContextThemeWrapper(context, R.style.RoundedButtonStyle), attrs, defStyleAttr) {
1516

1617
init {
1718
setBackground(attrs)

sample/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
android:layout_height="wrap_content"
1212
android:text="Hello World!"
1313
android:enabled="true"
14-
style="@style/RoundedButtonStyle"
15-
app:bufferButtonStyle="clear"
14+
app:bufferButtonStyle="light"
1615
app:layout_constraintBottom_toBottomOf="parent"
1716
app:layout_constraintLeft_toLeftOf="parent"
1817
app:layout_constraintRight_toRightOf="parent"

0 commit comments

Comments
 (0)