Skip to content

Commit

Permalink
Fix: when parent is FragmentContainerView #42
Browse files Browse the repository at this point in the history
  • Loading branch information
nukc committed Feb 15, 2022
1 parent 8da7497 commit 37384cc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Step 1. Add the JitPack repository to your build file
Step 2. Add the dependency
```groovy
dependencies {
implementation 'com.github.nukc:StateView:v3.0.1'
implementation 'com.github.nukc:StateView:v3.0.2'
}
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Step 1. Add the JitPack repository to your build file
Step 2. Add the dependency
```groovy
dependencies {
implementation 'com.github.nukc:StateView:v3.0.1'
implementation 'com.github.nukc:StateView:v3.0.2'
}
```

Expand Down
4 changes: 2 additions & 2 deletions kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 30
versionCode 7
versionName "3.0.0"
versionCode 9
versionName "3.0.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
Expand Down
3 changes: 2 additions & 1 deletion kotlin/src/main/java/com/github/nukc/stateview/StateView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.core.view.NestedScrollingChild
import androidx.core.view.NestedScrollingParent
import androidx.core.view.ScrollingView
import androidx.core.view.ViewCompat
import androidx.fragment.app.FragmentContainerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout

/**
Expand Down Expand Up @@ -297,7 +298,7 @@ class StateView @JvmOverloads constructor(
(viewGroup is ScrollingView && viewGroup is NestedScrollingChild) ||
(viewGroup is NestedScrollingParent && viewGroup is NestedScrollingChild)
) {
return if (viewGroup.parent is ViewGroup) {
return if (viewGroup.parent is ViewGroup && viewGroup.parent !is FragmentContainerView) {
wrap(viewGroup)
} else {
Injector.wrapChild(viewGroup)
Expand Down

0 comments on commit 37384cc

Please sign in to comment.