mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-02-03 23:57:38 +01:00
do not extend alertdialog.builder at dialogs
This commit is contained in:
parent
4f8bf649f7
commit
83a1c707e0
@ -9,16 +9,15 @@ import com.simplemobiletools.notes.Config
|
||||
import com.simplemobiletools.notes.R
|
||||
import com.simplemobiletools.notes.databases.DBHelper
|
||||
|
||||
class OpenNoteDialog(val activity: Activity) : AlertDialog.Builder(activity), RadioGroup.OnCheckedChangeListener {
|
||||
class OpenNoteDialog(val activity: Activity) : RadioGroup.OnCheckedChangeListener {
|
||||
val dialog: AlertDialog?
|
||||
|
||||
init {
|
||||
val config = Config.newInstance(context)
|
||||
val config = Config.newInstance(activity)
|
||||
val view = activity.layoutInflater.inflate(R.layout.dialog_radio_group, null) as RadioGroup
|
||||
view.setOnCheckedChangeListener(this)
|
||||
|
||||
val db = DBHelper.newInstance(context)
|
||||
val notes = db.notes
|
||||
val notes = DBHelper.newInstance(activity).notes
|
||||
notes.forEach {
|
||||
val radioButton = activity.layoutInflater.inflate(R.layout.radio_button, null) as RadioButton
|
||||
radioButton.apply {
|
||||
@ -34,7 +33,7 @@ class OpenNoteDialog(val activity: Activity) : AlertDialog.Builder(activity), Ra
|
||||
.setView(view)
|
||||
.create()
|
||||
|
||||
dialog?.show()
|
||||
dialog!!.show()
|
||||
}
|
||||
|
||||
override fun onCheckedChanged(group: RadioGroup, checkedId: Int) {
|
||||
|
@ -9,16 +9,16 @@ import com.simplemobiletools.notes.Config
|
||||
import com.simplemobiletools.notes.R
|
||||
import com.simplemobiletools.notes.databases.DBHelper
|
||||
|
||||
class WidgetNoteDialog(val activity: Activity) : AlertDialog.Builder(activity), RadioGroup.OnCheckedChangeListener {
|
||||
class WidgetNoteDialog(val activity: Activity) : RadioGroup.OnCheckedChangeListener {
|
||||
val dialog: AlertDialog?
|
||||
var mConfig: Config
|
||||
|
||||
init {
|
||||
mConfig = Config.newInstance(context)
|
||||
mConfig = Config.newInstance(activity)
|
||||
val view = activity.layoutInflater.inflate(R.layout.dialog_radio_group, null) as RadioGroup
|
||||
view.setOnCheckedChangeListener(this)
|
||||
|
||||
val db = DBHelper.newInstance(context)
|
||||
val db = DBHelper.newInstance(activity)
|
||||
val notes = db.notes
|
||||
notes.forEach {
|
||||
val radioButton = activity.layoutInflater.inflate(R.layout.radio_button, null) as RadioButton
|
||||
|
Loading…
x
Reference in New Issue
Block a user