add screen class override for setCurrentScreen
This commit is contained in:
parent
7b2044d2a4
commit
e47a1e0bf2
2 changed files with 12 additions and 1 deletions
|
@ -412,4 +412,14 @@ public final class Utils {
|
|||
}
|
||||
return new SecretKeySpec(rsaDecrypt(Base64.decode(base64Key, Base64.DEFAULT), keyStore), "AES");
|
||||
}
|
||||
|
||||
public static String capitalizeAndStrip(String text) {
|
||||
String[] parts = text.split(" ");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
sb.append(parts[i].substring(0, 1).toUpperCase()).append(parts[i].substring(1));
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.google.firebase.analytics.FirebaseAnalytics;
|
|||
|
||||
import io.lbry.browser.BuildConfig;
|
||||
import io.lbry.browser.MainActivity;
|
||||
import io.lbry.browser.Utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -38,7 +39,7 @@ public class FirebaseModule extends ReactContextBaseJavaModule {
|
|||
@ReactMethod
|
||||
public void setCurrentScreen(String name) {
|
||||
if (firebaseAnalytics != null) {
|
||||
firebaseAnalytics.setCurrentScreen(MainActivity.getActivity(), name, null);
|
||||
firebaseAnalytics.setCurrentScreen(MainActivity.getActivity(), name, Utils.capitalizeAndStrip(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue