package com.philliphsu.bottomsheetpickers.view.numberpad;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetDialog;
import android.view.View;

import com.philliphsu.bottomsheetpickers.R;

/**
 * Created by Phillip Hsu on 4/5/2017.
 */

public class BottomSheetNumberPadTimePickerDialog extends BottomSheetDialog {

    private final NumberPadTimePicker mTimePicker;
    private final View mOkButton;

    public BottomSheetNumberPadTimePickerDialog(@NonNull Context context) {
        super(context);

        setContentView(R.layout.bsp_bottomsheet_numberpad_time_picker);
        mTimePicker = (NumberPadTimePicker) findViewById(R.id.bsp_numberpad_time_picker);
        mOkButton = findViewById(R.id.bsp_ok_button);
    }
}

@@ -71,66 +71,191 @@
 oid.
-content.Context;%0Aimport android.support.annotation.NonNull
+app.TimePickerDialog.OnTimeSetListener;%0Aimport android.content.Context;%0Aimport android.os.Bundle;%0Aimport android.support.annotation.NonNull;%0Aimport android.support.annotation.Nullable
 ;%0Aim
@@ -384,56 +384,8 @@
 R;%0A%0A
-/**%0A * Created by Phillip Hsu on 4/5/2017.%0A */%0A%0A
 publ
@@ -500,54 +500,24 @@
 cker
- mTimePicker;%0A    private final View mOkButton
+DialogView mView
 ;%0A%0A 
@@ -587,16 +587,172 @@
  context
+,%0A                                                @Nullable OnTimeSetListener listener,%0A                                                boolean is24HourMode
 ) %7B%0A    
@@ -771,25 +771,24 @@
 ntext);%0A
-%0A
         
 setConte
@@ -783,23 +783,71 @@
     
-setContentView(
+final View root = getLayoutInflater().inflate(%0A                
 R.la
@@ -880,32 +880,38 @@
 rpad_time_picker
+, null
 );%0A        mTime
@@ -909,10 +909,35 @@
     
-mT
+final NumberPadTimePicker t
 imeP
@@ -965,17 +965,38 @@
 ePicker)
- 
+%0A                root.
 findView
@@ -1045,10 +1045,20 @@
     
-mO
+final View o
 kBut
@@ -1063,16 +1063,21 @@
 utton = 
+root.
 findView
@@ -1102,16 +1102,676 @@
 utton);%0A
+        mView = new NumberPadTimePickerDialogView(context, timePicker,%0A                okButton, listener, is24HourMode);%0A        setContentView(root);%0A    %7D%0A%0A    @Override%0A    protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        mView.onCreate(savedInstanceState);%0A    %7D%0A%0A    @NonNull%0A    @Override%0A    public Bundle onSaveInstanceState() %7B%0A        return mView.onSaveInstanceState(super.onSaveInstanceState());%0A    %7D%0A%0A    @Override%0A    protected void onStop() %7B%0A        super.onStop();%0A        mView.onStop();%0A    %7D%0A%0A    @Override%0A    public void cancel() %7B%0A        super.cancel();%0A        mView.cancel();%0A
     %7D%0A%7D%0A

Implement BottomSheetNumberPadTimePickerDialog.