|
|
|
|
@ -78,7 +78,7 @@ abstract class AbstractReportFragment : DataManagerFragment() { |
|
|
|
|
val dialog = builder.create() |
|
|
|
|
dialog.setOnShowListener { |
|
|
|
|
nameEditText.requestFocus() |
|
|
|
|
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
|
|
|
|
dialog.getWindow()?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dialog.show() |
|
|
|
|
@ -94,7 +94,8 @@ abstract class AbstractReportFragment : DataManagerFragment() { |
|
|
|
|
getRealm().executeTransaction { realm -> |
|
|
|
|
|
|
|
|
|
val rs = this.item as ReportSetup |
|
|
|
|
|
|
|
|
|
val firstSave = (this.primaryKey == null) |
|
|
|
|
if (firstSave) { |
|
|
|
|
val options = this._selectedReport.options |
|
|
|
|
rs.name = name |
|
|
|
|
rs.display = options.display.ordinal |
|
|
|
|
@ -109,15 +110,18 @@ abstract class AbstractReportFragment : DataManagerFragment() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
options.filterId?.let { id -> |
|
|
|
|
String |
|
|
|
|
rs.filter = realm.findById(id) |
|
|
|
|
} |
|
|
|
|
realm.copyToRealmOrUpdate(rs) |
|
|
|
|
} else { |
|
|
|
|
rs.name = name |
|
|
|
|
realm.insertOrUpdate(rs) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.item = rs |
|
|
|
|
this.primaryKey = rs.id |
|
|
|
|
|
|
|
|
|
this.deleteButtonShouldAppear = true |
|
|
|
|
toolbar.title = name |
|
|
|
|
realm.copyToRealmOrUpdate(rs) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|