Closed vincent-paing closed 8 years ago
thanks @vincent-paing , i will quick build it
and i think should better compatibility mode
Object object = mPager.getAdapter().instantiateItem(mPager, loopCounter);
//Elevate the Center View if it's the selected position and de-elevate the left and right fragment
if(object instanceof Fragment){
Fragment fragment = (Fragment) object;
if (loopCounter == position) {
ViewCompat.setElevation(fragment.getView(), 8.0f);
} else {
ViewCompat.setElevation(fragment.getView(), 0.0f);
}
}else{
View view = (View) object;
if (loopCounter == position) {
ViewCompat.setElevation(view, 8.0f);
} else {
ViewCompat.setElevation(view, 0.0f);
}
}
Yeah it looks better since it will be compatible without FragmentPagerAdapter too 👍
Hi @vincent-paing ,Maybe you can write a demo, let more people learn to use
@crosswall Sure, I'll do a demo