Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

⏹️ 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

Repository files navigation

An easy to useTextButton when you need a TextView-like button, with handy touch feedback effects.

screen-record

Gradle

dependencies {    implementation 'com.github.duanhong169:text-button:${latestVersion}'    ...}

Replace${latestVersion} with the latest version code. Seereleases.

Usage

Use the built-in effects

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.

Implement your own effect

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.

License

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

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp