Skip to content

Instantly share code, notes, and snippets.

💭
hiii

Ataul Munim ataulm

💭
hiii
Block or report user

Report or block ataulm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MonzoButton.kt
private val DEF_STYLE_ATTR = R.attr.monzoButtonStyle
class MonzoButton(ctx: Context, attrs: AttributeSet) : AppCompatButton(
wrapContext(ctx, attrs),
attrs,
DEF_STYLE_ATTR
) {
companion object {
fun wrapContext(context: Context, attrs: AttributeSet): Context {
View themes.xml
<style name="ThemeOverlay.Monzo.MonzoButton.Pill" parent="">
<!-- any value larger than `button.height / 2` -->
<item name="monzoButtonCornerRadius">1000dp</item>
</style>
View button_background_shape.xml
<shape android:shape="rectangle">
<corners android:radius="?attr/monzoButtonCornerRadius" />
<!-- ... -->
View widgets.xml
<style name="Widget.Monzo.CompoundButton.CheckBox" parent="Widget.MaterialComponents.CompoundButton.CheckBox">
<item name="android:textColor">?attr/mdsColorPrimaryContent</item>
<item name="materialThemeOverlay">@style/ThemeOverlay.Monzo.CompoundButton</item>
</style>
<style name="Widget.Monzo.CompoundButton.RadioButton" parent="Widget.MaterialComponents.CompoundButton.RadioButton">
<item name="android:textColor">?attr/mdsColorPrimaryContent</item>
<item name="materialThemeOverlay">@style/ThemeOverlay.Monzo.CompoundButton</item>
</style>
View themes.xml
<style name="ThemeOverlay.Monzo.CompoundButton" parent="">
<item name="colorSecondary">?attr/mdsColorBlueTint</item>
</style>
View layout.xml
<androidx.appcompat.widget.Toolbar
android:id="@+id/loanCalculatorToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.Monzo.Toolbar.LoansNavy" />
View themes.xml
<style name="ThemeOverlay.Monzo.Toolbar.Loans" parent="">
<item name="colorPrimary">@color/navy</item>
<item name="colorOnPrimary">@color/white</item>
</style>
View res_values-v23_widgets.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.Monzo.CompoundButton.CheckBox.OnLight" />
<style name="Widget.Monzo.CompoundButton.CheckBox.OnDark" />
</resources>
View themes.xml
<style name="Theme.Monzo.Light" parent="Base.Theme.Monzo">
<item name="checkboxStyle">@style/Widget.Monzo.CompoundButton.CheckBox.OnLight</item>
<!-- ... -->
</style>
<style name="Theme.Monzo.Dark" parent="Base.Theme.Monzo">
<item name="checkboxStyle">@style/Widget.Monzo.CompoundButton.CheckBox.OnDark</item>
<!-- ... -->
</style>
View widgets.xml
<style name="Widget.Monzo.CompoundButton.CheckBox" parent="Widget.MaterialComponents.CompoundButton.CheckBox">
<item name="android:textColor">?attr/mdsColorContentPrimary</item>
<item name="materialThemeOverlay">@style/ThemeOverlay.Monzo.CompoundButton.CheckBox</item>
</style>
<style name="ThemeOverlay.Monzo.CompoundButton.CheckBox" parent="">
<item name="colorSecondary">?attr/mdsColorPrimary</item>
<item name="colorControlHighlight">@color/mds_content_primary_12</item>
</style>
You can’t perform that action at this time.