TransformableDrawableButton

Animated button with transitions between symbols.

License

License

Categories

Categories

ORM Data
GroupId

GroupId

com.fmsirvent
ArtifactId

ArtifactId

transformabledrawablebutton
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

aar
Description

Description

TransformableDrawableButton
Animated button with transitions between symbols.
Project URL

Project URL

https://github.com/narfss/TransformableDrawableButton
Source Code Management

Source Code Management

https://github.com/narfss/TransformableDrawableButton

Download transformabledrawablebutton

How to add to project

<!-- https://jarcasting.com/artifacts/com.fmsirvent/transformabledrawablebutton/ -->
<dependency>
    <groupId>com.fmsirvent</groupId>
    <artifactId>transformabledrawablebutton</artifactId>
    <version>1.1.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.fmsirvent/transformabledrawablebutton/
implementation 'com.fmsirvent:transformabledrawablebutton:1.1.1'
// https://jarcasting.com/artifacts/com.fmsirvent/transformabledrawablebutton/
implementation ("com.fmsirvent:transformabledrawablebutton:1.1.1")
'com.fmsirvent:transformabledrawablebutton:aar:1.1.1'
<dependency org="com.fmsirvent" name="transformabledrawablebutton" rev="1.1.1">
  <artifact name="transformabledrawablebutton" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.fmsirvent', module='transformabledrawablebutton', version='1.1.1')
)
libraryDependencies += "com.fmsirvent" % "transformabledrawablebutton" % "1.1.1"
[com.fmsirvent/transformabledrawablebutton "1.1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
com.nineoldandroids : library jar 2.4.0

Project Modules

There are no modules declared in this project.

TransformableDrawableButton

Android Arsenal

This library is a extension of the android's buttons. Using this extension you can add a switchable buttons with a common draws defined, and cool animations when you switch between them.

Do you need more explanation?

Round buttons Example.

Drawable on a side of button.

You can try the demo app on google play.

https://play.google.com/store/apps/details?id=com.fmsirvent.transformabledrawablebutton.app

Show me the code

Gradle dependencies:

compile 'com.fmsirvent:transformabledrawablebutton:1.1.1'

Code in layout:

<!-- add on top parent layout: xmlns:tdb="http://schemas.android.com/apk/res-auto" -->

<com.fmsirvent.transformabledrawablebutton.TransformableButton
    android:layout_width="60dp"
    android:layout_height="60dp"
    android:layout_gravity="center"
    android:layout_margin="30dp"
    tdb:unCheckDraw="plus"
    tdb:checkDraw="x"
    tdb:strokeColor="@android:color/holo_red_dark"
    tdb:backgroundColor="@android:color/black"/>

Creating widget programmatic way:

TransformableButton transformableButton = new TransformableButton(this, TransformableButton.Draw.MINUS, TransformableButton.Draw.PLUS, Color.BLACK, Color.GRAY, TransformableButton.PositionDraw.BACKGROUND);

Proguard:

-dontwarn com.fmsirvent.transformabledrawablebutton.**

Attributes

  • unCheckDraw : Values "plus", "minus", "x", "arrow_down", "arrow_left", "arrow_up", "arrow_right", "check", "arrow_down", "arrow_left", "arrow_up", "arrow_right", "menu". Default value "plus"
  • checkDraw : Values "plus", "minus", "x", "arrow_down", "arrow_left", "arrow_up", "arrow_right", "check", "arrow_down", "arrow_left", "arrow_up", "arrow_right", "menu". Default value "minus"
  • strokeColor : Color value. Default value dark gray.
  • backgroundColor : Color value. Default value white.
  • drawablePosition : Values "background", "left", "top", "right", "bottom". Default value "background".

Functions

  • Constructor TransformableButton(Context context, Draw unCheckDraw, Draw checkDraw, int strokeColor, int backgroundColor, PositionDraw positionDraw) unCheckDraw: Draw on uncheck status. Use Enum TransformableButton.Draw. Example: TransformableButton.Draw.PLUS strokeColor: Draw on check status. Use Enum TransformableButton.Draw. Example: TransformableButton.Draw.MINUS backgroundColor: Color of circle background. Example Color.RED positionDraw: Color of lines. Example Color.RED
  • setOnCheckedChangeListener void setOnCheckedChangeListener(OnCheckedChangeListener onCheckedChangeListener) onCheckedChangeListener: Listener of status changes, use TransformableButton.OnCheckedChangeListener.
  • isChecked Boolean isChecked() Check the status button. return: status of button (check = true, uncheck = false).
  • setChecked void setChecked(boolean checked, boolean animated) Changes the status button. checked: Status to set (check = true, uncheck = false) animated: Show animation of change. (true show animation)

Author

Francisco M Sirvent [email protected] Linkedin: https://es.linkedin.com/in/fmsirvent/

Based on HamburgerMenuDrawable, by: Thibault Guégan, [email protected] Linkedin: https://www.linkedin.com/profile/view?id=93515047

License

TransformableDrawableButton is available under the MIT license. See the LICENSE file for more info.

Versions

Version
1.1.1
1.1.0
1.0.0