Skip to content

Instantly share code, notes, and snippets.

@flopshot
Created September 11, 2019 15:19
Show Gist options
  • Save flopshot/3993bdb2b3cef7c7c1b7f7bd1e10f291 to your computer and use it in GitHub Desktop.
Save flopshot/3993bdb2b3cef7c7c1b7f7bd1e10f291 to your computer and use it in GitHub Desktop.
WhiteLabelConfig.java
// WhiteLabelConfig.java
package com.whitelabeldemo;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import javax.annotation.Nonnull;
public class WhiteLabelConfig extends ReactContextBaseJavaModule {
@Nonnull
private final String appName;
public WhiteLabelConfig(@Nonnull ReactApplicationContext reactContext) {
super(reactContext);
this.appName = reactContext
.getApplicationContext()
.getResources()
.getString(R.string.app_name);
}
@Nonnull
@Override
public String getName() {
return "WhiteLabelConfig";
}
@Nonnull
@ReactMethod(isBlockingSynchronousMethod = true)
public String getAppName() {
return appName;
}
@Nonnull
@ReactMethod(isBlockingSynchronousMethod = true)
public String getPrimaryColor() {
return "#fdf6e3";
}
@Nonnull
@ReactMethod(isBlockingSynchronousMethod = true)
public String getPrimaryTextColor() {
return "#657b83";
}
@Nonnull
@ReactMethod(isBlockingSynchronousMethod = true)
public String getGreetingText() {
return "Welcome";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment