|
|
|
|
@ -3,11 +3,9 @@ package net.pokeranalytics.android.ui.fragment.report |
|
|
|
|
import android.os.Bundle |
|
|
|
|
import android.text.InputType |
|
|
|
|
import android.view.View |
|
|
|
|
import android.view.inputmethod.InputMethodManager |
|
|
|
|
import android.widget.EditText |
|
|
|
|
import android.widget.Toast |
|
|
|
|
import androidx.appcompat.app.AlertDialog |
|
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.calculus.Report |
|
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
|
@ -60,8 +58,8 @@ abstract class AbstractReportFragment : DataManagerFragment() { |
|
|
|
|
|
|
|
|
|
override fun saveData() { |
|
|
|
|
|
|
|
|
|
activity?.let { |
|
|
|
|
val builder = AlertDialog.Builder(it) |
|
|
|
|
activity?.let { activity -> |
|
|
|
|
val builder = AlertDialog.Builder(activity) |
|
|
|
|
|
|
|
|
|
// Get the layout inflater |
|
|
|
|
val inflater = requireActivity().layoutInflater |
|
|
|
|
@ -94,19 +92,6 @@ abstract class AbstractReportFragment : DataManagerFragment() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val dialog = builder.create() |
|
|
|
|
dialog.setOnShowListener { |
|
|
|
|
nameEditText.requestFocus() |
|
|
|
|
val s = |
|
|
|
|
ContextCompat.getSystemService(requireContext(), InputMethodManager::class.java) |
|
|
|
|
s?.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dialog.setOnDismissListener { |
|
|
|
|
val s = |
|
|
|
|
ContextCompat.getSystemService(requireContext(), InputMethodManager::class.java) |
|
|
|
|
s?.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dialog.show() |
|
|
|
|
|
|
|
|
|
} ?: throw PAIllegalStateException("Activity cannot be null") |
|
|
|
|
|