Skip to content

Instantly share code, notes, and snippets.

@fo2rist
Created March 23, 2020 22:01
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/ec38f58ca14e00c29e2e4480e47d0267 to your computer and use it in GitHub Desktop.
Save fo2rist/ec38f58ca14e00c29e2e4480e47d0267 to your computer and use it in GitHub Desktop.
Java To Kotlin Conversion. Step 3. Conversion Before
public class NonLazyDemoAdapter extends FragmentStatePagerAdapter {
@NonNull // don't forget to mark array content non-nullable
private SomePage[] pages = new SomePage[]{FIRST, SECOND};
@NonNull
private PageFragment[] cachedFragments = new PageFragment[pages.length];
NonLazyDemoAdapter(@NonNull FragmentManager fm) {
...
}
@NonNull
@Override
public Fragment getItem(int position) {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment