mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
move text size getter in an extension
This commit is contained in:
@ -10,7 +10,7 @@ import com.simplemobiletools.notes.R
|
||||
import com.simplemobiletools.notes.databases.DBHelper
|
||||
import kotlinx.android.synthetic.main.dialog_radio_group.view.*
|
||||
|
||||
class OpenNoteDialog(val activity: Activity) : RadioGroup.OnCheckedChangeListener {
|
||||
class OpenNoteDialog(val activity: Activity, val callback: (checkedId: Int) -> Unit) : RadioGroup.OnCheckedChangeListener {
|
||||
val dialog: AlertDialog?
|
||||
|
||||
init {
|
||||
@ -39,11 +39,7 @@ class OpenNoteDialog(val activity: Activity) : RadioGroup.OnCheckedChangeListene
|
||||
}
|
||||
|
||||
override fun onCheckedChanged(group: RadioGroup, checkedId: Int) {
|
||||
(activity as OpenNoteListener).noteSelected(checkedId)
|
||||
callback.invoke(checkedId)
|
||||
dialog?.dismiss()
|
||||
}
|
||||
|
||||
interface OpenNoteListener {
|
||||
fun noteSelected(id: Int)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user