This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bind ItemTouchHelper.SimpleCallback with RecyclerView | |
* | |
* @param recyclerView RecyclerView to bind to SwipeItemTouchHelperCallback | |
* @param swipeEnabled enable/disable swipe | |
* @param drawableSwipeLeft drawable shown when swiped left | |
* @param drawableSwipeRight drawable shown when swiped right | |
* @param bgColorSwipeLeft background color when swiped left | |
* @param bgColorSwipeRight background color when swiped right | |
* @param onItemSwipeLeft OnItemSwipeListener for swiped left |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bind ItemTouchHelper.SimpleCallback with RecyclerView | |
* | |
* @param recyclerView RecyclerView to bind to DragItemTouchHelperCallback | |
* @param dragEnabled enable/disable drag | |
* @param onItemDrag OnItemDragListener for dragged | |
*/ | |
@android.databinding.BindingAdapter(value = {"dragEnabled", "onItemDrag"}, requireAll = false) | |
public static void setItemDragToRecyclerView(RecyclerView recyclerView, boolean dragEnabled, | |
DragItemTouchHelperCallback.OnItemDragListener onItemDrag) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.v7.widget.RecyclerView | |
android:id="@+id/rv" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@android:color/white" | |
bind:dragEnabled="@{true}" | |
bind:onItemDrag="@{(indexFrom, indexTo) -> handler.onItemDragged(indexFrom, indexTo)}"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.v7.widget.RecyclerView | |
android:id="@+id/rv" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@android:color/white" | |
bind:bgColorSwipeLeft="@{@color/app_green}" | |
bind:bgColorSwipeRight="@{@color/app_red}" | |
bind:drawableSwipeLeft="@{@drawable/ic_check_white_24dp}" | |
bind:drawableSwipeRight="@{@drawable/ic_close_white_24dp}" | |
bind:onItemSwipeLeft="@{(position) -> handler.onItemSwipedLeft(position)}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textView.setText(new Truss() | |
.appendSelectiveln("With Snippety, you can use:", "Snippety", | |
new Snippety().textColor(Color.RED)) | |
.appendln() | |
.pushSpan(new Snippety().typeface(typeface)) // TextTypefaceSpan | |
.appendln("typeface for TypefaceSpan") | |
.popSpan() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CharSequence text = new Truss() | |
.pushSpan(new BackgroundColorSpan(Color.RED)) | |
.append("Hello Snippety") | |
.popSpan() | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CharSequence text = new Truss() | |
.append("Hello Snippety", new BackgroundColorSpan(Color.RED)) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CharSequence text = new Truss() | |
.append("Hello Snippety", new Snippety().backgroundColor(Color.RED)) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CharSequence text = new Truss() | |
.append("Hello Snippety", new Snippety().backgroundColor(Color.RED).textColor(Color.WHITE)) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textView.setText(new Truss() | |
.append(new Snippety().backgroundColor(Color.RED).textColor(Color.WHITE)) | |
.build()); |
OlderNewer