Skip to content

Commit d84dd12

Browse files
authored
Update AGP Dependency (#14)
Update AGP Dependency and Few Descriptions
1 parent b82d05e commit d84dd12

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id("com.android.application") version "8.1.2" apply false
3+
id("com.android.application") version "8.4.1" apply false
44
id("org.jetbrains.kotlin.android") version "1.9.10" apply false
5-
id("com.android.library") version "8.1.2" apply false
5+
id("com.android.library") version "8.4.1" apply false
66
id ("io.github.gradle-nexus.publish-plugin") version "1.1.0"
77
}
88

compose-recyclerview/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ android {
6161

6262
dependencies {
6363

64-
implementation("androidx.core:core-ktx:1.12.0")
64+
implementation("androidx.core:core-ktx:1.13.1")
6565
implementation("androidx.appcompat:appcompat:1.6.1")
66-
implementation("androidx.activity:activity-compose:1.8.2")
67-
implementation("com.google.android.material:material:1.11.0")
66+
implementation("androidx.activity:activity-compose:1.9.0")
67+
implementation("com.google.android.material:material:1.12.0")
6868
testImplementation("junit:junit:4.13.2")
6969
androidTestImplementation("androidx.test.ext:junit:1.1.5")
7070
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

compose-recyclerview/src/main/java/com/example/compose_recyclerview/ComposeRecyclerView.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import com.example.compose_recyclerview.utils.ItemTouchHelperConfig
3636
* @param itemTypeBuilder The optional lambda function to determine the type of each item.
3737
* * Required for effective drag and drop. Provide a non-null [ComposeRecyclerViewAdapter.ItemTypeBuilder] when enabling drag and drop functionality.
3838
* * Useful when dealing with multiple item types, ensuring proper handling and layout customization for each type.
39+
* * If not provided, the builder will be considered as null and drag-and-drop functionality will be disabled.
3940
* @param onDragCompleted Callback triggered when an item drag operation is completed.
4041
* @param itemTouchHelperConfig Configuration block for customizing the behavior of ItemTouchHelper.
4142
* * Specify non-draggable item types, handle drag-and-drop and swipe actions, customize the appearance during drag, and more.

compose-recyclerview/src/main/java/com/example/compose_recyclerview/utils/ItemTouchHelperConfig.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import androidx.recyclerview.widget.RecyclerView
1212
* @property getMovementFlags Callback for providing movement flags for drag and swipe behavior.
1313
* @property onSelectedChanged Callback for handling changes in the selection state of an item.
1414
* @property isLongPressDragEnabled Flag to enable or disable long press drag behavior.
15+
* @property swipeDirs Swipe directions for items. If not provided, all directions are enabled by default.
16+
* @property dragDirs Drag directions for items. If not provided, left or right directions are enabled by default.
1517
*/
1618
class ItemTouchHelperConfig {
1719
var nonDraggableItemTypes: Set<Int> = emptySet()
@@ -62,6 +64,7 @@ class ItemTouchHelperConfig {
6264

6365
/**
6466
* Flag to enable or disable long press drag behavior.
67+
* Default is true.
6568
*/
6669
var isLongPressDragEnabled: Boolean = true
6770

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Mon Dec 18 17:15:12 IST 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

sample-app/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ android {
5151
dependencies {
5252

5353
implementation(project(path = ":compose-recyclerview"))
54-
implementation("androidx.core:core-ktx:1.9.0")
55-
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
56-
implementation("androidx.activity:activity-compose:1.8.1")
57-
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
54+
implementation("androidx.core:core-ktx:1.13.1")
55+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0")
56+
implementation("androidx.activity:activity-compose:1.9.0")
57+
implementation(platform("androidx.compose:compose-bom:2024.05.00"))
5858
implementation("androidx.compose.ui:ui")
5959
implementation("androidx.compose.ui:ui-graphics")
6060
implementation("androidx.compose.ui:ui-tooling-preview")
6161
implementation("androidx.compose.material3:material3")
6262
testImplementation("junit:junit:4.13.2")
6363
androidTestImplementation("androidx.test.ext:junit:1.1.5")
6464
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
65-
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
65+
androidTestImplementation(platform("androidx.compose:compose-bom:2024.05.00"))
6666
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
6767
debugImplementation("androidx.compose.ui:ui-tooling")
6868
debugImplementation("androidx.compose.ui:ui-test-manifest")

sample-app/src/main/java/com/example/composerecyclerview/MainActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class MainActivity : ComponentActivity() {
6363
ComposeRecyclerView(
6464
modifier = Modifier.fillMaxSize(),
6565
items = listOf(1) + userDataList + listOf(1) + otherUsersDataList,
66-
itemBuilder = { item, index ->
66+
itemBuilder = { _, index ->
6767
if (index == 0) {
6868
Box(
6969
modifier = Modifier.fillMaxWidth(),
@@ -137,6 +137,8 @@ class MainActivity : ComponentActivity() {
137137
override fun getItemType(position: Int): Int {
138138
// Determine the item type based on the position
139139
// You can customize this logic based on your requirements
140+
// Required for effective drag and drop. Provide a non-null [ComposeRecyclerViewAdapter.ItemTypeBuilder]
141+
// when enabling drag and drop functionality.
140142
return when {
141143
position == 0 -> ITEM_TYPE_FIRST_HEADER // Header type
142144
position <= userDataList.size -> ITEM_TYPE_FIRST_LIST_ITEM // First list item type

0 commit comments

Comments
 (0)