Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemilla committed Sep 13, 2023
1 parent ef0d918 commit c55cda8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencyResolutionManagement {

```gradle
dependencies {
implementation 'com.github.trycourier:courier-android:2.0.32'
implementation 'com.github.trycourier:courier-android:2.0.33'
}
```

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

// Android packages
api 'androidx.recyclerview:recyclerview:1.3.0' // TODO: And can we recycle in view items after refresh
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.8.0'
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 @@ -45,7 +45,7 @@ class Courier private constructor(internal val context: Context) {
companion object {

var USER_AGENT = CourierAgent.NATIVE_ANDROID
internal const val VERSION = "2.0.32"
internal const val VERSION = "2.0.33"
internal const val TAG = "Courier SDK"
internal const val COURIER_PENDING_NOTIFICATION_KEY = "courier_pending_notification_key"
internal val eventBus by lazy { NotificationEventBus() }
Expand Down
31 changes: 26 additions & 5 deletions android/src/main/java/com/courier/android/inbox/CourierInbox.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import android.content.res.ColorStateList
import android.net.Uri
import android.util.AttributeSet
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.RelativeLayout
import android.widget.TextView
import android.widget.*
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isVisible
import androidx.recyclerview.widget.ConcatAdapter
Expand Down Expand Up @@ -260,6 +256,8 @@ class CourierInbox @JvmOverloads constructor(context: Context, attrs: AttributeS
},
onMessagesChanged = { messages, unreadMessageCount, totalMessageCount, canPaginate ->

mRequestedLayout = false

refreshBrand()

state = if (messages.isEmpty()) State.EMPTY.apply { title = "No messages found" } else State.CONTENT
Expand Down Expand Up @@ -427,6 +425,29 @@ class CourierInbox @JvmOverloads constructor(context: Context, attrs: AttributeS
onScrollInbox = listener
}

// Fixes for React Native UI bugs

private var mRequestedLayout = false

@SuppressLint("WrongCall")
override fun requestLayout() {
super.requestLayout()

// We need to intercept this method because if we don't our children will never update
// Check https://stackoverflow.com/questions/49371866/recyclerview-wont-update-child-until-i-scroll

if (!mRequestedLayout) {
mRequestedLayout = true
post {
mRequestedLayout = false
layout(left, top, right, bottom)
onLayout(false, left, top, right, bottom)
}
}

}


}

/**
Expand Down

0 comments on commit c55cda8

Please sign in to comment.