kuuuurt / multiplatform-paging

Kotlin Multiplatform library for Pagination
Apache License 2.0
250 stars 22 forks source link

Not able to find paging functions in Android #27

Open ahmedsalemelzeiny opened 2 years ago

ahmedsalemelzeiny commented 2 years ago

Hi @kuuuurt , I'm using the version 4.7 but on Android I can only access pagingData and I can't access loadNext or loadPrevious or any other functions.

    cocoapods {

            framework {
                export("io.github.kuuuurt:multiplatform-paging:0.4.7")
            }
        }

    sourceSets {
        val commonMain by getting {
            dependencies {
                api("io.github.kuuuurt:multiplatform-paging:0.4.7")
            }
        }
        val androidMain by getting {
            dependencies {

            }
        }

        val iosX64Main by getting
        val iosArm64Main by getting
        val iosSimulatorArm64Main by getting

        val iosMain by creating {
            dependsOn(commonMain)
            iosX64Main.dependsOn(this)
            iosArm64Main.dependsOn(this)
            iosSimulatorArm64Main.dependsOn(this)
            dependencies {
            }
        }
    }

Any insights ?

kuuuurt commented 2 years ago

Hi @ahmedsalemelzeiny. The loadNext and loadPrevious functions are for iOS only. For Android, you have to use the paging library and hook it to your adapter. The RecyclerView would handle the calls for loading the next or previous items.