##Flipboard style bottom sheet in Android
gradle dependecies
compile 'com.flipboard:bottomsheet-core:1.5.0'
compile 'com.flipboard:bottomsheet-commons:1.5.0' // optional
In view wrap your layout using the BottomSheetLayout
<com.flipboard.bottomsheet.BottomSheetLayout
android:id="@+id/bottomsheet"
android:layout_width="match_parent"
android:layout_height="match_parent">
In your activity inflate a view
mBottomSheet = (BottomSheetLayout) findViewById(R.id.bottomsheet);
mBottomSheet.showWithSheetView(LayoutInflater.from(this).inflate(R.layout.sheet_deal, mBottomSheet, false));
mBottomSheet.setShouldDimContentView(false);
mBottomSheet.setInterceptContentTouch(false);
mBottomSheet.setPeekOnDismiss(false);
mBottomSheet.addOnSheetDismissedListener(new OnSheetDismissedListener() {
@Override
public void onDismissed(BottomSheetLayout bottomSheetLayout) {
if (mCurrentPage == 0)
onBackPressed();
bottomSheetLayout.dismissSheet();
}
});
mBuyNow = (LinearLayout) mBottomSheet.findViewById(R.id.lbtn_buy_now);
mBuyNow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
buyDeal();
}
});
mSheetPrice = (TextView) mBottomSheet.findViewById(R.id.sheet_price);
mSheetPrice.setText(mDeal.getPrice().getPrice());
mSheetBuyNow = (TextView) mBottomSheet.findViewById(R.id.sheet_buy_now);
mSheetBuyNow.setText(mDataService.getTranslation("2369.Buttons_stickyDealBuyNow").toUpperCase());