Skip to content

Commit

Permalink
06/07/2024.
Browse files Browse the repository at this point in the history
  • Loading branch information
youndon committed Jul 6, 2024
1 parent 3267064 commit 4b3eb00
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 40 deletions.
4 changes: 0 additions & 4 deletions app/src/main/java/city/zouitel/jetnote/NoteActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ class NoteActivity : ComponentActivity(), KoinComponent, IntentHandler {
WidgetReceiver.updateBroadcast(this)
}

override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
}

override fun onResume() {
super.onResume()
checkNoteActivityShortcut(this)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package city.zouitel.systemDesign

object CommonConstants {
const val APP_VERSION = "5.9.0"
const val APP_VERSION = "5.9.1"
const val APP_NAME = "JetNote"
const val NONE = "unspecified"

Expand Down
28 changes: 14 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ kotlin = "1.9.22"
compilesdk-v = "34"
minsdk-v = "26"
targetsdk-v = "34"
code-v = "590"
name-v = "5.9.0"
code-v = "591"
name-v = "5.9.1"
compose-v = "1.5.10"

#Android.
core-ktx = "1.13.0"
core-ktx = "1.13.1"
junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"
lifecycle = "2.7.0"
androidx-test-ext-junit = "1.2.1"
espresso-core = "3.6.1"
lifecycle = "2.8.3"
constraintlayout = "2.1.4"
glance = "1.0.0"
glance = "1.1.0"
security = "1.0.0"
workmanager = "2.9.0"
startup = "1.1.1"

#Compose.
activity-compose = "1.8.2"
compose-bom = "2024.04.01"
appcompat = "1.6.1"
material = "1.11.0"
activity-compose = "1.9.0"
compose-bom = "2024.06.00"
appcompat = "1.7.0"
material = "1.12.0"
navigation-compose = "2.7.7"
compose-constraintlayout = "1.1.0-alpha13"

#Plugins.
ksp = "1.9.23-1.0.20"
dependencyanalysis = "1.30.0"
dependencyanalysis = "1.32.0"

#KotlinX.
serialization = "1.6.3"
coroutines = "1.8.0"
coroutines = "1.8.1"

#Koin.
koin-core = "3.5.6"
Expand Down Expand Up @@ -65,7 +65,7 @@ coil-compose = "2.6.0"
coil-svg = "2.6.0"

#License.
license = "11.1.3"
license = "11.1.4"

#Voyager.
voyager = "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ data class MediaScreen(val id: String = "", val backgroundColor: Int = 0): Scree
) {
runCatching {
AsyncImage(
modifier = Modifier.fillMaxWidth(),
model = ImageRequest.Builder(context)
.data(filteredMedias[index].path)
.build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,4 @@ class DataScreenModel(
it.flush()
}
}

fun decodeBitmapImage (img: MutableState<Bitmap?>?, photo: MutableState<Bitmap?>?, uri: Uri?, context: Context){
if (Build.VERSION.SDK_INT < 28) {
runCatching {
img?.value = MediaStore.Images.Media.getBitmap(context.contentResolver,uri)
}
} else {
runCatching {
val source = uri?.let { ImageDecoder.createSource(context.contentResolver, it) }
img?.value = source?.let { ImageDecoder.decodeBitmap(it) }
}
}
photo?.value?.let { img?.value = it }
}

fun imageDecoder(context: Context, uid:String): ImageBitmap? {
val path = File(imgPath, "$uid.$JPEG")
val bitImg = BitmapFactory.decodeFile(path.absolutePath)
return bitImg?.asImageBitmap()
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package city.zouitel.note.ui.workplace

import android.annotation.SuppressLint
import android.content.Intent
import android.icu.util.Calendar
import android.text.format.DateFormat
import androidx.activity.compose.rememberLauncherForActivityResult
Expand Down Expand Up @@ -196,6 +197,7 @@ data class WorkplaceScreen(
val chooseImageLauncher =
rememberLauncherForActivityResult(ActivityResultContracts.PickMultipleVisualMedia()) { uris ->
uris.forEach { uri ->
context.contentResolver.takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION)
Random.nextLong().let {
mediaModel.addMedia(Media(id = it, path = uri.toString()))
noteAndMediaModel.addNoteAndMedia(NoteAndMedia(id, it))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ data class MainScreen(val isHome: Boolean): Screen {
remember(datastoreModel, datastoreModel::getOrdination).collectAsState().value
) {
CommonConstants.BY_NAME -> mainModel.allNotesByName.collectAsState()
CommonConstants.ORDER_BY_OLDEST -> mainModel.allNotesByOldest.collectAsState()
CommonConstants.ORDER_BY_OLDEST -> remember(mainModel, mainModel::allNotesByOldest).collectAsState()
CommonConstants.ORDER_BY_NEWEST -> mainModel.allNotesByNewest.collectAsState()
CommonConstants.ORDER_BY_PRIORITY -> mainModel.allNotesByPriority.collectAsState()
CommonConstants.ORDER_BY_REMINDER -> mainModel.allRemindingNotes.collectAsState()
Expand Down

0 comments on commit 4b3eb00

Please sign in to comment.