- Notifications
You must be signed in to change notification settings - Fork2
⏹️ An easy to use `TextButton` when you need a TextView-like button, with handy touch feedback effects.
License
NotificationsYou must be signed in to change notification settings
duanhong169/TextButton
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An easy to useTextButton
when you need a TextView-like button, with handy touch feedback effects.
dependencies { implementation 'com.github.duanhong169:text-button:${latestVersion}' ...}
Replace
${latestVersion}
with the latest version code. Seereleases.
ConfigTextButton
in xml:
<top.defaults.view.TextButtonandroid:id="@+id/button3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="animateTextColor"android:padding="4dp"android:textSize="16sp"app:defaultTextColor="@android:color/holo_blue_dark"app:pressedTextColor="@android:color/holo_orange_dark"app:disabledTextColor="@android:color/darker_gray"app:underline="true"app:effectDuration="200"app:textEffect="animateColor"app:backgroundEffect="ripple"/>
There are 4 text effects:default
,animateColor
,animateSize
andanimateColorAndSize
and 3 background effects:colorState
,ripple
,animateColor
for now.
Seetop_defaults_view_attrs.xml
for all supported attributes.
button5.setEffect(newTextButtonEffect() {privateTextButtontextButton;@Overridepublicvoidinit(TextButtontextButton) {this.textButton =textButton; }@OverridepublicvoidactionDown() {textButton.setAlpha(0.5f); }@OverridepublicvoidactionUp() {textButton.setAlpha(1); }});
For more details, see the sample app.
See theLICENSE file.
About
⏹️ An easy to use `TextButton` when you need a TextView-like button, with handy touch feedback effects.
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published