Skip to content

Commit

Permalink
🚀 4.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemilla committed Nov 18, 2024
1 parent 6184ef8 commit ecc1f36
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 30 deletions.
23 changes: 0 additions & 23 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ dependencyResolutionManagement {

```gradle
dependencies {
implementation 'com.github.trycourier:courier-android:4.6.3' // Groovy
implementation("com.github.trycourier:courier-android:4.6.3") // Gradle.kts
implementation 'com.github.trycourier:courier-android:4.6.4' // Groovy
implementation("com.github.trycourier:courier-android:4.6.4") // Gradle.kts
}
```

Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/courier/android/Courier.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Courier private constructor(val context: Context) : Application.ActivityLi
companion object {

// Core
private const val VERSION = "4.6.3"
private const val VERSION = "4.6.4"
var agent: CourierAgent = CourierAgent.NativeAndroid(VERSION)

// Push
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,13 @@ var Courier.inboxPaginationLimit
val Courier.inboxData
get() = courierInboxData

fun Courier.getInboxMessages(feed: InboxMessageFeed): List<InboxMessage> {
return when (feed) {
InboxMessageFeed.FEED -> inboxData?.feed?.messages ?: emptyList()
InboxMessageFeed.ARCHIVE -> inboxData?.archived?.messages ?: emptyList()
}
}

/**
* Traditional Callbacks
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ open class CourierInbox @JvmOverloads constructor(context: Context, attrs: Attri
}
}

private val pages: List<Page> = listOf(
internal val pages: List<Page> = listOf(
Page(title = "Notifications", list = makeListView(InboxMessageFeed.FEED, context, attrs, defStyleAttr)),
Page(title = "Archived", list = makeListView(InboxMessageFeed.ARCHIVE, context, attrs, defStyleAttr))
)
Expand Down Expand Up @@ -274,6 +274,9 @@ enum class InboxMessageFeed { FEED, ARCHIVE }
* Extensions
*/

fun CourierInbox.scrollToTop() {
// recyclerView.smoothScrollToPosition(0)
fun CourierInbox.scrollToTop(feed: InboxMessageFeed) {
when (feed) {
InboxMessageFeed.FEED -> pages[0].list.recyclerView.smoothScrollToPosition(0)
InboxMessageFeed.ARCHIVE -> pages[1].list.recyclerView.smoothScrollToPosition(0)
}
}

0 comments on commit ecc1f36

Please sign in to comment.