Skip to content

Commit 2006f6b

Browse files
committed
Update README
1 parent 625e6a6 commit 2006f6b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,20 @@ Config `TextButton` in xml:
2727
android:layout_width="wrap_content"
2828
android:layout_height="wrap_content"
2929
android:text="animateTextColor"
30-
android:padding="8dp"
31-
android:textSize="24sp"
30+
android:padding="4dp"
31+
android:textSize="16sp"
3232
app:defaultTextColor="@android:color/holo_blue_dark"
3333
app:pressedTextColor="@android:color/holo_orange_dark"
3434
app:disabledTextColor="@android:color/darker_gray"
3535
app:underline="true"
3636
app:effectDuration="200"
37-
app:effect="animateTextColor"/>
37+
app:textEffect="animateColor"
38+
app:backgroundEffect="ripple"/>
3839
```
3940

40-
We support four effects for now: `default`, `animateTextColor`, `animateTextSize` and `animateTextColorAndSize`.
41+
There are 4 text effects: `default`, `animateColor`, `animateSize` and `animateColorAndSize` and 3 background effects: `colorState`, `ripple`, `animateColor` for now.
42+
43+
See [`top_defaults_view_attrs.xml`](./text-button/src/main/res/values/top_defaults_view_attrs.xml) for all supported attributes.
4144

4245
### Implement your own effect
4346

@@ -52,12 +55,12 @@ button5.setEffect(new TextButtonEffect() {
5255

5356
@Override
5457
public void actionDown() {
55-
textButton.setVisibility(View.INVISIBLE);
58+
textButton.setAlpha(0.5f);
5659
}
5760

5861
@Override
5962
public void actionUp() {
60-
textButton.setVisibility(View.VISIBLE);
63+
textButton.setAlpha(1);
6164
}
6265
});
6366
```

app/src/main/java/top/defaults/textbuttonapp/TextButtonApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public class TextButtonApplication extends Application {
1111
public void onCreate() {
1212
super.onCreate();
1313
TextButton.Defaults defaults = TextButton.Defaults.get();
14-
defaults.set(top.defaults.view.textbutton.R.styleable.TextButton_backgroundEffect, TextButtonEffect.BACKGROUND_EFFECT_RIPPLE);
14+
defaults.set(top.defaults.view.textbutton.R.styleable.TextButton_selectedTextColor, 0xff0000ff); // Blue
1515
}
1616
}

0 commit comments

Comments
 (0)