Skip to content

Commit

Permalink
Bump v6.0-RC3
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilKes committed Oct 20, 2024
1 parent 8bedc53 commit dbc585b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId 'com.philkes.notallyx'
minSdk 21
targetSdk 33
versionCode 57
versionName "6.0-RC2"
versionCode 58
versionName "6.0-RC3"
resourceConfigurations += ['en', 'ca', 'cs', 'da', 'de', 'el', 'es', 'fr', 'hu', 'in', 'it', 'ja', 'my', 'nb', 'nl', 'nn', 'pl', 'pt-rBR', 'pt-rPT', 'ro', 'ru', 'sk', 'sv', 'tl', 'tr', 'uk', 'vi', 'zh-rCN']
vectorDrawables.generatedDensities = []
}
Expand Down
21 changes: 8 additions & 13 deletions app/src/main/java/com/philkes/notallyx/data/dao/BaseNoteDao.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package com.philkes.notallyx.data.dao

import androidx.lifecycle.LiveData
import androidx.lifecycle.map
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
Expand All @@ -13,9 +16,6 @@ import com.philkes.notallyx.data.model.FileAttachment
import com.philkes.notallyx.data.model.Folder
import com.philkes.notallyx.data.model.LabelsInBaseNote
import com.philkes.notallyx.data.model.ListItem
import androidx.lifecycle.LiveData
import androidx.lifecycle.map


@Dao
interface BaseNoteDao {
Expand Down Expand Up @@ -117,16 +117,13 @@ interface BaseNoteDao {
* Since we store the labels as a JSON Array, it is not possible to perform operations on it.
* Thus, we use the 'Like' query which can return false positives sometimes.
*
* For example, a request for all base notes having the label 'Important' will also return
* base notes with the label 'Unimportant'. To prevent this, we use the extension function
* `map` directly on the LiveData to filter the results accordingly.
* For example, a request for all base notes having the label 'Important' will also return base
* notes with the label 'Unimportant'. To prevent this, we use the extension function `map`
* directly on the LiveData to filter the results accordingly.
*/

fun getBaseNotesByLabel(label: String): LiveData<List<BaseNote>> {
val result = getBaseNotesByLabel(label, Folder.NOTES)
return result.map { list ->
list.filter { baseNote -> baseNote.labels.contains(label) }
}
return result.map { list -> list.filter { baseNote -> baseNote.labels.contains(label) } }
}

@Query(
Expand All @@ -144,9 +141,7 @@ interface BaseNoteDao {

fun getBaseNotesByKeyword(keyword: String, folder: Folder): LiveData<List<BaseNote>> {
val result = getBaseNotesByKeywordImpl(keyword, folder)
return result.map { list ->
list.filter { baseNote -> matchesKeyword(baseNote, keyword) }
}
return result.map { list -> list.filter { baseNote -> matchesKeyword(baseNote, keyword) } }
}

@Query(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ import com.philkes.notallyx.presentation.viewmodel.BaseNoteModel
import com.philkes.notallyx.utils.Operations
import com.philkes.notallyx.utils.backup.BackupProgress
import com.philkes.notallyx.utils.backup.scheduleAutoBackup
import com.philkes.notallyx.utils.checkedTag
import com.philkes.notallyx.utils.canAuthenticateWithBiometrics
import com.philkes.notallyx.utils.checkedTag
import com.philkes.notallyx.utils.security.decryptDatabase
import com.philkes.notallyx.utils.security.encryptDatabase
import com.philkes.notallyx.utils.security.showBiometricOrPinPrompt
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/philkes/notallyx/utils/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ val FileAttachment.isImage: Boolean
get() {
return mimeType.startsWith("image/")
}

fun Folder.movedToResId(): Int {
return when (this) {
Folder.DELETED -> R.plurals.deleted_selected_notes
Expand All @@ -280,6 +281,7 @@ fun Folder.movedToResId(): Int {
fun RadioGroup.checkedTag(): Any {
return this.findViewById<RadioButton?>(this.checkedRadioButtonId).tag
}

fun Context.canAuthenticateWithBiometrics(): Int {
var canAuthenticate = true
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Expand Down

0 comments on commit dbc585b

Please sign in to comment.