Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

This Is Latest Release

$version_release = 2.3.3
$version_release = 2.3.4

What's New??

Expand Down Expand Up @@ -54,7 +54,7 @@ allprojects {
```groovy
dependencies {
// library frogo-sdk
implementation 'com.github.frogobox:frogo-sdk:2.3.3'
implementation 'com.github.frogobox:frogo-sdk:2.3.4'
}
```

Expand All @@ -63,14 +63,14 @@ dependencies {
```groovy
dependencies {
// library frogo-sdk
implementation("com.github.frogobox:frogo-sdk:2.3.3")
implementation("com.github.frogobox:frogo-sdk:2.3.4")
}
```

#### <Option 3> libs.versions.toml
```yml
[versions]
frogoAndroid = "2.3.3"
frogoAndroid = "2.3.4"

[libraries]
frogo-android = { group = "com.github.frogobox", name = "frogo-sdk", version.ref = "frogoAndroid" }
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/ProjectSetting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object ProjectSetting {

const val VERSION_MAJOR = 2
const val VERSION_MINOR = 3
const val VERSION_PATCH = 3
const val VERSION_PATCH = 4

// ---------------------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ abstract class FrogoRecyclerBindingAdapter<T, VB : ViewBinding> :
)
}

open fun setupData(data: List<T>?) {
this.asyncListDiffer.currentList.clear()
open fun getItem(): MutableList<T> = asyncListDiffer.currentList.toMutableList()

if (data != null) {
listData.addAll(data)
this.asyncListDiffer.submitList(listData)
open fun setItem(data: List<T>) {
if (data.isEmpty()) {
asyncListDiffer.submitList(listOf())
} else {
asyncListDiffer.submitList(data.map { it })
}
}

Expand All @@ -61,11 +62,11 @@ abstract class FrogoRecyclerBindingAdapter<T, VB : ViewBinding> :
}

open fun setupRequirement(
data: List<T>?,
data: List<T>,
bindingListener: FrogoRecyclerBindingListener<T, VB>?
) {
setupListener(bindingListener)
setupData(data)
setItem(data)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ abstract class FrogoRecyclerViewAdapter<T> :
} else {
if (hasMultiHolder) {
if (hasEmptyView) {
listCount = if (frogoHolder.size == 0) {
listCount = if (frogoHolder.isEmpty()) {
1
} else {
frogoHolder.size
Expand All @@ -73,7 +73,7 @@ abstract class FrogoRecyclerViewAdapter<T> :
}
} else {
if (hasEmptyView) {
listCount = if (asyncListDiffer.currentList.size == 0) {
listCount = if (asyncListDiffer.currentList.isEmpty()) {
1
} else {
asyncListDiffer.currentList.size
Expand All @@ -92,7 +92,7 @@ abstract class FrogoRecyclerViewAdapter<T> :
} else {
if (hasMultiHolder) {
if (hasEmptyView) {
if (frogoHolder.size != 0) {
if (frogoHolder.isNotEmpty()) {
holder.bindItem(
data = frogoHolder[position].data,
position = position,
Expand All @@ -110,7 +110,7 @@ abstract class FrogoRecyclerViewAdapter<T> :
}
} else {
if (hasEmptyView) {
if (asyncListDiffer.currentList.size != 0) {
if (asyncListDiffer.currentList.isNotEmpty()) {
holder.bindItem(
data = asyncListDiffer.currentList[position],
position = position,
Expand Down Expand Up @@ -206,12 +206,13 @@ abstract class FrogoRecyclerViewAdapter<T> :
}
}

open fun setupData(data: List<T>?) {
this.asyncListDiffer.currentList.clear()
open fun getItem(): MutableList<T> = asyncListDiffer.currentList.toMutableList()

if (data != null) {
listData.addAll(data)
this.asyncListDiffer.submitList(listData)
open fun setItem(data: List<T>) {
if (data.isEmpty()) {
asyncListDiffer.submitList(listOf())
} else {
asyncListDiffer.submitList(data.map { it })
}
}

Expand All @@ -227,11 +228,11 @@ abstract class FrogoRecyclerViewAdapter<T> :

open fun setupRequirement(
customViewId: Int,
data: List<T>?,
data: List<T>,
listener: FrogoRecyclerViewListener<T>?
) {
setupListener(listener)
setupData(data)
setItem(data)
setupCustomLayout(customViewId)
layoutHandling()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,24 @@ fun <T> RecyclerView.getAdapterExt(): FrogoViewAdapter<T> {
return this.adapter as FrogoViewAdapter<T>
}

fun <T> RecyclerView.setupData(data: List<T>) {
this.getAdapterExt<T>().setupData(data)
fun <T> RecyclerView.setItem(data: List<T>) {
this.getAdapterExt<T>().setItem(data)
}

fun <T> RecyclerView.getItem(): List<T> {
return this.getAdapterExt<T>().getItem()
}

fun <T, VB : ViewBinding> RecyclerView.getAdapterBindingExt(): FrogoBindingAdapter<T, VB> {
return this.adapter as FrogoBindingAdapter<T, VB>
}

fun <T, VB : ViewBinding> RecyclerView.setupDataBinding(data: List<T>) {
this.getAdapterBindingExt<T, VB>().setupData(data)
fun <T, VB : ViewBinding> RecyclerView.setItemBinding(data: List<T>) {
this.getAdapterBindingExt<T, VB>().setItem(data)
}

fun <T, VB : ViewBinding> RecyclerView.getItemBinding(): List<T> {
return this.getAdapterBindingExt<T, VB>().getItem()
}

fun RecyclerView.addOnBottomScrollListener(onBottomReached: () -> Unit = {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,24 @@ class FrogoRecyclerView : RecyclerView,
return this.adapter as FrogoViewAdapter<T>
}

override fun <T> setupData(data: List<T>) {
this.getAdapterExt<T>().setupData(data)
override fun <T> setItem(data: List<T>) {
this.getAdapterExt<T>().setItem(data)
}

override fun <T> getItem(): List<T> {
return this.getAdapterExt<T>().getItem()
}

override fun <T, VB : ViewBinding> getAdapterBindingExt(): FrogoBindingAdapter<T, VB> {
return this.adapter as FrogoBindingAdapter<T, VB>
}

override fun <T, VB : ViewBinding> setupDataBinding(data: List<T>) {
this.getAdapterBindingExt<T, VB>().setupData(data)
override fun <T, VB : ViewBinding> setItemBinding(data: List<T>) {
this.getAdapterBindingExt<T, VB>().setItem(data)
}

override fun <T, VB : ViewBinding> getItemBinding(): List<T> {
return this.getAdapterBindingExt<T, VB>().getItem()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ interface IFrogoRecyclerView {

fun <T> getAdapterExt(): FrogoViewAdapter<T>

fun <T> setupData(data: List<T>)
fun <T> setItem(data: List<T>)

fun <T> getItem(): List<T>

fun <T, VB : ViewBinding> getAdapterBindingExt(): FrogoBindingAdapter<T, VB>

fun <T, VB : ViewBinding> setupDataBinding(data: List<T>)
fun <T, VB : ViewBinding> setItemBinding(data: List<T>)

fun <T, VB : ViewBinding> getItemBinding(): List<T>

}