【文件属性】:
文件名称:可以滑动页面的项目
文件大小:3.59MB
文件格式:ZIP
更新时间:2019-11-01 04:32:03
Android
USAGE
1.Currently supported Activity, Fragment, DialogFragment,Dilaog and View.
2.By following simple operation, it may have a sliding function.
by SliderUtils.attach*
public class SampleActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_slider);
SliderUtils.attachActivity(this, mConfig);
}
}
or by extends:
public class ExtendsActivity extends SliderActivity {
}
or by xml:
Note: activity of manifest need to override the configured theme: android: windowIsTranslucent, otherwise slide open the background is black.
If the device is greater than the version of android L, you can use the following method instead:
SliderUtils.attachUi(this, null);
Utils.convertActivityToTranslucent activity)
If extends SliderFragment, you need to pay attention to is: SliderFragment onCreateView function have been final overwritten, so another abstract methods to achieve creatingView and returns the layout of inflate objects.
public class ExtendsFragment extends SliderFragment
{
@Override
public View creatingView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_entends, container, false);
}
}
or by SliderUtils
public class SampleFragment extends Fragment
{
private ISlider iSlider;
private View rootView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_sample, container, false);
SliderUtils.attachFragment(this, rootView,null)
return iSlider.getSliderView();
}
}
DialogFragment: extends SliderDialogFragment or like this:
public class SlidabelDialogFragment extends DialogFragment
{
protected ISlider iSlider;
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
iSlider = SliderUtils.attachDialog(getActivity(),getDialog(),mConfig);
}
}
For more details, please refer to the code
DEPENDENCIES
dependencies{
compile 'com.komi.slider:slider:0.4.0'
}
ISSUES
1.Welcome to the Issues and refine the project, if you like, please click on the star, later will expand more useful features!
2.This project extends from SwipeBackLayout and Slidr
AUTHOR
KobeKomi