Add initial implementation of calls tab behind a feature flag.

This commit is contained in:
Alex Hart
2023-03-15 12:52:18 -03:00
committed by Greyson Parrelli
parent d1373d2767
commit 88de0f21e7
33 changed files with 1464 additions and 63 deletions

View File

@@ -106,6 +106,7 @@ 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";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -162,7 +163,8 @@ public final class FeatureFlags {
PAYPAL_ONE_TIME_DONATIONS,
PAYPAL_RECURRING_DONATIONS,
TEXT_FORMATTING,
ANY_ADDRESS_PORTS_KILL_SWITCH
ANY_ADDRESS_PORTS_KILL_SWITCH,
CALLS_TAB
);
@VisibleForTesting
@@ -584,6 +586,13 @@ public final class FeatureFlags {
return getBoolean(ANY_ADDRESS_PORTS_KILL_SWITCH, false);
}
/**
* Whether or not the calls tab is enabled
*/
public static boolean callsTab() {
return getBoolean(CALLS_TAB, false);
}
/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);

View File

@@ -1,6 +1,8 @@
package org.thoughtcrime.securesms.util
import android.view.View
import android.widget.TextView
import androidx.annotation.DrawableRes
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
@@ -28,3 +30,17 @@ inline fun View.doOnEachLayout(crossinline action: (view: View) -> Unit): View.O
addOnLayoutChangeListener(listener)
return listener
}
fun TextView.setRelativeDrawables(
@DrawableRes start: Int = 0,
@DrawableRes top: Int = 0,
@DrawableRes bottom: Int = 0,
@DrawableRes end: Int = 0
) {
setCompoundDrawablesRelativeWithIntrinsicBounds(
start,
top,
end,
bottom
)
}