Skip to content

Commit

Permalink
Release v4.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
amirisback committed Mar 25, 2024
1 parent 5d67208 commit d7946c2
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 41 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
- Using Kotlin DSL build.gradle.kts
- Elegant call using injector()
- Shimmer Effect, Empty View Effect, Nested Recycler View, Progress Recycler View
- BETA DIFF UTIL
- Using Diff Util
- Flexbox Layout Manager
- Default Value Of Layout Manager

<a href="https://play.google.com/store/apps/details?id=com.frogobox.apprecycler">
<img width="200px" height="75px" src="https://amirisback.github.io/amirisback/docs/image/google-play-badge.png">
Expand Down Expand Up @@ -46,7 +48,7 @@
## Version Release
This Is Latest Release

$version_release = 4.4.0-Beta
$version_release = 4.4.1

What's New??

Expand Down Expand Up @@ -91,14 +93,14 @@ allprojects {

dependencies {
// library frogo-recycler-view
implementation 'com.github.amirisback:frogo-recycler-view:4.4.0-Beta'
implementation 'com.github.amirisback:frogo-recycler-view:4.4.1'
}

#### <Option 2> Kotlin DSL Gradle

dependencies {
// library frogo-recycler-view
implementation("com.github.amirisback:frogo-recycler-view:4.4.0-Beta")
implementation("com.github.amirisback:frogo-recycler-view:4.4.1")
}

### Step 3. Create xml view
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 @@ -23,7 +23,7 @@ object ProjectSetting {

const val VERSION_MAJOR = 4
const val VERSION_MINOR = 4
const val VERSION_PATCH = 0
const val VERSION_PATCH = 1

const val PROJECT_MIN_SDK = Version.Gradle.minSdk
const val PROJECT_COMPILE_SDK = Version.Gradle.compileSdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ abstract class CoreFrogoRecyclerViewAdapter<T, VH : CoreFrogoRecyclerViewHolder<

protected val listData = mutableListOf<T>()

protected var notifyListener = this

protected val asyncListDiffer = AsyncListDiffer(this, object : DiffUtil.ItemCallback<T>() {
override fun areItemsTheSame(oldItem: T & Any, newItem: T & Any): Boolean {
return adapterAreItemsTheSame(oldItem, newItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ interface FrogoDiffUtilCallback<T> {

fun areItemsTheSame(oldItem: T, newItem: T): Boolean


fun areContentsTheSame(oldItem: T, newItem: T): Boolean

// DiffUtils --------------------------------

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import androidx.viewbinding.ViewBinding
abstract class FrogoRecyclerBindingAdapter<T, VB : ViewBinding> :
CoreFrogoRecyclerViewAdapter<T, FrogoRecyclerBindingHolder<T, VB>>() {

protected var bindingListener: FrogoRecyclerBindingListener<T, VB>? = null
protected var listener: FrogoRecyclerBindingListener<T, VB>? = null

override fun adapterAreContentsTheSame(oldItem: T & Any, newItem: T & Any): Boolean {
return bindingListener?.areContentsTheSame(oldItem, newItem) ?: false
return listener?.areContentsTheSame(oldItem, newItem) ?: false
}

override fun adapterAreItemsTheSame(oldItem: T & Any, newItem: T & Any): Boolean {
return bindingListener?.areItemsTheSame(oldItem, newItem) ?: false
return listener?.areItemsTheSame(oldItem, newItem) ?: false
}


Expand All @@ -38,14 +38,14 @@ abstract class FrogoRecyclerBindingAdapter<T, VB : ViewBinding> :

override fun onBindViewHolder(holder: FrogoRecyclerBindingHolder<T, VB>, position: Int) {
holder.bindItem(
asyncListDiffer.currentList[position],
position,
bindingListener,
notifyListener
data = asyncListDiffer.currentList[position],
position = position,
bindingListener = listener,
notifylistener = this
)
}

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

if (data != null) {
Expand All @@ -54,13 +54,13 @@ abstract class FrogoRecyclerBindingAdapter<T, VB : ViewBinding> :
}
}

fun setupListener(bindingListener: FrogoRecyclerBindingListener<T, VB>?) {
open fun setupListener(bindingListener: FrogoRecyclerBindingListener<T, VB>?) {
if (bindingListener != null) {
this.bindingListener = bindingListener
this.listener = bindingListener
}
}

fun setupRequirement(
open fun setupRequirement(
data: List<T>?,
bindingListener: FrogoRecyclerBindingListener<T, VB>?
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ abstract class FrogoRecyclerViewAdapter<T> :
var hasMultiHolder = false
var hasNestedView = false

protected var viewListener: FrogoRecyclerViewListener<T>? = null
protected var listener: FrogoRecyclerViewListener<T>? = null

protected val listPosition = HashMap<Int, Int>()
protected val sharedPool = RecyclerView.RecycledViewPool()

protected val frogoHolder = mutableListOf<FrogoHolder<T>>()

protected val listDataNested = mutableListOf<MutableList<T>>()
protected var listCount = 0

Expand All @@ -43,11 +44,11 @@ abstract class FrogoRecyclerViewAdapter<T> :
protected var emptyLayoutResId: Int = R.layout.frogo_rv_container_empty_view

override fun adapterAreContentsTheSame(oldItem: T & Any, newItem: T & Any): Boolean {
return viewListener?.areContentsTheSame(oldItem, newItem) ?: false
return listener?.areContentsTheSame(oldItem, newItem) ?: false
}

override fun adapterAreItemsTheSame(oldItem: T & Any, newItem: T & Any): Boolean {
return viewListener?.areItemsTheSame(oldItem, newItem) ?: false
return listener?.areItemsTheSame(oldItem, newItem) ?: false
}

fun bindNestedHolder() {
Expand Down Expand Up @@ -93,36 +94,36 @@ abstract class FrogoRecyclerViewAdapter<T> :
if (hasEmptyView) {
if (frogoHolder.size != 0) {
holder.bindItem(
frogoHolder[position].data,
position,
frogoHolder[position].viewListener,
notifyListener
data = frogoHolder[position].data,
position = position,
viewListener = frogoHolder[position].viewListener,
notifyListener = this
)
}
} else {
holder.bindItem(
frogoHolder[position].data,
position,
frogoHolder[position].viewListener,
notifyListener
data = frogoHolder[position].data,
position = position,
viewListener = frogoHolder[position].viewListener,
notifyListener = this
)
}
} else {
if (hasEmptyView) {
if (asyncListDiffer.currentList.size != 0) {
holder.bindItem(
asyncListDiffer.currentList[position],
position,
viewListener,
notifyListener
data = asyncListDiffer.currentList[position],
position = position,
viewListener = listener,
notifyListener = this
)
}
} else {
holder.bindItem(
asyncListDiffer.currentList[position],
position,
viewListener,
notifyListener
data = asyncListDiffer.currentList[position],
position = position,
viewListener = listener,
notifyListener = this
)
}
}
Expand Down Expand Up @@ -216,7 +217,7 @@ abstract class FrogoRecyclerViewAdapter<T> :

open fun setupListener(listener: FrogoRecyclerViewListener<T>?) {
if (listener != null) {
viewListener = listener
this.listener = listener
}
}

Expand Down

0 comments on commit d7946c2

Please sign in to comment.