feat: add FAB in contributors screen

This commit is contained in:
Ushie 2022-10-10 19:34:48 +03:00
parent 546c46d01b
commit ebe238caaa
No known key found for this signature in database
GPG Key ID: 0EF73F1CA38B2D5F

View File

@ -1,8 +1,6 @@
package app.revanced.manager.ui.screen.subscreens
import android.annotation.SuppressLint
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
@ -11,29 +9,31 @@ import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import app.revanced.manager.R
import app.revanced.manager.ui.component.ContributorsCard
import app.revanced.manager.ui.navigation.AppDestination
import app.revanced.manager.ui.viewmodel.ContributorsViewModel
import app.revanced.manager.util.ghOrganization
import app.revanced.manager.util.openUrl
import com.xinto.taxi.BackstackNavigator
import org.koin.androidx.compose.getViewModel
@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
@OptIn(ExperimentalMaterial3Api::class)
fun ContributorsSubscreen(
navigator: BackstackNavigator<AppDestination>,
vm: ContributorsViewModel = getViewModel()
) {
val ctx = LocalContext.current.applicationContext
Scaffold(
topBar = {
MediumTopAppBar(
title = {
Text(
text = stringResource(R.string.screen_contributors_title),
style = MaterialTheme.typography.headlineLarge
text = stringResource(R.string.screen_contributors_title)
)
},
navigationIcon = {
@ -45,12 +45,16 @@ fun ContributorsSubscreen(
}
}
)
},
floatingActionButton = {
FloatingActionButton(onClick = { ctx.openUrl(ghOrganization) }) {
Icon(painterResource(id = R.drawable.ic_github), contentDescription = null)
}
) {
}
) { paddingValues ->
Column(
Modifier
.padding(it)
.height(1400.dp)
.padding(paddingValues)
.verticalScroll(rememberScrollState())
) {
ContributorsCard(