Skip to content

Commit

Permalink
Fixed a crash that could happen when the ParleyView is not visible/at…
Browse files Browse the repository at this point in the history
…tached (#57)

* Fixed a crash that could happen when the ParleyView is not visible/attached
  • Loading branch information
alexkok committed Jun 14, 2024
1 parent 91808db commit 4668b31
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.9.6 - 14 Jun 2024

- Fixed a crash that could happen when the ParleyView is not visible/attached.

## 3.9.5 - 12 Jun 2024

- Added `Parley.purgeLocalMemory()` method to clear local memory of Parley. Requires calling `configure()` again.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ allprojects {
To integrate Parley, specify the following in your `app/build.gradle` file:

```groovy
implementation 'com.github.parley-messaging:android-library:3.9.5'
implementation 'com.github.parley-messaging:android-library:3.9.6'
```

### Upgrading
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
minSdkVersion 21
targetSdk 34
versionCode 1
versionName "3.9.5"
versionName "3.9.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down Expand Up @@ -37,7 +37,7 @@ dependencies {
implementation "com.google.firebase:firebase-messaging:23.4.1"

// Library
// implementation 'com.github.parley-messaging:android-library:3.9.5' // Remote
// implementation 'com.github.parley-messaging:android-library:3.9.6' // Remote
implementation project(':parley') // Local

// Tests
Expand Down
2 changes: 1 addition & 1 deletion parley/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

group = 'com.github.parley-messaging'
version = '3.9.5'
version = '3.9.6'

android {
namespace 'nu.parley.android'
Expand Down
4 changes: 4 additions & 0 deletions parley/src/main/java/nu/parley/android/Parley.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ public void triggerRefreshOnConnected() {
triggerRefreshOnConnected(true);
}

/**
* @discussion https://github.com/parley-messaging/android-library/pull/55
* @param resendPendingMessages whether pending messages should be attempt to send.
*/
public void triggerRefreshOnConnected(boolean resendPendingMessages) {
if (this.state == State.UNCONFIGURED || this.state == State.CONFIGURING) {
// Ignore, we cannot refresh data if we are not configured yet or if we are already configuring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public void register(Context context, Listener listener) {
}

public void unregister(Context context) {
AccessibilityManagerCompat.removeTouchExplorationStateChangeListener(getAccessibilityManager(context), callback);
if (callback != null) {
AccessibilityManagerCompat.removeTouchExplorationStateChangeListener(getAccessibilityManager(context), callback);
}
this.listener = null;
this.callback = null;
}
Expand Down

0 comments on commit 4668b31

Please sign in to comment.