|
|
|
|
@ -1,17 +1,21 @@ |
|
|
|
|
package net.pokeranalytics.android.ui.fragment |
|
|
|
|
|
|
|
|
|
import android.os.Bundle |
|
|
|
|
import android.view.LayoutInflater |
|
|
|
|
import android.view.View |
|
|
|
|
import android.view.ViewGroup |
|
|
|
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment |
|
|
|
|
import kotlinx.android.synthetic.main.fragment_bottom_sheet_container.* |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import android.content.Context |
|
|
|
|
import android.content.DialogInterface |
|
|
|
|
import android.view.* |
|
|
|
|
import android.view.inputmethod.InputMethodManager |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BottomSheetFragment : BottomSheetDialogFragment() { |
|
|
|
|
|
|
|
|
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
|
|
|
|
return inflater.inflate(R.layout.fragment_bottom_sheet_container, container, false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return inflater.inflate(net.pokeranalytics.android.R.layout.fragment_bottom_sheet_container, container, false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
|
@ -19,6 +23,30 @@ class BottomSheetFragment : BottomSheetDialogFragment() { |
|
|
|
|
initUI() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onStart() { |
|
|
|
|
super.onStart() |
|
|
|
|
|
|
|
|
|
// Open the keyboard |
|
|
|
|
val inputMethodManager = requireContext().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager |
|
|
|
|
inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0) |
|
|
|
|
editText.requestFocus() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Actions: |
|
|
|
|
* - Add / Add ? |
|
|
|
|
* - Clear / Garbage ? |
|
|
|
|
* - Done / Check ? |
|
|
|
|
* - |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
override fun onDismiss(dialog: DialogInterface?) { |
|
|
|
|
super.onDismiss(dialog) |
|
|
|
|
val inputMethodManager = requireContext().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager |
|
|
|
|
inputMethodManager.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Init UI |
|
|
|
|
*/ |
|
|
|
|
@ -28,4 +56,13 @@ class BottomSheetFragment : BottomSheetDialogFragment() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
fun displayDataForRow() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |