Skip to content

Commit 64953a4

Browse files
committed
store all added note widgets in a database
1 parent ad3c6ae commit 64953a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/activities/WidgetConfigureActivity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import com.simplemobiletools.notes.extensions.dbHelper
2020
import com.simplemobiletools.notes.extensions.getTextSize
2121
import com.simplemobiletools.notes.helpers.MyWidgetProvider
2222
import com.simplemobiletools.notes.models.Note
23+
import com.simplemobiletools.notes.models.Widget
2324
import kotlinx.android.synthetic.main.widget_config.*
2425

2526
class WidgetConfigureActivity : SimpleActivity() {
@@ -104,6 +105,8 @@ class WidgetConfigureActivity : SimpleActivity() {
104105
val views = RemoteViews(packageName, R.layout.activity_main)
105106
views.setBackgroundColor(R.id.notes_view, mBgColor)
106107
AppWidgetManager.getInstance(this).updateAppWidget(mWidgetId, views)
108+
val widget = Widget(mWidgetId, mCurrentNoteId)
109+
dbHelper.insertWidget(widget)
107110

108111
storeWidgetBackground()
109112
requestWidgetUpdate()

0 commit comments

Comments
 (0)