feat: https://rvlt.gg/jen link in settings
Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
parent
35800614ef
commit
9ea395152d
|
|
@ -1,5 +1,7 @@
|
||||||
package chat.revolt.screens.settings
|
package chat.revolt.screens.settings
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
|
@ -12,11 +14,13 @@ import androidx.compose.material.icons.filled.Build
|
||||||
import androidx.compose.material.icons.filled.Close
|
import androidx.compose.material.icons.filled.Close
|
||||||
import androidx.compose.material.icons.filled.Info
|
import androidx.compose.material.icons.filled.Info
|
||||||
import androidx.compose.material.icons.filled.Settings
|
import androidx.compose.material.icons.filled.Settings
|
||||||
|
import androidx.compose.material.icons.filled.Star
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
|
@ -24,6 +28,7 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
import chat.revolt.BuildConfig
|
import chat.revolt.BuildConfig
|
||||||
import chat.revolt.R
|
import chat.revolt.R
|
||||||
|
import chat.revolt.activities.InviteActivity
|
||||||
import chat.revolt.components.generic.PageHeader
|
import chat.revolt.components.generic.PageHeader
|
||||||
import chat.revolt.components.generic.SheetClickable
|
import chat.revolt.components.generic.SheetClickable
|
||||||
import chat.revolt.components.screens.settings.SelfUserOverview
|
import chat.revolt.components.screens.settings.SelfUserOverview
|
||||||
|
|
@ -32,6 +37,8 @@ import chat.revolt.components.screens.settings.SelfUserOverview
|
||||||
fun SettingsScreen(
|
fun SettingsScreen(
|
||||||
navController: NavController
|
navController: NavController
|
||||||
) {
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
|
|
@ -147,6 +154,32 @@ fun SettingsScreen(
|
||||||
modifier = Modifier.padding(bottom = 10.dp, start = 10.dp, top = 20.dp)
|
modifier = Modifier.padding(bottom = 10.dp, start = 10.dp, top = 20.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SheetClickable(
|
||||||
|
icon = { modifier ->
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Star,
|
||||||
|
contentDescription = stringResource(id = R.string.logout),
|
||||||
|
modifier = modifier
|
||||||
|
)
|
||||||
|
},
|
||||||
|
label = { textStyle ->
|
||||||
|
Text(
|
||||||
|
text = stringResource(id = R.string.settings_join_jenvolt),
|
||||||
|
style = textStyle
|
||||||
|
)
|
||||||
|
},
|
||||||
|
modifier = Modifier.testTag("settings_join_jenvolt")
|
||||||
|
) {
|
||||||
|
context.startActivity(
|
||||||
|
Intent(
|
||||||
|
context,
|
||||||
|
InviteActivity::class.java
|
||||||
|
)
|
||||||
|
.setData(Uri.parse("https://rvlt.gg/jen"))
|
||||||
|
.setAction(Intent.ACTION_VIEW)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
SheetClickable(
|
SheetClickable(
|
||||||
icon = { modifier ->
|
icon = { modifier ->
|
||||||
Icon(
|
Icon(
|
||||||
|
|
@ -177,6 +210,7 @@ fun SettingsScreen(
|
||||||
label = { textStyle ->
|
label = { textStyle ->
|
||||||
Text(text = stringResource(id = R.string.logout), style = textStyle)
|
Text(text = stringResource(id = R.string.logout), style = textStyle)
|
||||||
},
|
},
|
||||||
|
dangerous = true,
|
||||||
modifier = Modifier.testTag("settings_view_logout")
|
modifier = Modifier.testTag("settings_view_logout")
|
||||||
) {
|
) {
|
||||||
Toast
|
Toast
|
||||||
|
|
|
||||||
|
|
@ -333,6 +333,8 @@
|
||||||
<string name="settings_appearance_theme_m3dynamic_unsupported">Material You (unsupported)</string>
|
<string name="settings_appearance_theme_m3dynamic_unsupported">Material You (unsupported)</string>
|
||||||
<string name="settings_appearance_theme_m3dynamic_unsupported_toast">Material You is not supported on this device.</string>
|
<string name="settings_appearance_theme_m3dynamic_unsupported_toast">Material You is not supported on this device.</string>
|
||||||
|
|
||||||
|
<string name="settings_join_jenvolt">Join Jenvolt</string>
|
||||||
|
|
||||||
<string name="settings_feedback">Feedback</string>
|
<string name="settings_feedback">Feedback</string>
|
||||||
<string name="settings_feedback_introduction">Any feedback you have for Revolt is greatly appreciated and all feedback is read by the development team of our Android app.</string>
|
<string name="settings_feedback_introduction">Any feedback you have for Revolt is greatly appreciated and all feedback is read by the development team of our Android app.</string>
|
||||||
<string name="settings_feedback_category">Category</string>
|
<string name="settings_feedback_category">Category</string>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue