Skip to content

Commit

Permalink
Removed floating action button
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Mar 11, 2024
1 parent 2423311 commit 1ccfe63
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FabPosition
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
Expand Down Expand Up @@ -127,8 +126,6 @@ fun ScaffoldWithMediumTopBar(
lazyListState: LazyListState = rememberLazyListState(),
scrollbarColor: Color = MaterialTheme.colorScheme.onBackground.copy(alpha = AlphaScrollbar),
snackbarHostState: SnackbarHostState = remember { SnackbarHostState() },
floatingActionButton: @Composable () -> Unit = {},
floatingActionButtonPosition: FabPosition = FabPosition.End,
content: @Composable (modifier: Modifier, lazyListState: LazyListState) -> Unit
) {

Expand All @@ -146,8 +143,6 @@ fun ScaffoldWithMediumTopBar(
scrollBehavior = scrollBehavior
)
},
floatingActionButton = floatingActionButton,
floatingActionButtonPosition = floatingActionButtonPosition,
snackbarHost = {
SnackbarHost(
snackbarHostState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package net.mullvad.mullvadvpn.compose.screen

import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material3.ExtendedFloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarDuration
import androidx.compose.material3.SnackbarHostState
Expand All @@ -20,8 +16,10 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand All @@ -47,7 +45,7 @@ import net.mullvad.mullvadvpn.compose.test.NEW_LIST_BUTTON_TEST_TAG
import net.mullvad.mullvadvpn.compose.transitions.SlideInFromRightTransition
import net.mullvad.mullvadvpn.lib.theme.AppTheme
import net.mullvad.mullvadvpn.lib.theme.Dimens
import net.mullvad.mullvadvpn.lib.theme.shape.fabShape
import net.mullvad.mullvadvpn.lib.theme.color.Alpha60
import net.mullvad.mullvadvpn.relaylist.RelayItem
import net.mullvad.mullvadvpn.viewmodel.CustomListsViewModel
import org.koin.androidx.compose.koinViewModel
Expand Down Expand Up @@ -124,20 +122,19 @@ fun CustomListsScreen(
ScaffoldWithMediumTopBar(
appBarTitle = stringResource(id = R.string.edit_custom_lists),
navigationIcon = { NavigateBackIconButton(onBackClick) },
floatingActionButton = {
ExtendedFloatingActionButton(
actions = {
IconButton(
onClick = addCustomList,
containerColor = MaterialTheme.colorScheme.primary,
contentColor = MaterialTheme.colorScheme.onPrimary,
shape = MaterialTheme.shapes.fabShape,
modifier = Modifier.testTag(NEW_LIST_BUTTON_TEST_TAG)
) {
Icon(
imageVector = Icons.Filled.Add,
painterResource(id = R.drawable.ic_icons_add),
tint =
MaterialTheme.colorScheme.onBackground
.copy(alpha = Alpha60)
.compositeOver(MaterialTheme.colorScheme.background),
contentDescription = stringResource(id = R.string.new_list)
)
Spacer(modifier = Modifier.width(Dimens.mediumPadding))
Text(stringResource(id = R.string.new_list))
}
},
snackbarHostState = snackbarHostState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const val AlphaDescription = 0.6f
const val AlphaDisconnectButton = 0.6f
const val AlphaChevron = 0.6f
const val AlphaScrollbar = 0.6f
const val Alpha60 = 0.6f
const val AlphaTopBar = 0.8f
const val AlphaInvisible = 0f

Expand Down

0 comments on commit 1ccfe63

Please sign in to comment.