add screen class override for setCurrentScreen

This commit is contained in:
Akinwale Ariwodola 2019-08-23 14:39:08 +01:00
parent 7b2044d2a4
commit e47a1e0bf2
2 changed files with 12 additions and 1 deletions

View file

@ -412,4 +412,14 @@ public final class Utils {
} }
return new SecretKeySpec(rsaDecrypt(Base64.decode(base64Key, Base64.DEFAULT), keyStore), "AES"); 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();
}
} }

View file

@ -12,6 +12,7 @@ import com.google.firebase.analytics.FirebaseAnalytics;
import io.lbry.browser.BuildConfig; import io.lbry.browser.BuildConfig;
import io.lbry.browser.MainActivity; import io.lbry.browser.MainActivity;
import io.lbry.browser.Utils;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -38,7 +39,7 @@ public class FirebaseModule extends ReactContextBaseJavaModule {
@ReactMethod @ReactMethod
public void setCurrentScreen(String name) { public void setCurrentScreen(String name) {
if (firebaseAnalytics != null) { if (firebaseAnalytics != null) {
firebaseAnalytics.setCurrentScreen(MainActivity.getActivity(), name, null); firebaseAnalytics.setCurrentScreen(MainActivity.getActivity(), name, Utils.capitalizeAndStrip(name));
} }
} }