logo
On this page

Modify User Interface text

Live Streaming Kit (ZegoUIKitPrebuiltLiveStreaming)'s UI text provided by the internal components is editable, to modify those, use the ZegoTranslationText config.

Here is the reference code:

public class LiveActivity extends AppCompatActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_live);

    long appID = YourAppID;
    String appSign = YourAppSign;
    String userID = "userID";
    String userName = "userName";
    String liveID = "testLiveID";

    // Modify your custom configurations here.
    ZegoUIKitPrebuiltLiveStreamingConfig config;
    if (isHost) {
        config = ZegoUIKitPrebuiltLiveStreamingConfig.host();
    } else {
        config = ZegoUIKitPrebuiltLiveStreamingConfig.audience();
    }
    config.translationText.startLiveStreamingButton = 'Start Live'
    config.translationText.noHostOnline = 'No host online'
    ZegoUIKitPrebuiltLiveStreamingFragment fragment = ZegoUIKitPrebuiltLiveStreamingFragment
            .newInstance(appID, appSign, userID, userName, liveID, config);

    getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.fragment_container, fragment)
            .commitNow();
  }
}

Previous

Add custom UI components

Next

Customize the menu bar

On this page

Back to top