duolingo/rtl-viewpager

Methods can be public to subclass it

paulocoutinhox opened this issue · 3 comments

Required Information

  • RtlViewPager Version: 2.0.0
  • Android Version: any

Issue Description

Hi,

The constructor and other method of class "DelegatingPagerAdapter" can be public to we subclass it and call "super" on constructor.

So instead of:

DelegatingPagerAdapter(@NonNull final PagerAdapter delegate) {
    this.mDelegate = delegate;
    delegate.registerDataSetObserver(new MyDataSetObserver(this));
}

PagerAdapter getDelegate() {
    return mDelegate;
}

Can be:

public DelegatingPagerAdapter(@NonNull final PagerAdapter delegate) {
    this.mDelegate = delegate;
    delegate.registerDataSetObserver(new MyDataSetObserver(this));
}

public PagerAdapter getDelegate() {
    return mDelegate;
}

Inside class: DelegatingPagerAdapter

Today i need copy full class DelegatingPagerAdapter into my project only to change the constructor to public and the other method as public.

Thanks.

DelegatingPagerAdapter is an implementation detail of this library, and is not meant to be part of its API.

I know.

But cannot e public? Will broke something?

Thanks.

You should pretend that that class doesn't exist at all in this library. Making a copy of the class is a reasonable solution.