• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

TextButton: An easy to use `TextButton` when you need a TextView-like button, wi ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

TextButton

开源软件地址:

https://gitee.com/duanhong169/TextButton

开源软件介绍:

Text Button gitHub release platform Android Arsenal license Build status

An easy to use TextButton 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. See releases.

Usage

Use the built-in effects

Config TextButton in xml:

<top.defaults.view.TextButton    android: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 and animateColorAndSize and 3 background effects: colorState, ripple, animateColor for now.

See top_defaults_view_attrs.xml for all supported attributes.

Implement your own effect

button5.setEffect(new TextButtonEffect() {    private TextButton textButton;    @Override    public void init(TextButton textButton) {        this.textButton = textButton;    }    @Override    public void actionDown() {        textButton.setAlpha(0.5f);    }    @Override    public void actionUp() {        textButton.setAlpha(1);    }});

For more details, see the sample app.

License

See the LICENSE file.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap