Add: Links' to OtherPref Page

This commit is contained in:
machiav3lli 2022-09-18 14:45:12 +02:00
parent 7ef04fabfd
commit 9f0698141f

View File

@ -0,0 +1,33 @@
package com.machiav3lli.fdroid.ui.compose.components.prefs
import android.content.Intent
import android.net.Uri
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import com.machiav3lli.fdroid.entity.LinkRef
@Composable
fun LinkPreference(
modifier: Modifier = Modifier,
link: LinkRef,
index: Int = 1,
groupSize: Int = 1,
) {
val context = LocalContext.current
BasePreference(
modifier = modifier,
titleId = link.titleId,
index = index,
groupSize = groupSize,
onClick = {
context.startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse(link.url)
)
)
}
)
}