Skip to content

Instantly share code, notes, and snippets.

@fo2rist
Last active March 23, 2020 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fo2rist/cb3c2a1ec70bd76e9ebba1f8b2940ae0 to your computer and use it in GitHub Desktop.
Save fo2rist/cb3c2a1ec70bd76e9ebba1f8b2940ae0 to your computer and use it in GitHub Desktop.
Java To Kotlin Conversion. Step 4. Interop After
class NonLazyDemoAdapter internal constructor(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
internal class FragmentBundle(
@JvmField
@SerializedName("id") // if this field was used directly before we need JvmField annotation
var id: Int,
@JvmField
@SerializedName("name") // if this field was used directly before we need JvmField annotation
var name: String
) : Serializable
companion object {
@JvmStatic // if this method was used from Java before we need JvmSatic annotation
fun createAdapter(fm: FragmentManager): NonLazyDemoAdapter {
...
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment