Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace remaining release build checks with play build checks #5179

Merged
merged 1 commit into from
Sep 21, 2023
Merged
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 @@ -27,7 +27,6 @@ import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import me.onebone.toolbar.ScrollStrategy
import me.onebone.toolbar.rememberCollapsingToolbarScaffoldState
import net.mullvad.mullvadvpn.BuildConfig
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.compose.cell.DefaultExternalLinkView
import net.mullvad.mullvadvpn.compose.cell.NavigationCellBody
Expand All @@ -38,7 +37,7 @@ import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar
import net.mullvad.mullvadvpn.compose.extensions.itemWithDivider
import net.mullvad.mullvadvpn.compose.state.SettingsUiState
import net.mullvad.mullvadvpn.compose.test.LAZY_LIST_TEST_TAG
import net.mullvad.mullvadvpn.lib.common.constant.BuildTypes
import net.mullvad.mullvadvpn.constant.IS_PLAY_BUILD
import net.mullvad.mullvadvpn.lib.common.util.openLink
import net.mullvad.mullvadvpn.lib.theme.Dimens
import net.mullvad.mullvadvpn.util.appendHideNavOnPlayBuild
Expand Down Expand Up @@ -138,7 +137,7 @@ fun SettingsScreen(
},
bodyView =
@Composable {
if (BuildConfig.BUILD_TYPE != BuildTypes.RELEASE) {
if (IS_PLAY_BUILD.not()) {
NavigationCellBody(
content = uiState.appVersion,
contentBodyDescription =
Expand All @@ -154,7 +153,7 @@ fun SettingsScreen(
}
},
showWarning = uiState.isUpdateAvailable,
isRowEnabled = BuildConfig.BUILD_TYPE != BuildTypes.RELEASE
isRowEnabled = IS_PLAY_BUILD.not()
)
}
if (uiState.isUpdateAvailable) {
Expand Down Expand Up @@ -183,7 +182,7 @@ fun SettingsScreen(
)
}

if (BuildConfig.BUILD_TYPE != BuildTypes.RELEASE) {
if (IS_PLAY_BUILD.not()) {
itemWithDivider {
val faqGuideLabel = stringResource(id = R.string.faqs_and_guides)
NavigationComposeCell(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import net.mullvad.mullvadvpn.BuildConfig
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.constant.ACCOUNT_EXPIRY_POLL_INTERVAL
import net.mullvad.mullvadvpn.lib.common.constant.BuildTypes
import net.mullvad.mullvadvpn.constant.IS_PLAY_BUILD
import net.mullvad.mullvadvpn.lib.common.util.JobTracker
import net.mullvad.mullvadvpn.lib.common.util.openAccountPageInBrowser
import net.mullvad.mullvadvpn.model.TunnelState
Expand Down Expand Up @@ -78,7 +77,7 @@ class OutOfTimeFragment : BaseFragment() {

view.findViewById<TextView>(R.id.account_credit_has_expired).text = buildString {
append(requireActivity().getString(R.string.account_credit_has_expired))
if (BuildConfig.BUILD_TYPE != BuildTypes.RELEASE) {
if (IS_PLAY_BUILD.not()) {
append(" ")
append(requireActivity().getString(R.string.add_time_to_account))
}
Expand Down Expand Up @@ -106,7 +105,7 @@ class OutOfTimeFragment : BaseFragment() {
isEnabled = true
}

sitePaymentButton.isVisible = BuildTypes.RELEASE != BuildConfig.BUILD_TYPE
sitePaymentButton.isVisible = IS_PLAY_BUILD.not()

redeemButton =
view.findViewById<RedeemVoucherButton>(R.id.redeem_voucher).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import android.view.View
import android.view.ViewGroup
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.platform.ComposeView
import net.mullvad.mullvadvpn.BuildConfig
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.compose.screen.WelcomeScreen
import net.mullvad.mullvadvpn.lib.common.constant.BuildTypes
import net.mullvad.mullvadvpn.constant.IS_PLAY_BUILD
import net.mullvad.mullvadvpn.lib.theme.AppTheme
import net.mullvad.mullvadvpn.ui.MainActivity
import net.mullvad.mullvadvpn.viewmodel.WelcomeViewModel
Expand All @@ -29,7 +28,7 @@ class WelcomeFragment : BaseFragment() {
AppTheme {
val state = vm.uiState.collectAsState().value
WelcomeScreen(
showSitePayment = BuildTypes.RELEASE != BuildConfig.BUILD_TYPE,
showSitePayment = IS_PLAY_BUILD.not(),
uiState = state,
viewActions = vm.viewActions,
onSitePaymentClick = vm::onSitePaymentClick,
Expand Down