// Path: material/src/main/java/com/rey/material/drawable/BlankDrawable.java
// public class BlankDrawable extends Drawable {
// 
// 	private static BlankDrawable mInstance;
// 	
// 	public static BlankDrawable getInstance(){
// 		if(mInstance == null)
// 			synchronized (BlankDrawable.class) {
// 				if(mInstance == null)
// 					mInstance = new BlankDrawable();
// 			}
// 		
// 		return mInstance;
// 	}
// 	
// 	@Override
// 	public void draw(Canvas canvas) {}
// 
// 	@Override
// 	public void setAlpha(int alpha) {}
// 
// 	@Override
// 	public void setColorFilter(ColorFilter cf) {}
// 
// 	@Override
// 	public int getOpacity() {
// 		return PixelFormat.TRANSPARENT;
// 	}
// 
// }


import android.content.Context;
import android.content.res.TypedArray;
import android.os.Handler;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.animation.Transformation;
import android.widget.FrameLayout;
import com.rey.material.R;
import com.rey.material.drawable.BlankDrawable;

    private GestureDetector mGestureDetector;
    private int mMinFlingVelocity;

    private final Handler mHandler = new Handler();
    private final Runnable mDismissAction = new Runnable() {
        public void run() {
            //dirty fix for java.lang.IllegalArgumentException: View not attached to window manager
            try {
                BottomSheetDialog.super.dismiss();
            }
            catch(IllegalArgumentException ex){}
        }
    };

    private boolean mRunShowAnimation = false;
    private Animation mAnimation;

    private boolean mDismissPending = false;

    public BottomSheetDialog(Context context) {
        this(context, R.style.Material_App_BottomSheetDialog);
    }

    public BottomSheetDialog(Context context, int style) {
        super(context, style);

        //Override style to ensure not show window's title or background.
        //TODO: find a way to ensure windowIsFloating attribute is false.
        requestWindowFeature(Window.FEATURE_NO_TITLE);
// Path: material/src/main/java/com/rey/material/drawable/BlankDrawable.java
// public class BlankDrawable extends Drawable {
// 
// 	private static BlankDrawable mInstance;
// 	
// 	public static BlankDrawable getInstance(){
// 		if(mInstance == null)
// 			synchronized (BlankDrawable.class) {
// 				if(mInstance == null)
// 					mInstance = new BlankDrawable();
// 			}
// 		
// 		return mInstance;
// 	}
// 	
// 	@Override
// 	public void draw(Canvas canvas) {}
// 
// 	@Override
// 	public void setAlpha(int alpha) {}
// 
// 	@Override
// 	public void setColorFilter(ColorFilter cf) {}
// 
// 	@Override
// 	public int getOpacity() {
// 		return PixelFormat.TRANSPARENT;
// 	}
// 
// }


// Path: material/src/main/java/com/rey/material/app/BottomSheetDialog.java
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Handler;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.animation.Transformation;
import android.widget.FrameLayout;
import com.rey.material.R;
import com.rey.material.drawable.BlankDrawable;


    private GestureDetector mGestureDetector;
    private int mMinFlingVelocity;

    private final Handler mHandler = new Handler();
    private final Runnable mDismissAction = new Runnable() {
        public void run() {
            //dirty fix for java.lang.IllegalArgumentException: View not attached to window manager
            try {
                BottomSheetDialog.super.dismiss();
            }
            catch(IllegalArgumentException ex){}
        }
    };

    private boolean mRunShowAnimation = false;
    private Animation mAnimation;

    private boolean mDismissPending = false;

    public BottomSheetDialog(Context context) {
        this(context, R.style.Material_App_BottomSheetDialog);
    }

    public BottomSheetDialog(Context context, int style) {
        super(context, style);

        //Override style to ensure not show window's title or background.
        //TODO: find a way to ensure windowIsFloating attribute is false.
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setBackgroundDrawable(BlankDrawable.getInstance());