Skip to content

Conversation

@MrStahlfelge
Copy link
Contributor

Our buttons use InsetDrawables for having an outer padding, this was not supported by the lib - it needed GradientDrawables. An InsetDrawable is a container that can hold an inner GradientDrawable.

This PR extends the lib to use the InsetDrawable as the background image while animating the inner GradientDrawable. I have unified the code for the two Progress Buttons.

You can test by using the following drawable xml as the button background:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

	<!-- Normal Buttons State -->
	<item>
		<inset android:insetLeft="4dp"
			   android:insetTop="4dp"
			   android:insetRight="4dp"
			   android:insetBottom="4dp">
			<shape android:shape="rectangle">
				<corners android:radius="2dp"/>
				<solid android:color="@color/cpb_red"/>
				<padding
					android:left="8dp"
					android:top="4dp"
					android:right="8dp"
					android:bottom="4dp"/>
			</shape>
		</inset>
	</item>
</selector>

This branch is based on my other PR.

@leandroBorgesFerreira leandroBorgesFerreira merged commit 8469a0c into leandroBorgesFerreira:master May 2, 2018
@MrStahlfelge MrStahlfelge deleted the feature/moreDrawables branch May 2, 2018 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants