[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7552":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},7552,"drag-select-recyclerview","afollestad\u002Fdrag-select-recyclerview","afollestad","👇 Easy Google Photos style multi-selection for RecyclerViews, powered by Kotlin and AndroidX.","https:\u002F\u002Faf.codes",null,"Kotlin",1984,232,1985,3,0,1,55.2,"Apache License 2.0",true,false,"master",[24,25,26,27,28,29,30,31],"android","androidx","drag-selection","google-photos","recyclerview","selection","ui","ux","2026-06-12 04:00:34","# Drag Select Recycler View\n\n[ ![Maven Central](https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fcom.afollestad\u002Fdrag-select-recyclerview?style=flat&label=Maven+Central) ](https:\u002F\u002Frepo1.maven.org\u002Fmaven2\u002Fcom\u002Fafollestad\u002Fdrag-select-recyclerview)\n[![Android CI](https:\u002F\u002Fgithub.com\u002Fafollestad\u002Fdrag-select-recyclerview\u002Fworkflows\u002FAndroid%20CI\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fafollestad\u002Fdrag-select-recyclerview\u002Factions?query=workflow%3A%22Android+CI%22)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202-4EB1BA.svg?style=flat-square)](https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0.html)\n\nThis library allows you to implement Google Photos style multi-selection in your apps! You start\nby long pressing an item in your list, then you drag your finger without letting go to select more.\n\n![Range Mode GIF](https:\u002F\u002Fgithub.com\u002Fafollestad\u002Fdrag-select-recyclerview\u002Fraw\u002Fmaster\u002Fart\u002Frange.gif)\n\n# Sample\n\nYou can [download a sample APK](https:\u002F\u002Fgithub.com\u002Fafollestad\u002Fdrag-select-recyclerview\u002Fraw\u002Fmaster\u002Fsample\u002Fsample.apk).\n\n---\n\n# Gradle Dependency\n\nThe Gradle dependency is available via [jCenter](https:\u002F\u002Fbintray.com\u002Fdrummer-aidan\u002Fmaven\u002Fmaterial-camera\u002Fview).\njCenter is the default Maven repository used by Android Studio.\n\n## Dependency\n\nAdd the following to your module's `build.gradle` file:\n\n```Gradle\ndependencies {\n\n  implementation 'com.afollestad:drag-select-recyclerview:2.4.0'\n}\n```\n\n---\n\n# Introduction\n\n`DragSelectTouchListener` is the main class of this library.\n\nThis library will handle drag interception and auto scroll logic - if you drag to the top of the RecyclerView,\nthe list will scroll up, and vice versa.\n\n---\n\n# DragSelectTouchListener\n\n### Basics\n\n`DragSelectTouchListener` attaches to your RecyclerViews. It intercepts touch events\nwhen it's active, and reports to a receiver which handles updating UI\n\n```kotlin\nval receiver: DragSelectReceiver = \u002F\u002F ...\nval touchListener = DragSelectTouchListener.create(context, receiver)\n```\n\n### Configuration\n\nThere are a few things that you can configure, mainly around auto scroll.\n\n```kotlin\nDragSelectTouchListener.create(context, adapter) {\n  \u002F\u002F Configure the auto-scroll hotspot\n  hotspotHeight = resources.getDimensionPixelSize(R.dimen.default_56dp)\n  hotspotOffsetTop = 0 \u002F\u002F default\n  hotspotOffsetBottom = 0 \u002F\u002F default\n  \n  \u002F\u002F Listen for auto scroll start\u002Fend\n  autoScrollListener = { isScrolling -> } \n\n  \u002F\u002F Or instead of the above...\n  disableAutoScroll()\n  \n  \u002F\u002F The drag selection mode, RANGE is the default\n  mode = RANGE\n}\n```\n\nThe auto-scroll hotspot is a invisible section at the top and bottom of your\nRecyclerView, when your finger is in one of those sections, auto scroll is\ntriggered and the list will move up or down until you lift your finger.\n\nIf you use `PATH` as the mode instead of `RANGE`, the behavior is a bit different:\n\n![Path Mode GIF](https:\u002F\u002Fgithub.com\u002Fafollestad\u002Fdrag-select-recyclerview\u002Fraw\u002Fmaster\u002Fart\u002Fpath.gif)\n\nCompare it to the GIF at the top.\n\n---\n\n# Interaction\n\nA receiver looks like this:\n\n```kotlin\nclass MyReceiver : DragSelectReceiver {\n\n  override fun setSelected(index: Int, selected: Boolean) {\n    \u002F\u002F do something to mark this index as selected\u002Funselected\n    if(selected && !selectedIndices.contains(index)) {\n      selectedIndices.add(index)\n    } else if(!selected) {\n      selectedIndices.remove(index)\n    }\n  }\n  \n  override fun isSelected(index: Int): Boolean {\n    \u002F\u002F return true if this index is currently selected\n    return selectedItems.contains(index)\n  }\n  \n  override fun isIndexSelectable(index: Int): Boolean {\n    \u002F\u002F if you return false, this index can't be used with setIsActive()\n    return true\n  }\n\n  override fun getItemCount(): Int {\n    \u002F\u002F return size of your data set\n    return 0\n  }\n}\n```\n\nIn the sample project, our adapter is also our receiver.\n\nTo start drag selection, you use `setIsActive`, which should be triggered\nfrom user input such as a long press on a list item.\n\n```kotlin\nval recyclerView: RecyclerView = \u002F\u002F ...\nval receiver: DragSelectReceiver = \u002F\u002F ...\n\nval touchListener = DragSelectTouchListener.create(context, receiver)\nrecyclerView.addOnItemTouchListener(touchListener) \u002F\u002F important!!\n\n\u002F\u002F true for active = true, 0 is the initial selected index\ntouchListener.setIsActive(true, 0)\n````\n","这个项目提供了一种在Android应用中实现类似Google Photos风格多选功能的库，特别适用于RecyclerView。它使用Kotlin和AndroidX技术栈开发，支持通过长按列表项并拖动手指来选择多个项目。其核心功能包括触摸事件拦截、自动滚动逻辑处理以及多种选择模式（如范围选择和路径选择）。该库非常适合需要为用户提供流畅且直观的多选体验的应用场景，比如图片浏览与管理应用。",2,"2026-06-11 03:13:01","top_language"]