ExpandingPager is a card peek/pop controller
Java
Latest commit 767ff93 Jul 7, 2016 @qs-lll committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
.idea pic Jun 22, 2016
app pic Jun 22, 2016
gradle/wrapper several changed Jun 21, 2016
img pic Jun 22, 2016
library complete it Jun 21, 2016
.gitignore several changed Jun 21, 2016
ExpandingPager.iml several changed Jun 21, 2016
README.md Update README.md Jul 7, 2016
build.gradle several changed Jun 21, 2016
gradle.properties first commi☺️ Jun 19, 2016
gradlew first commi☺️ Jun 19, 2016
gradlew.bat first commi☺️ Jun 19, 2016
settings.gradle first commi☺️ Jun 19, 2016

README.md

ExpandingPager

Android Arsenal

only support system 5.0/latest!!!😭who can solve before 5.0 support!!!

ExpandingPager is a card peek/pop controller

gif

SIZE & FRAGMENT AREA

Setup

Just extends ExpandingViewPagerAdapter in your Fragment Adapter and setup the ExpandingViewPager

ViewPager viewPager;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    viewPager = (ViewPager) findViewById(...);

    viewPager.setAdapter( new CustomViewPagerAdapter(getSupportFragmentManager()) );

    ExpandingFactory.setupViewPager(ViewPager viewPager);
}

Adapter

Just extends ExpandingViewPagerAdapter in your Fragment Adapter, which returns ExpandingFragment`

public class CustomViewPagerAdapter extends ExpandingViewPagerAdapter {

    @Override
    public Fragment getItem(int position) {
        return CustomExpandingFragment.newInstance();
    }

}

Your ExpandingFragment must returns a FragmentTop and a FragmentBottom

public class CustomExpandingFragment extends ExpandingFragment {

    @Override
    public Fragment getFragmentFront() {
        return CustomFragmentTop.newInstance();
    }

    @Override
    public Fragment getFragmentBottom() {
        return CustomFragmentBottom.newInstance();
    }
}

Fragments

Top

please do not set full screen click Event,it maybe can prevent the main click Event.

public class CustomFragmentTop extends Fragment  {


}

Bottom

Create your top fragment implementing ExpandingFragment.ChildTop

public class CustomFragmentBottom extends Fragment  {


}

BackPress

@Override
public void onBackPressed() {
    if(!expandingViewPager.onBackPressed(viewPager)){
        super.onBackPressed();
    }
}