Refactor FeatureFlags.

This commit is contained in:
Greyson Parrelli
2024-06-12 13:57:07 -04:00
parent 39cb1c638e
commit 13f7a64139
76 changed files with 1059 additions and 1053 deletions

View File

@@ -54,7 +54,7 @@ object CallLinks {
@JvmStatic
fun isCallLink(url: String): Boolean {
if (!FeatureFlags.adHocCalling()) {
if (!FeatureFlags.adHocCalling) {
return false
}
@@ -67,7 +67,7 @@ object CallLinks {
@JvmStatic
fun parseUrl(url: String): CallLinkRootKey? {
if (!FeatureFlags.adHocCalling()) {
if (!FeatureFlags.adHocCalling) {
return null
}

View File

@@ -253,7 +253,7 @@ class CallLogFragment : Fragment(R.layout.call_log_fragment), CallLogAdapter.Cal
MaterialAlertDialogBuilder(requireContext())
.setTitle(resources.getQuantityString(R.plurals.CallLogFragment__delete_d_calls, count, count))
.setMessage(
if (FeatureFlags.adHocCalling()) {
if (FeatureFlags.adHocCalling) {
getString(R.string.CallLogFragment__call_links_youve_created)
} else {
null
@@ -403,7 +403,7 @@ class CallLogFragment : Fragment(R.layout.call_log_fragment), CallLogAdapter.Cal
MaterialAlertDialogBuilder(requireContext())
.setTitle(resources.getQuantityString(R.plurals.CallLogFragment__delete_d_calls, 1, 1))
.setMessage(
if (FeatureFlags.adHocCalling()) {
if (FeatureFlags.adHocCalling) {
getString(R.string.CallLogFragment__call_links_youve_created)
} else {
null

View File

@@ -10,7 +10,7 @@ class CallLogPagedDataSource(
) : PagedDataSource<CallLogRow.Id, CallLogRow> {
private val hasFilter = filter == CallLogFilter.MISSED
private val hasCallLinkRow = FeatureFlags.adHocCalling() && filter == CallLogFilter.ALL && query.isNullOrEmpty()
private val hasCallLinkRow = FeatureFlags.adHocCalling && filter == CallLogFilter.ALL && query.isNullOrEmpty()
private var callEventsCount = 0
private var callLinksCount = 0

View File

@@ -82,7 +82,7 @@ class CallLogViewModel(
controller.onDataInvalidated()
}
if (FeatureFlags.adHocCalling()) {
if (FeatureFlags.adHocCalling) {
disposables += Observable
.interval(30, TimeUnit.SECONDS, Schedulers.computation())
.flatMapCompletable { callLogRepository.peekCallLinks() }