Bump version to 0.2.2
This commit is contained in:
		
							parent
							
								
									39c3b27c36
								
							
						
					
					
						commit
						0fe6fe6a33
					
				
					 3 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
package com.pixelized.rplexicon.ui.composable.remember
 | 
			
		||||
 | 
			
		||||
import androidx.compose.foundation.lazy.LazyListState
 | 
			
		||||
import androidx.compose.runtime.Composable
 | 
			
		||||
import androidx.compose.runtime.Stable
 | 
			
		||||
import androidx.compose.runtime.State
 | 
			
		||||
| 
						 | 
				
			
			@ -20,7 +21,9 @@ data class LazyListOffset(
 | 
			
		|||
 | 
			
		||||
@Composable
 | 
			
		||||
@Stable
 | 
			
		||||
fun rememberLazyListOffset(): LazyListOffset {
 | 
			
		||||
fun rememberLazyListOffset(
 | 
			
		||||
    lazyListState: LazyListState,
 | 
			
		||||
): LazyListOffset {
 | 
			
		||||
    val density = LocalDensity.current
 | 
			
		||||
 | 
			
		||||
    return remember {
 | 
			
		||||
| 
						 | 
				
			
			@ -30,7 +33,9 @@ fun rememberLazyListOffset(): LazyListOffset {
 | 
			
		|||
            offsetY = offsetY,
 | 
			
		||||
            connection = object : NestedScrollConnection {
 | 
			
		||||
                override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
 | 
			
		||||
                    offsetY.value -= with(density) { available.y.toDp() }
 | 
			
		||||
                    if (lazyListState.canScrollForward || lazyListState.canScrollBackward) {
 | 
			
		||||
                        offsetY.value -= with(density) { available.y.toDp() }
 | 
			
		||||
                    }
 | 
			
		||||
                    return Offset.Zero
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -179,7 +179,7 @@ private fun QuestDetailContent(
 | 
			
		|||
            )
 | 
			
		||||
        },
 | 
			
		||||
        content = { padding ->
 | 
			
		||||
            val lazyListOffset = rememberLazyListOffset()
 | 
			
		||||
            val lazyListOffset = rememberLazyListOffset(lazyListState = state)
 | 
			
		||||
            Surface(
 | 
			
		||||
                modifier = Modifier
 | 
			
		||||
                    .padding(padding)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue