mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Add CFv2 feature flag.
This commit is contained in:
committed by
Nicholas Tinsley
parent
6a443d0074
commit
fe509838f4
@@ -273,7 +273,7 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
||||
FrameLayout parent = new FrameLayout(context);
|
||||
parent.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
|
||||
|
||||
if (SignalStore.internalValues().useConversationFragmentV2() && SignalStore.internalValues().useConversationItemV2()) {
|
||||
if (FeatureFlags.useConversationFragmentV2() && SignalStore.internalValues().useConversationItemV2()) {
|
||||
CachedInflater.from(context).cacheUntilLimit(R.layout.v2_conversation_item_text_only_incoming, parent, 25);
|
||||
CachedInflater.from(context).cacheUntilLimit(R.layout.v2_conversation_item_text_only_outgoing, parent, 25);
|
||||
} else {
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.thoughtcrime.securesms.mms.SlideFactory;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.stickers.StickerLocator;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.wallpaper.ChatWallpaper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -458,7 +459,7 @@ public class ConversationIntents {
|
||||
intent.setType(dataType);
|
||||
}
|
||||
|
||||
if (SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (FeatureFlags.useConversationFragmentV2()) {
|
||||
Bundle args = ConversationIntents.createParentFragmentArguments(intent);
|
||||
|
||||
return intent.putExtras(args);
|
||||
@@ -513,7 +514,7 @@ public class ConversationIntents {
|
||||
}
|
||||
|
||||
private static long checkThreadId(long threadId) {
|
||||
if (threadId < 0 && SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (threadId < 0 && FeatureFlags.useConversationFragmentV2()) {
|
||||
throw new IllegalArgumentException("ThreadId is a required field in CFV2");
|
||||
} else {
|
||||
return threadId;
|
||||
@@ -521,7 +522,7 @@ public class ConversationIntents {
|
||||
}
|
||||
|
||||
private static Class<? extends Activity> getBaseConversationActivity() {
|
||||
if (SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (FeatureFlags.useConversationFragmentV2()) {
|
||||
return ConversationActivity.class;
|
||||
} else {
|
||||
return org.thoughtcrime.securesms.conversation.ConversationActivity.class;
|
||||
|
||||
@@ -178,7 +178,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
bottomNavigationBarHeight = 0;
|
||||
}
|
||||
|
||||
if (!SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (!FeatureFlags.useConversationFragmentV2()) {
|
||||
toolbarShade.setVisibility(VISIBLE);
|
||||
toolbarShade.setAlpha(1f);
|
||||
|
||||
@@ -395,7 +395,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
}
|
||||
|
||||
private void updateToolbarShade(@NonNull Activity activity) {
|
||||
if (SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (FeatureFlags.useConversationFragmentV2()) {
|
||||
LayoutParams layoutParams = (LayoutParams) toolbarShade.getLayoutParams();
|
||||
layoutParams.height = 0;
|
||||
toolbarShade.setLayoutParams(layoutParams);
|
||||
@@ -403,7 +403,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
}
|
||||
|
||||
View toolbar = activity.findViewById(R.id.toolbar);
|
||||
View bannerContainer = activity.findViewById(SignalStore.internalValues().useConversationFragmentV2() ? R.id.conversation_banner
|
||||
View bannerContainer = activity.findViewById(FeatureFlags.useConversationFragmentV2() ? R.id.conversation_banner
|
||||
: R.id.conversation_banner_container);
|
||||
|
||||
LayoutParams layoutParams = (LayoutParams) toolbarShade.getLayoutParams();
|
||||
@@ -412,7 +412,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
}
|
||||
|
||||
private void updateInputShade(@NonNull Activity activity) {
|
||||
if (SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (FeatureFlags.useConversationFragmentV2()) {
|
||||
LayoutParams layoutParams = (LayoutParams) inputShade.getLayoutParams();
|
||||
layoutParams.height = 0;
|
||||
inputShade.setLayoutParams(layoutParams);
|
||||
@@ -426,7 +426,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
}
|
||||
|
||||
private int getInputPanelHeight(@NonNull Activity activity) {
|
||||
if (SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (FeatureFlags.useConversationFragmentV2()) {
|
||||
View bottomPanel = activity.findViewById(R.id.conversation_input_panel);
|
||||
|
||||
return bottomPanel.getHeight();
|
||||
@@ -915,7 +915,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
itemYAnim.setDuration(duration);
|
||||
animators.add(itemYAnim);
|
||||
|
||||
if (!SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (!FeatureFlags.useConversationFragmentV2()) {
|
||||
ObjectAnimator toolbarShadeAnim = new ObjectAnimator();
|
||||
toolbarShadeAnim.setProperty(View.ALPHA);
|
||||
toolbarShadeAnim.setFloatValues(0f);
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.conversation.ConversationAdapterBridge
|
||||
import org.thoughtcrime.securesms.conversation.ConversationAdapterBridge.PulseRequest
|
||||
import org.thoughtcrime.securesms.conversation.v2.items.InteractiveConversationElement
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.ThemeUtil
|
||||
import org.thoughtcrime.securesms.util.ViewUtil
|
||||
import org.thoughtcrime.securesms.wallpaper.ChatWallpaper
|
||||
@@ -402,7 +402,7 @@ class MultiselectItemDecoration(
|
||||
}
|
||||
}
|
||||
|
||||
if (!SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (!FeatureFlags.useConversationFragmentV2()) {
|
||||
canvas.clipPath(path)
|
||||
canvas.drawShade()
|
||||
canvas.restore()
|
||||
@@ -422,7 +422,7 @@ class MultiselectItemDecoration(
|
||||
}
|
||||
}
|
||||
|
||||
if (!SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
if (!FeatureFlags.useConversationFragmentV2()) {
|
||||
canvas.clipPath(path, Region.Op.DIFFERENCE)
|
||||
canvas.drawShade()
|
||||
canvas.restore()
|
||||
@@ -570,7 +570,7 @@ class MultiselectItemDecoration(
|
||||
}
|
||||
|
||||
private fun RecyclerView.getMultiselectableChildren(): Sequence<Multiselectable> {
|
||||
return if (SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
return if (FeatureFlags.useConversationFragmentV2()) {
|
||||
children.map { getChildViewHolder(it) }.filterIsInstance<Multiselectable>()
|
||||
} else {
|
||||
children.filterIsInstance<Multiselectable>()
|
||||
@@ -578,7 +578,7 @@ class MultiselectItemDecoration(
|
||||
}
|
||||
|
||||
private fun RecyclerView.getInteractableChildren(): Sequence<InteractiveConversationElement> {
|
||||
return if (SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
return if (FeatureFlags.useConversationFragmentV2()) {
|
||||
children.map { getChildViewHolder(it) }.filterIsInstance<InteractiveConversationElement>()
|
||||
} else {
|
||||
children.filterIsInstance<InteractiveConversationElement>()
|
||||
@@ -586,7 +586,7 @@ class MultiselectItemDecoration(
|
||||
}
|
||||
|
||||
private fun resolveMultiselectable(parent: RecyclerView, child: View): Multiselectable? {
|
||||
return if (SignalStore.internalValues().useConversationFragmentV2()) {
|
||||
return if (FeatureFlags.useConversationFragmentV2()) {
|
||||
parent.getChildViewHolder(child) as? Multiselectable
|
||||
} else {
|
||||
child as? Multiselectable
|
||||
|
||||
Reference in New Issue
Block a user