|
|
|
|
@ -9,7 +9,6 @@ import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.calculus.Report |
|
|
|
|
import net.pokeranalytics.android.model.LiveData |
|
|
|
|
import net.pokeranalytics.android.model.realm.ReportSetup |
|
|
|
|
import net.pokeranalytics.android.ui.activity.components.PokerAnalyticsActivity |
|
|
|
|
import net.pokeranalytics.android.ui.fragment.data.DataManagerFragment |
|
|
|
|
|
|
|
|
|
abstract class AbstractReportFragment : DataManagerFragment() { |
|
|
|
|
@ -28,8 +27,6 @@ abstract class AbstractReportFragment : DataManagerFragment() { |
|
|
|
|
|
|
|
|
|
protected var reportTitle: String? = null |
|
|
|
|
|
|
|
|
|
protected lateinit var parentActivity: PokerAnalyticsActivity |
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) { |
|
|
|
|
super.onCreate(savedInstanceState) |
|
|
|
|
|
|
|
|
|
@ -41,25 +38,17 @@ abstract class AbstractReportFragment : DataManagerFragment() { |
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
|
|
|
|
|
|
parentActivity = activity as PokerAnalyticsActivity |
|
|
|
|
|
|
|
|
|
// Avoid a bug during setting the titleResId |
|
|
|
|
toolbar.title = "" |
|
|
|
|
|
|
|
|
|
parentActivity.setSupportActionBar(toolbar) |
|
|
|
|
parentActivity.supportActionBar?.setDisplayHomeAsUpEnabled(true) |
|
|
|
|
setHasOptionsMenu(true) |
|
|
|
|
|
|
|
|
|
toolbar.title = reportTitle |
|
|
|
|
|
|
|
|
|
setDisplayHomeAsUpEnabled(true) |
|
|
|
|
setToolbarTitle(reportTitle) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun saveData() { |
|
|
|
|
|
|
|
|
|
activity?.let { |
|
|
|
|
val builder = AlertDialog.Builder(it) |
|
|
|
|
|
|
|
|
|
// Get the layout inflater |
|
|
|
|
val inflater = requireActivity().layoutInflater; |
|
|
|
|
val inflater = requireActivity().layoutInflater |
|
|
|
|
|
|
|
|
|
// Inflate and set the layout for the dialog |
|
|
|
|
// Pass null as the parent view because its going in the dialog layout |
|
|
|
|
|