Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import org.wordpress.android.ui.commentsrs.CommentsTabUiState
import org.wordpress.android.ui.commentsrs.PendingConfirmation
import org.wordpress.android.ui.commentsrs.batchActions
import org.wordpress.android.ui.commentsrs.isEnabledFor
import org.wordpress.android.ui.compose.utils.rsDebugTitle
import org.wordpress.android.ui.postsrs.SnackbarMessage

// Material's disabled-content alpha, used to dim batch-action icons that can't apply to the
Expand Down Expand Up @@ -208,7 +209,7 @@ fun CommentsRsListScreen(
}
}
TopBarMode.NORMAL -> TopAppBar(
title = { Text(text = stringResource(R.string.comments)) },
title = { Text(text = rsDebugTitle(R.string.comments)) },
navigationIcon = {
IconButton(onClick = onNavigateBack) {
Icon(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.wordpress.android.ui.compose.utils

import androidx.annotation.StringRes
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import org.wordpress.android.BuildConfig

private const val RS_DEBUG_SUFFIX = "(RS)"

/**
* Title for a wordpress-rs screen. Debug builds append an "(RS)" suffix so these screens can be
* told apart at a glance from their FluxC-backed counterparts, which are reachable from other
* entry points on the same site. Release builds get the unmodified title.
*/
@Composable
fun rsDebugTitle(@StringRes titleResId: Int): String {
val title = stringResource(titleResId)
return if (BuildConfig.DEBUG) "$title $RS_DEBUG_SUFFIX" else title
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.withIndex
import kotlinx.coroutines.launch
import org.wordpress.android.R
import org.wordpress.android.ui.compose.utils.rsDebugTitle
import org.wordpress.android.ui.pagesrs.PageRsConfirmationDialogState
import org.wordpress.android.ui.pagesrs.PageRsListConfirmation
import org.wordpress.android.ui.pagesrs.PageRsListTab
Expand Down Expand Up @@ -197,7 +198,7 @@ internal fun PagesRsListScreen(
modifier = Modifier.fillMaxWidth().focusRequester(focusRequester)
)
} else {
Text(text = stringResource(R.string.my_site_btn_site_pages))
Text(text = rsDebugTitle(R.string.my_site_btn_site_pages))
}
},
navigationIcon = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.launch
import org.wordpress.android.R
import org.wordpress.android.ui.compose.utils.rsDebugTitle
import org.wordpress.android.ui.posts.AuthorFilterSelection
import org.wordpress.android.ui.postsrs.ConfirmationDialogState
import org.wordpress.android.ui.postsrs.PendingConfirmation
Expand Down Expand Up @@ -171,7 +172,7 @@ fun PostRsListScreen(
modifier = Modifier.fillMaxWidth().focusRequester(focusRequester)
)
} else {
Text(text = stringResource(R.string.my_site_btn_blog_posts))
Text(text = rsDebugTitle(R.string.my_site_btn_blog_posts))
}
},
navigationIcon = {
Expand Down
Loading