Inline the calls tab feature flag.
This commit is contained in:
parent
dc2e249566
commit
938c82be3f
4 changed files with 12 additions and 33 deletions
|
@ -148,7 +148,7 @@ public class MainActivity extends PassphraseRequiredActivity implements VoiceNot
|
|||
}
|
||||
|
||||
private void updateTabVisibility() {
|
||||
if (Stories.isFeatureEnabled() || FeatureFlags.callsTab()) {
|
||||
if (Stories.isFeatureEnabled()) {
|
||||
findViewById(R.id.conversation_list_tabs).setVisibility(View.VISIBLE);
|
||||
WindowUtil.setNavigationBarColor(this, ContextCompat.getColor(this, R.color.signal_colorSurface2));
|
||||
} else {
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.thoughtcrime.securesms.R
|
|||
import org.thoughtcrime.securesms.components.ViewBinderDelegate
|
||||
import org.thoughtcrime.securesms.databinding.ChooseNavigationBarStyleFragmentBinding
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
|
||||
/**
|
||||
* Allows the user to choose between a compact and full-sized navigation bar.
|
||||
|
@ -75,11 +74,7 @@ class ChooseNavigationBarStyleFragment : DialogFragment(R.layout.choose_navigati
|
|||
companion object {
|
||||
@DrawableRes
|
||||
fun getImageResourceId(isCompact: Boolean): Int {
|
||||
return if (FeatureFlags.callsTab()) {
|
||||
ThreeButtons.getImageResource(isCompact)
|
||||
} else {
|
||||
TwoButtons.getImageResource(isCompact)
|
||||
}
|
||||
return ThreeButtons.getImageResource(isCompact)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.thoughtcrime.securesms.components.ViewBinderDelegate
|
|||
import org.thoughtcrime.securesms.databinding.ConversationListTabsBinding
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.stories.Stories
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.visible
|
||||
|
||||
/**
|
||||
|
@ -105,7 +104,7 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
|||
binding.callsUnreadIndicator,
|
||||
binding.callsTabTouchPoint
|
||||
).forEach {
|
||||
it.visible = FeatureFlags.callsTab()
|
||||
it.visible = true
|
||||
}
|
||||
|
||||
listOf(
|
||||
|
@ -141,10 +140,8 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
|||
binding.storiesPill.isSelected = state.tab == ConversationListTab.STORIES
|
||||
}
|
||||
|
||||
if (FeatureFlags.callsTab()) {
|
||||
binding.callsTabIcon.isSelected = state.tab == ConversationListTab.CALLS
|
||||
binding.callsPill.isSelected = state.tab == ConversationListTab.CALLS
|
||||
}
|
||||
binding.callsTabIcon.isSelected = state.tab == ConversationListTab.CALLS
|
||||
binding.callsPill.isSelected = state.tab == ConversationListTab.CALLS
|
||||
|
||||
val hasStateChange = state.tab != state.prevTab
|
||||
if (immediate) {
|
||||
|
@ -156,16 +153,14 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
|||
binding.storiesTabIcon.progress = if (state.tab == ConversationListTab.STORIES) 1f else 0f
|
||||
}
|
||||
|
||||
if (FeatureFlags.callsTab()) {
|
||||
binding.callsTabIcon.pauseAnimation()
|
||||
binding.callsTabIcon.progress = if (state.tab == ConversationListTab.CALLS) 1f else 0f
|
||||
}
|
||||
binding.callsTabIcon.pauseAnimation()
|
||||
binding.callsTabIcon.progress = if (state.tab == ConversationListTab.CALLS) 1f else 0f
|
||||
|
||||
runPillAnimation(
|
||||
0,
|
||||
listOfNotNull(
|
||||
binding.chatsPill,
|
||||
binding.callsPill.takeIf { FeatureFlags.callsTab() },
|
||||
binding.callsPill,
|
||||
binding.storiesPill.takeIf { Stories.isFeatureEnabled() }
|
||||
)
|
||||
)
|
||||
|
@ -173,7 +168,7 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
|||
runLottieAnimations(
|
||||
listOfNotNull(
|
||||
binding.chatsTabIcon,
|
||||
binding.callsTabIcon.takeIf { FeatureFlags.callsTab() },
|
||||
binding.callsTabIcon,
|
||||
binding.storiesTabIcon.takeIf { Stories.isFeatureEnabled() }
|
||||
)
|
||||
)
|
||||
|
@ -182,7 +177,7 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
|||
150,
|
||||
listOfNotNull(
|
||||
binding.chatsPill,
|
||||
binding.callsPill.takeIf { FeatureFlags.callsTab() },
|
||||
binding.callsPill,
|
||||
binding.storiesPill.takeIf { Stories.isFeatureEnabled() }
|
||||
)
|
||||
)
|
||||
|
@ -196,10 +191,8 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
|||
binding.storiesUnreadIndicator.text = if (state.hasFailedStory) "!" else formatCount(state.unreadStoriesCount)
|
||||
}
|
||||
|
||||
if (FeatureFlags.callsTab()) {
|
||||
binding.callsUnreadIndicator.visible = state.unreadCallsCount > 0
|
||||
binding.callsUnreadIndicator.text = formatCount(state.unreadCallsCount)
|
||||
}
|
||||
binding.callsUnreadIndicator.visible = state.unreadCallsCount > 0
|
||||
binding.callsUnreadIndicator.text = formatCount(state.unreadCallsCount)
|
||||
|
||||
requireView().visible = state.visibilityState.isVisible()
|
||||
}
|
||||
|
|
|
@ -104,7 +104,6 @@ public final class FeatureFlags {
|
|||
private static final String PAYPAL_RECURRING_DONATIONS = "android.recurringPayPalDonations.3";
|
||||
private static final String TEXT_FORMATTING = "android.textFormatting";
|
||||
private static final String ANY_ADDRESS_PORTS_KILL_SWITCH = "android.calling.fieldTrial.anyAddressPortsKillSwitch";
|
||||
private static final String CALLS_TAB = "android.calls.tab.2";
|
||||
private static final String AD_HOC_CALLING = "android.calling.ad.hoc";
|
||||
private static final String EDIT_MESSAGE_RECEIVE = "android.editMessage.receive";
|
||||
private static final String EDIT_MESSAGE_SEND = "android.editMessage.send";
|
||||
|
@ -166,7 +165,6 @@ public final class FeatureFlags {
|
|||
PAYPAL_RECURRING_DONATIONS,
|
||||
TEXT_FORMATTING,
|
||||
ANY_ADDRESS_PORTS_KILL_SWITCH,
|
||||
CALLS_TAB,
|
||||
EDIT_MESSAGE_RECEIVE,
|
||||
EDIT_MESSAGE_SEND
|
||||
);
|
||||
|
@ -597,13 +595,6 @@ public final class FeatureFlags {
|
|||
return getBoolean(EDIT_MESSAGE_SEND, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not the calls tab is enabled
|
||||
*/
|
||||
public static boolean callsTab() {
|
||||
return getBoolean(CALLS_TAB, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not ad-hoc calling is enabled
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue