zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.78k stars 748 forks source link

Support Kotlin #692

Open curt-tophatter opened 3 years ago

curt-tophatter commented 3 years ago

:clipboard: Description

At least in the manual installation instructions Kotlin should be supported, since the changes to the native Java code for Android is pretty minimal.

:microphone: Motivation

Running yarn react-native link react-native-sound will fail if MainApplication.java is not found.

:bulb: Relevant Code

Instructions for installation, presently:

  @Override
  protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new RNSoundPackage() // <-- New
    );
  }

Could be amended to also include these instructions:

override protected fun getPackages():List<ReactPackage> {
  return Arrays.asList<ReactPackage>(
    MainReactPackage(),
    RNSoundPackage() // <-- New
  )
}