DynamicRecyclerView


Source link: https://github.com/ismoli/DynamicRecyclerView

DynamicRecyclerView

Set of light and non-invasive extensions for Android RecyclerView widget. Does not use custom RecyclerView or LayoutManager. With this extensions you can create RecyclerView with following features:

Drag and drop reordering.

  • Implemented using RecyclerView.OnItemTouchListener
  • Support for custom "Drag frame" drawable
  • ~350 LOC
Usage:
 dragDropTouchListener = new DragDropTouchListener(recyclerView, this) {

@Override

protected void onItemSwitch(RecyclerView recyclerView, int from, int to) {

 adapter.swapPositions(from, to);

 adapter.notifyItemChanged(to);

 adapter.notifyItemChanged(from);

@Override

 protected void onItemDrop(RecyclerView recyclerView, int position) {

}

 
}
;
 
}

recyclerView.addOnItemTouchListener(dragDropTouchListener);

Swipe to dismiss items

This is port of Roman Nurik's SwipeToDismiss for ListView

  • Implemented using RecyclerView.OnItemTouchListener
  • Configurable swipe directions: only left, only right, both, none
  • ~320 LOC
Usage:
 swipeToDismissTouchListener = new SwipeToDismissTouchListener(recyclerView, new SwipeToDismissTouchListener.DismissCallbacks() {

 @Override

public SwipeToDismissTouchListener.SwipeDirection canDismiss(int position) {

 return SwipeToDismissTouchListener.SwipeDirection.RIGHT;

}

 @Override

public void onDismiss(RecyclerView view, List<SwipeToDismissTouchListener.PendingDismissData> dismissData) {

for (SwipeToDismissTouchListener.PendingDismissData data : dismissData) {

 adapter.removeItem(data.position);

 adapter.notifyItemRemoved(data.position);

}

}

 
}
);

recyclerView.addOnItemTouchListener(swipeToDismissTouchListener);

Select/activate items

  • Small RecyclerViewAdapter extension that can keep a state of selected/activated items
Usage

Use as normal RecyclerView.Adapter

ItemTouchListenerAdapter

As RecyclerView does not have standard way to add click listeners to the items, this RecyclerView.OnItemTouchListener intercepts touch events and translates them to simple onItemClick() and onItemLongClick() callbacks.

Usage
 recyclerView.addOnItemTouchListener(new ItemTouchListenerAdapter(recyclerView, this));

Sample

Sample app code is included, please see DemoActivity.

For full featured demo of real app see /du:/ tasks app on Google Play Store

Resources

A reusable fragment to display links to social networks, the Play Store as well as recommendation and support email links. The fragment tries to open installed apps on the user's device first and resorts to the web browser otherwise.

Simple multithread-friendly library for getting latest user locations using RxJava 2.

Easily set up phone authentication leveraging on different auth platform (Firebase, Sinch) of your choice.

An example project / library of sticky recyclerview.

This is contains below components:

  • StickyRecyclerAdapter
  • StaticLinearLayoutManager
  • StickyVerticalLayoutManager
  • MultiCheckableStickyAdapter

A Simple View Pager Indicator with animations.

Nice and simple DSL for Espresso in Kotlin.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes