Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter modal 개선 적용 #112

Closed
rhkrwngud445 opened this issue May 13, 2024 · 0 comments · Fixed by #141
Closed

filter modal 개선 적용 #112

rhkrwngud445 opened this issue May 13, 2024 · 0 comments · Fixed by #141
Assignees
Labels
Feature Feature 이슈

Comments

@rhkrwngud445
Copy link
Contributor

기능 설명

class BottomSheetNestedScrollInterceptor : NestedScrollConnection {
    private var arrivedBoundarySource: NestedScrollSource? = null

    override fun onPreScroll(
        available: Offset,
        source: NestedScrollSource
    ): Offset {
        // Reset the state variable
        if (source == NestedScrollSource.Drag && arrivedBoundarySource == NestedScrollSource.Fling) {
            arrivedBoundarySource = null
        }

        return super.onPreScroll(available, source)
    }

    override fun onPostScroll(
        consumed: Offset,
        available: Offset,
        source: NestedScrollSource
    ): Offset {
        // The sub-layout can't consume completely,
        // which means that the boundary has been reached.
        if (arrivedBoundarySource == null && abs(available.y) > 0) {
            arrivedBoundarySource = source
        }

        // Decide whether to consume according to the sub-layout
        // consumption when reaching the boundary.
        if (arrivedBoundarySource == NestedScrollSource.Fling) {
            return available
        }

        return Offset.Zero
    }

    override suspend fun onPostFling(
        consumed: Velocity,
        available: Velocity
    ): Velocity {
        arrivedBoundarySource = null
        return super.onPostFling(consumed, available)
    }
}

@Composable
fun rememberBottomSheetNestedScrollInterceptor(): BottomSheetNestedScrollInterceptor {
    return remember { BottomSheetNestedScrollInterceptor() }
}

개조 및 적용

개발 일정

2차 MVP 이후

자식 이슈

No response

부가 설명

No response

@rhkrwngud445 rhkrwngud445 added the Feature Feature 이슈 label May 13, 2024
@rhkrwngud445 rhkrwngud445 self-assigned this May 13, 2024
@rhkrwngud445 rhkrwngud445 changed the title filter modal nestedScroll 적용 filter modal 개선 적용 Jun 14, 2024
@rhkrwngud445 rhkrwngud445 linked a pull request Jun 17, 2024 that will close this issue
rhkrwngud445 added a commit that referenced this issue Jun 21, 2024
…croll_적용

Feat/#112 filter modal nestedscroll 적용
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature 이슈
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant