Android BottomSheetDialogFragment does not expand completely

Using this code in onCreateView. getDialog().setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { BottomSheetDialog d = (BottomSheetDialog) dialog; FrameLayout bottomSheet = (FrameLayout) d.findViewById(R.id.design_bottom_sheet); CoordinatorLayout coordinatorLayout = (CoordinatorLayout) bottomSheet.getParent(); BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); bottomSheetBehavior.setPeekHeight(bottomSheet.getHeight()); coordinatorLayout.getParent().requestLayout(); } });

What are the new features of Android Design Support Library and how to use its Snackbar?

The new Snackbar doesn’t require Android-M. It is inside the new design support library and you can use it today. Just update your SDK add this dependency in your code: compile ‘com.android.support:design:22.2.0’ You can use a code like this: Snackbar.make(view, “Here’s a Snackbar”, Snackbar.LENGTH_LONG) .setAction(“Action”, null) .show(); It is like a Toast. To assign an … Read more

Facebook SDK for Android duplicate support library on dependencies

It seems like the different projects are using two separate support libraries and therefore the checksum is different. You must repeat this for both the Facebook SDK project and the app you are building. What I do when I get this error is: Right click the project. Hover over Android Tools. Click on “Add support … Read more

Video player lights out mode in Android using appcompat-v7

I’ve found fitssystemwindows pretty unreliable as well when you want some elements of the view hierarchy to be fullscreen and some elements to be below the status bar or action bar. But I’ve never seen the action bar behind the status bar. Is the Toolbar set as the activity actionbar? Are you using Window.FEATURE_ACTION_BAR_OVERLAY? Anyway, … Read more

Android ViewPager with previous and next pages visible?

I used a negative page margin to partly show the next and the previous pages. The fading edge property can be used to make previous/next page fade: ViewPager examplePager = (ViewPager) findViewById(R.id.exampleView); examplePager.setPageMargin(-50); examplePager.setHorizontalFadingEdgeEnabled(true); examplePager.setFadingEdgeLength(30); The lastest support package (revision 4, October 2011) is also required for this to work