###gradle
/build.gradle
repositories {
maven {
url "https://jitpack.io"
}
}
/app/build.gradle
compile 'com.github.zzz40500:AndroidSweetSheet:1.1.0'
###Usage:
// SweetSheet ??,?? rl ???? mSweetSheet = new SweetSheet(rl);
//????? (??????? list ??,????menu ?????) mSweetSheet.setMenuList(list);
//??????? Delegate ????????. mSweetSheet.setDelegate(new RecyclerViewDelegate(true));
//??????Effect???????:BlurEffect ????.DimEffect ????,NoneEffect ????. mSweetSheet.setBackgroundEffect(new BlurEffect(8));
//???????? mSweetSheet.setOnMenuItemClickListener(new SweetSheet.OnMenuItemClickListener() {
@Override public boolean onItemClick(int position, MenuEntity menuEntity1) {
//?????, true ??? SweetSheet ,false ???. Toast.makeText(MainActivity.this, menuEntity1.title + " " + position, Toast.LENGTH_SHORT).show();
return true;
}
}
);
?????:
// SweetSheet ??,?? rl ???? mSweetSheet3 = new SweetSheet(rl);
//???? CustomDelegate ? Delegate ,??????????. CustomDelegate customDelegate = new CustomDelegate(true, CustomDelegate.AnimationType.DuangLayoutAnimation);
View view = LayoutInflater.from(this).inflate(R.layout.layout_custom_view, null, false);
//???????. customDelegate.setCustomView(view);
//????? mSweetSheet3.setDelegate(customDelegate);
//????? CustomDelegate ??mSweetSheet3?? setMenuList?setOnMenuItemClickListener?????? view.findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
mSweetSheet3.dismiss();
}
}
);
????
@Override
public void onBackPressed() {
if(mSweetSheet.isShow()){
mSweetSheet.dismiss();
}
else{
super.onBackPressed();
}
}
###v1.1(????)
- ????ViewPager ??FragmentStatePagerAdapter ???????.
-
SweetSheet ??? LinearLayout ???????.
-
setMenuList ???????? List???Menu?????.(Menu?????Menu,??2?Menu?????????).
-
setBackgroundEffect(Effect effect) ??????????,????3???: BlurEffect:????,DimEffect ????,NoneEffect ????. ??????Effect???????
-
setDelegate ????????? RecyclerViewDelegate,ViewPagerDelegate,CustomDelegate.
-
CustomDelegate?????,?????????????????,??setCustomView(View v)???????????.
-
CustomDelegate????4???: DuangLayoutAnimation,DuangAnimation, AlphaAnimation,Custom: ???????????????.?????3?????????? Custom ,????setCustomViewAnimation??????.
-
CRImageView ????? Android 5.0???CircleReveal??.????:
CRImageView. circularReveal(int centerX, int centerY, float startRadius, float endRadius, long duration, Interpolator interpolator)
????????????.
###FAQ ????? actionBar ????????? ?? ?? FrameLayout??RelativeLayout ???? ToolBar ??? ActionBar ??? FrameLayout ??RelativeLayout??SweetSheet ????????,