mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-15 15:57:24 +02:00
store all added note widgets in a database
This commit is contained in:
parent
ad3c6aecfd
commit
64953a4e7d
@ -20,6 +20,7 @@ import com.simplemobiletools.notes.extensions.dbHelper
|
|||||||
import com.simplemobiletools.notes.extensions.getTextSize
|
import com.simplemobiletools.notes.extensions.getTextSize
|
||||||
import com.simplemobiletools.notes.helpers.MyWidgetProvider
|
import com.simplemobiletools.notes.helpers.MyWidgetProvider
|
||||||
import com.simplemobiletools.notes.models.Note
|
import com.simplemobiletools.notes.models.Note
|
||||||
|
import com.simplemobiletools.notes.models.Widget
|
||||||
import kotlinx.android.synthetic.main.widget_config.*
|
import kotlinx.android.synthetic.main.widget_config.*
|
||||||
|
|
||||||
class WidgetConfigureActivity : SimpleActivity() {
|
class WidgetConfigureActivity : SimpleActivity() {
|
||||||
@ -104,6 +105,8 @@ class WidgetConfigureActivity : SimpleActivity() {
|
|||||||
val views = RemoteViews(packageName, R.layout.activity_main)
|
val views = RemoteViews(packageName, R.layout.activity_main)
|
||||||
views.setBackgroundColor(R.id.notes_view, mBgColor)
|
views.setBackgroundColor(R.id.notes_view, mBgColor)
|
||||||
AppWidgetManager.getInstance(this).updateAppWidget(mWidgetId, views)
|
AppWidgetManager.getInstance(this).updateAppWidget(mWidgetId, views)
|
||||||
|
val widget = Widget(mWidgetId, mCurrentNoteId)
|
||||||
|
dbHelper.insertWidget(widget)
|
||||||
|
|
||||||
storeWidgetBackground()
|
storeWidgetBackground()
|
||||||
requestWidgetUpdate()
|
requestWidgetUpdate()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user