chore: kotlin conventional form field names
This commit is contained in:
parent
2836c03a44
commit
399177ca63
|
|
@ -22,7 +22,6 @@ import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
|
|
@ -58,13 +57,20 @@ enum class FeedbackType(val value: String) {
|
||||||
data class FeedbackBody(
|
data class FeedbackBody(
|
||||||
val type: String,
|
val type: String,
|
||||||
val message: String,
|
val message: String,
|
||||||
val api_host: String,
|
@SerialName("api_host")
|
||||||
val app_id: String,
|
val apiHost: String,
|
||||||
val app_version: String,
|
@SerialName("app_id")
|
||||||
val app_build: String,
|
val appId: String,
|
||||||
val android_api: String,
|
@SerialName("app_version")
|
||||||
val android_device: String,
|
val appVersion: String,
|
||||||
val android_manufacturer: String,
|
@SerialName("app_build")
|
||||||
|
val appBuild: String,
|
||||||
|
@SerialName("android_api")
|
||||||
|
val androidApi: String,
|
||||||
|
@SerialName("android_device")
|
||||||
|
val androidDevice: String,
|
||||||
|
@SerialName("android_manufacturer")
|
||||||
|
val androidManufacturer: String,
|
||||||
@SerialName("id_for_spam_protection_pls_dont_spam_but_if_you_do_i_will_know")
|
@SerialName("id_for_spam_protection_pls_dont_spam_but_if_you_do_i_will_know")
|
||||||
val author: String
|
val author: String
|
||||||
)
|
)
|
||||||
|
|
@ -75,13 +81,13 @@ suspend fun sendFeedback(type: FeedbackType, message: String): String {
|
||||||
FeedbackBody(
|
FeedbackBody(
|
||||||
type = type.value,
|
type = type.value,
|
||||||
message = message,
|
message = message,
|
||||||
api_host = REVOLT_BASE,
|
apiHost = REVOLT_BASE,
|
||||||
app_id = BuildConfig.APPLICATION_ID,
|
appId = BuildConfig.APPLICATION_ID,
|
||||||
app_version = BuildConfig.VERSION_NAME,
|
appVersion = BuildConfig.VERSION_NAME,
|
||||||
app_build = BuildConfig.VERSION_CODE.toString(),
|
appBuild = BuildConfig.VERSION_CODE.toString(),
|
||||||
android_api = android.os.Build.VERSION.SDK_INT.toString(),
|
androidApi = android.os.Build.VERSION.SDK_INT.toString(),
|
||||||
android_device = android.os.Build.DEVICE,
|
androidDevice = android.os.Build.DEVICE,
|
||||||
android_manufacturer = android.os.Build.MANUFACTURER,
|
androidManufacturer = android.os.Build.MANUFACTURER,
|
||||||
author = RevoltAPI.selfId ?: "RevoltAPI.selfId is null"
|
author = RevoltAPI.selfId ?: "RevoltAPI.selfId is null"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -93,7 +99,7 @@ suspend fun sendFeedback(type: FeedbackType, message: String): String {
|
||||||
return response.bodyAsText()
|
return response.bodyAsText()
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun FeedbackDialog(navController: NavController) {
|
fun FeedbackDialog(navController: NavController) {
|
||||||
if (!BuildConfig.ANALYSIS_ENABLED) {
|
if (!BuildConfig.ANALYSIS_ENABLED) {
|
||||||
|
|
@ -105,7 +111,13 @@ fun FeedbackDialog(navController: NavController) {
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
)
|
)
|
||||||
}, text = {
|
}, text = {
|
||||||
Text(text = stringResource(id = R.string.settings_feedback_disabled_message))
|
Text(
|
||||||
|
text = stringResource(
|
||||||
|
id = R.string.settings_feedback_disabled_message,
|
||||||
|
BuildConfig.VERSION_NAME,
|
||||||
|
BuildConfig.BUILD_TYPE
|
||||||
|
)
|
||||||
|
)
|
||||||
}, confirmButton = {
|
}, confirmButton = {
|
||||||
TextButton(onClick = {
|
TextButton(onClick = {
|
||||||
navController.popBackStack()
|
navController.popBackStack()
|
||||||
|
|
|
||||||
|
|
@ -261,5 +261,5 @@
|
||||||
<string name="settings_feedback_error">An error occurred while sending your feedback. Please try again later.</string>
|
<string name="settings_feedback_error">An error occurred while sending your feedback. Please try again later.</string>
|
||||||
|
|
||||||
<string name="settings_feedback_disabled_title">Feedback unavailable</string>
|
<string name="settings_feedback_disabled_title">Feedback unavailable</string>
|
||||||
<string name="settings_feedback_disabled_message">Feedback is not available on this build of Revolt. Support for self-built versions is limited.</string>
|
<string name="settings_feedback_disabled_message">Feedback is not available on this build of Revolt. Support for this build is limited. (Build: %1$s %2$s)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue