Skip to content

Refactor FAB with onScroll animation #1475

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBars
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.windowInsetsBottomHeight
Expand All @@ -35,9 +34,10 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material3.ExtendedFloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.LargeFloatingActionButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -113,20 +113,18 @@ fun ReplyInboxScreen(
)
// When we have bottom navigation we show FAB at the bottom end.
if (navigationType == ReplyNavigationType.BOTTOM_NAVIGATION) {
LargeFloatingActionButton(
ExtendedFloatingActionButton(
text = { Text(text = stringResource(id = R.string.compose)) },
icon = { Icon(Icons.Default.Edit, stringResource(id = R.string.compose)) },
onClick = { /*TODO*/ },
modifier = Modifier
.align(Alignment.BottomEnd)
.padding(16.dp),
containerColor = MaterialTheme.colorScheme.tertiaryContainer,
contentColor = MaterialTheme.colorScheme.onTertiaryContainer
) {
Icon(
imageVector = Icons.Default.Edit,
contentDescription = stringResource(id = R.string.compose),
modifier = Modifier.size(28.dp)
)
}
contentColor = MaterialTheme.colorScheme.onTertiaryContainer,
expanded = emailLazyListState.lastScrolledBackward ||
!emailLazyListState.canScrollBackward
)
}
}
}
Expand Down