Skip to content

Commit

Permalink
update image preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Kin69 committed Jul 12, 2024
1 parent 77f2ae9 commit 5572973
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import android.content.Context
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.glance.appwidget.updateAll
import com.kin.easynotes.data.repository.NoteRepositoryImpl
import com.kin.easynotes.domain.model.Note
import com.kin.easynotes.widget.NotesWidget
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -38,13 +40,13 @@ class NoteUseCase @Inject constructor(
observeKeysJob = coroutineScope.launch {
getAllNotes().collectLatest { keys ->
this@NoteUseCase.notes = keys
// NotesWidgetReceiver.updateBroadcast(context)
NotesWidget().updateAll(context)
}
}
}


fun getAllNotes(): Flow<List<Note>> {
private fun getAllNotes(): Flow<List<Note>> {
return noteRepository.getAllNotes()
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 0 additions & 30 deletions app/src/main/res/drawable/ic_launcher_foreground.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/drawable/widgetpreview2.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="300dp" android:viewportHeight="500" android:viewportWidth="700" android:width="420dp">
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="200dp" android:viewportHeight="400" android:viewportWidth="700" android:width="420dp">

<path android:fillColor="#000000" android:pathData="M0,0L0,33L0.75,32.22L0.83,31.69L1.17,30.89L1.39,29.97L2.03,28L2.39,27L3.25,25L3.78,24L4.78,22L5.25,21L6.47,19L7.22,18L8,17L9.61,15L10.39,14L12.08,12.03L14,10.22L16,8.69L17,8L19,6.67L21,5.33L22,4.69L24,3.56L25,3.08L27,2.33L29,1.69L29.94,1.42L30.94,1.22L31.5,1.08L33,1L32.22,0.28L31.69,0.25L30.89,0.06L29.97,0.03L28,0L26,0L23,0L0,0z" android:strokeColor="#00000000"/>

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/xml/add_note.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
android:minHeight="50.dp"
android:minWidth="100.dp"
android:resizeMode="none"
android:previewImage="@drawable/widget_preview_2"
android:widgetCategory="home_screen">
</appwidget-provider>
6 changes: 3 additions & 3 deletions app/src/main/res/xml/notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<appwidget-provider
android:configure="com.kin.easynotes.widget.NotesWidgetActivity"
xmlns:android="http://schemas.android.com/apk/res/android"
android:minHeight="100.dp"
android:minWidth="200.dp"
android:minHeight="50.dp"
android:minWidth="100.dp"
android:resizeMode="horizontal|vertical"
android:previewImage="@drawable/widgetpreview2"
android:previewImage="@drawable/widget_preview_1"
android:widgetCategory="home_screen">
</appwidget-provider>

0 comments on commit 5572973

Please sign in to comment.