@Test public void testGetPrimaryPositionDefault() { final FragmentManager mockFragmentManager = mock(FragmentManager.class); final FragmentPagerAdapter adapter = new Adapter(mockFragmentManager); assertThat(adapter.getPrimaryPosition(), is(FragmentPagerAdapter.NO_POSITION)); }
@IntRange(from = NO_POSITION) public int getPrimaryPosition() { return primaryPosition; }
FragmentPagerAdapter extends PagerAdapter { @IntRange(from = NO_POSITION) public int getPrimaryPosition() { return primaryPosition; } }
FragmentPagerAdapter extends PagerAdapter { @IntRange(from = NO_POSITION) public int getPrimaryPosition() { return primaryPosition; } FragmentPagerAdapter(@NonNull final FragmentManager fragmentManager); }
FragmentPagerAdapter extends PagerAdapter { @IntRange(from = NO_POSITION) public int getPrimaryPosition() { return primaryPosition; } FragmentPagerAdapter(@NonNull final FragmentManager fragmentManager); @Override void startUpdate(@NonNull final ViewGroup container); @SuppressLint("CommitTransaction") @Override @NonNull Object instantiateItem(@NonNull final ViewGroup container, final int position); long getItemId(final int position); @NonNull abstract Fragment getItem(int position); @Override void setPrimaryItem(@NonNull final ViewGroup container, final int position, @Nullable final Object object); @Nullable Fragment getPrimaryFragment(); @IntRange(from = NO_POSITION) int getPrimaryPosition(); @Override boolean isViewFromObject(@NonNull final View view, @NonNull final Object object); @SuppressLint("CommitTransaction") @Override void destroyItem(@NonNull final ViewGroup container, final int position, @NonNull final Object object); @Override void finishUpdate(@NonNull final ViewGroup container); }
FragmentPagerAdapter extends PagerAdapter { @IntRange(from = NO_POSITION) public int getPrimaryPosition() { return primaryPosition; } FragmentPagerAdapter(@NonNull final FragmentManager fragmentManager); @Override void startUpdate(@NonNull final ViewGroup container); @SuppressLint("CommitTransaction") @Override @NonNull Object instantiateItem(@NonNull final ViewGroup container, final int position); long getItemId(final int position); @NonNull abstract Fragment getItem(int position); @Override void setPrimaryItem(@NonNull final ViewGroup container, final int position, @Nullable final Object object); @Nullable Fragment getPrimaryFragment(); @IntRange(from = NO_POSITION) int getPrimaryPosition(); @Override boolean isViewFromObject(@NonNull final View view, @NonNull final Object object); @SuppressLint("CommitTransaction") @Override void destroyItem(@NonNull final ViewGroup container, final int position, @NonNull final Object object); @Override void finishUpdate(@NonNull final ViewGroup container); static final int NO_POSITION; static final long NO_ID; }