taltstidl / Swipeable-RecyclerView

A library that provides an easy and customizable way to implement a swipe to dismiss pattern with RecyclerView.
Apache License 2.0
87 stars 17 forks source link

Customisation of "undo" ? #20

Open skategui opened 7 years ago

skategui commented 7 years ago

Is it possible to rename the text "undo" by something else ? and change the color ?

Have not found anything about that :/

taltstidl commented 7 years ago

@skategui Hi there and sorry for the late response. You can customize the "undo" text by overriding the attribute action_undo in your strings.xml file:

<string name="action_undo">[custom "undo" text here]</string>

As to customizing the color, you might have success overriding the UndoButtonStyle style in your styles.xml by adding the following (though I haven't tried it yet):

<style name="UndoButtonStyle">
    <item name="android:background">?android:attr/selectableItemBackground</item>
    <item name="android:textColor">[custom text color here]</item>
    <item name="android:textSize">16sp</item>
</style>

There should probably be an easier way to adjust the styles of various views used in this library, but I currently don't have the time to implement any of this. If someone is willing to throw in a pull request for this please let me know and I'll guide you through this. Thanks!