Skip to content

Commit

Permalink
feat: Added accept button color
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielGreenEngineer committed Oct 4, 2024
1 parent 6172da2 commit 0cc47e2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ class AlertText @JvmOverloads constructor(
textSize = 16f
gravity = Gravity.START
setTextColor(ResourcesCompat.getColor(resources, android.R.color.black, null))

setPadding(0, 0, 0, 0)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/large_margin"
android:orientation="horizontal"
android:paddingTop="@dimen/large_margin">

Expand Down Expand Up @@ -37,7 +38,7 @@
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"
app:buttonColor="@color/colorPrimary"
app:buttonColor="@color/buttonAcceptColor"
app:buttonText="@string/alert_dialog_button_accept_title"
app:textColor="@color/white"
app:textSize="18sp" />
Expand Down
3 changes: 2 additions & 1 deletion personalization-sdk/src/main/res/layout/alert_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
android:layout_height="wrap_content"
android:background="@drawable/rounded_background"
android:orientation="vertical"
android:paddingHorizontal="@dimen/large_margin"
android:paddingTop="@dimen/large_margin"
android:translationY="-16dp">

<include
android:id="@+id/textContainer"
layout="@layout/alert_text_container"
android:layout_marginStart="@dimen/large_margin"
android:layout_marginEnd="18dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

Expand Down
1 change: 1 addition & 0 deletions personalization-sdk/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
<color name="colorRed">#FF0000</color>
<color name="colorGreen">#00FF00</color>
<color name="colorWhite">#FFFFFF</color>
<color name="buttonAcceptColor">#3B82F6</color>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ abstract class AbstractMainActivity<out T : SDK> internal constructor(
buttonNegativeText = buttonNegative,
buttonPositiveText = buttonPositive,
buttonNegativeColor = ContextCompat.getColor(this, R.color.colorGray),
buttonPositiveColor = ContextCompat.getColor(this, R.color.colorPrimary),
buttonPositiveColor = ContextCompat.getColor(this, R.color.buttonAcceptColor),
onNegativeClick = {
Log.d(this.localClassName, ": onNegativeClick")
},
Expand Down
1 change: 1 addition & 0 deletions sample/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
<color name="colorRed">#FF0000</color>
<color name="colorGreen">#00FF00</color>
<color name="colorWhite">#FFFFFF</color>
<color name="buttonAcceptColor">#3B82F6</color>
</resources>

0 comments on commit 0cc47e2

Please sign in to comment.