-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from Merseyside/develop
Develop
- Loading branch information
Showing
113 changed files
with
1,542 additions
and
1,333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
...d/src/main/java/com/merseyside/merseyLib/archy/android/di/state/AndroidKoinStateHolder.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...erseyside/merseyLib/archy/android/presentation/recycler/PaginationUpDownScrollListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.merseyside.merseyLib.archy.android.presentation.recycler | ||
|
||
import android.view.View | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.merseyside.merseyLib.kotlin.utils.safeLet | ||
|
||
abstract class PaginationUpDownScrollListener( | ||
protected val loadItemsCountDownOffset: Int = 5, | ||
protected val loadItemsCountUpOffset: Int = loadItemsCountDownOffset, | ||
) : RecyclerView.OnChildAttachStateChangeListener { | ||
|
||
abstract val recyclerView: RecyclerView | ||
abstract val onLoadNextPageDown: () -> Unit | ||
abstract val onLoadNextPageUp: () -> Unit | ||
|
||
override fun onChildViewAttachedToWindow(view: View) { | ||
if (needToLoadDownNextPage(view)) onLoadNextPageDown() | ||
if (needToLoadUpNextPage(view)) onLoadNextPageUp() | ||
} | ||
|
||
override fun onChildViewDetachedFromWindow(view: View) {} | ||
|
||
private fun needToLoadDownNextPage(view: View): Boolean { | ||
with(recyclerView) { | ||
val lastPosition = getChildAdapterPosition(view) | ||
val itemCount = adapter?.itemCount | ||
return safeLet(itemCount) { counts -> | ||
(counts - lastPosition) <= loadItemsCountDownOffset | ||
} ?: false | ||
} | ||
} | ||
|
||
private fun needToLoadUpNextPage(view: View): Boolean { | ||
with(recyclerView) { | ||
val lastPosition = getChildAdapterPosition(view) | ||
return lastPosition == loadItemsCountUpOffset | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
object Application { | ||
const val applicationId = "com.merseyside.sample" | ||
|
||
const val compileSdk = 33 | ||
const val targetSdk = 33 | ||
const val compileSdk = 34 | ||
const val targetSdk = 34 | ||
const val minSdk = 21 | ||
} |
Oops, something went wrong.