mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-28 05:42:14 +00:00
Add: Links' to OtherPref Page
This commit is contained in:
parent
7ef04fabfd
commit
9f0698141f
@ -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)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user