mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
couple improvements to widgets and intent handling
This commit is contained in:
@ -18,7 +18,7 @@ class NotesPagerAdapter(fm: FragmentManager, val notes: List<Note>, val activity
|
||||
override fun getItem(position: Int): NoteFragment {
|
||||
val bundle = Bundle()
|
||||
val id = notes[position].id
|
||||
bundle.putInt(NOTE_ID, id!!.toInt())
|
||||
bundle.putLong(NOTE_ID, id!!)
|
||||
|
||||
if (fragments.containsKey(position)) {
|
||||
return fragments[position]!!
|
||||
|
@ -22,7 +22,7 @@ class WidgetAdapter(val context: Context, val intent: Intent) : RemoteViewsServi
|
||||
private var widgetTextColor = context.config.widgetTextColor
|
||||
|
||||
override fun getViewAt(position: Int): RemoteViews {
|
||||
val noteId = intent.getIntExtra(NOTE_ID, 1)
|
||||
val noteId = intent.getLongExtra(NOTE_ID, 0L)
|
||||
val views = RemoteViews(context.packageName, R.layout.widget_text_layout).apply {
|
||||
val note = context.notesDB.getNoteWithId(noteId)
|
||||
if (note != null) {
|
||||
|
Reference in New Issue
Block a user