ExpandingPager is a card peek/pop controller
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
app
gradle/wrapper
img pic Jun 22, 2016
library
.gitignore
ExpandingPager.iml several changed Jun 21, 2016
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
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();
    }
}