add build config, use single variable in grandle file and update source to use feature flag

This commit is contained in:
David Langley 2021-08-11 13:13:38 +01:00
parent a355f61a7e
commit 92a44cd9d6
3 changed files with 13 additions and 7 deletions

View file

@ -142,9 +142,14 @@ android {
resValue "bool", "useLoginV1", "true"
resValue "bool", "useLoginV2", "false"
// NotificationSettingsV2 is disabled. To be released in conjunction with iOS/Web
resValue "bool", "useNotificationSettingsV1", "true"
resValue "bool", "useNotificationSettingsV2", "false"
def useNotificationSettingsV2 = false
buildConfigField "Boolean", "USE_NOTIFICATION_SETTINGS_V2", "${useNotificationSettingsV2}"
resValue "bool", "useNotificationSettingsV1", "${!useNotificationSettingsV2}"
resValue "bool", "useNotificationSettingsV2", "${useNotificationSettingsV2}"
buildConfigField "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy", "outboundSessionKeySharingStrategy", "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy.WhenTyping"

View file

@ -17,6 +17,7 @@ package im.vector.app.features.home.room.list.actions
import androidx.annotation.StringRes
import com.airbnb.epoxy.TypedEpoxyController
import im.vector.app.BuildConfig
import im.vector.app.R
import im.vector.app.core.epoxy.bottomSheetDividerItem
import im.vector.app.core.epoxy.bottomsheet.bottomSheetActionItem
@ -55,7 +56,7 @@ class RoomListQuickActionsEpoxyController @Inject constructor(
val roomSummary = notificationViewState.roomSummary() ?: return
val host = this
val showFull = state.roomListActionsArgs.mode == RoomListActionsArgs.Mode.FULL
var isV2 = true
var isV2 = BuildConfig.USE_NOTIFICATION_SETTINGS_V2
if (showFull || isV2) {
// Preview, favorite, settings

View file

@ -30,6 +30,7 @@ import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import im.vector.app.BuildConfig
import im.vector.app.R
import im.vector.app.core.animations.AppBarStateChangeListener
import im.vector.app.core.animations.MatrixItemAppBarStateChangeListener
@ -253,13 +254,12 @@ class RoomProfileFragment @Inject constructor(
}
override fun onNotificationsClicked() {
// TODO: Use BuildConfig here when merged in
if (false) {
if (BuildConfig.USE_NOTIFICATION_SETTINGS_V2) {
roomProfileSharedActionViewModel.post(RoomProfileSharedAction.OpenRoomNotificaitonSettings)
} else {
RoomListQuickActionsBottomSheet
.newInstance(roomProfileArgs.roomId, RoomListActionsArgs.Mode.NOTIFICATIONS)
.show(childFragmentManager, "ROOM_PROFILE_NOTIFICATIONS")
} else {
roomProfileSharedActionViewModel.post(RoomProfileSharedAction.OpenRoomNotificaitonSettings)
}
}