Skip to content

Commit

Permalink
* SVG parsing
Browse files Browse the repository at this point in the history
* SVG generating
* Fix gradle build and deprecated APIs
* Move local texts to string resource file
* Add extended fab
* Generalize file listing function
* Fix extra line feed in text content

Co-authored-by: Tuan Nguyen <[email protected]>
  • Loading branch information
shubertm and tuancoltech committed Jan 8, 2024
1 parent 3cc5a08 commit 8b876e6
Show file tree
Hide file tree
Showing 41 changed files with 1,370 additions and 435 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
cache: gradle

Expand Down
8 changes: 5 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
}

android {
namespace 'dev.arkbuilders.arkmemo'
compileSdk 33

defaultConfig {
Expand Down Expand Up @@ -62,13 +63,14 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
buildFeatures{
buildConfig true
viewBinding true
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="dev.arkbuilders.arkmemo">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand Down
12 changes: 0 additions & 12 deletions app/src/main/java/dev/arkbuilders/arkmemo/data/ResourceMeta.kt

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 22 additions & 0 deletions app/src/main/java/dev/arkbuilders/arkmemo/di/CoroutinesModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dev.arkbuilders.arkmemo.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import javax.inject.Named
import javax.inject.Singleton

@InstallIn(SingletonComponent::class)
@Module
object CoroutinesModule {

@Named(IO_DISPATCHER)
@Singleton
@Provides
fun provideDispatcher(): CoroutineDispatcher = Dispatchers.IO
}

const val IO_DISPATCHER = "iODispatcher"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package dev.arkbuilders.arkmemo.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import dev.arkbuilders.arklib.user.properties.PropertiesStorageRepo
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import javax.inject.Named
import javax.inject.Singleton

@InstallIn(SingletonComponent::class)
@Module
object PropertiesStorageModule {

@Singleton
@Provides
@Named(STORAGE_SCOPE)
fun storageScope(
@Named(IO_DISPATCHER) dispatcher: CoroutineDispatcher
): CoroutineScope = CoroutineScope(dispatcher)

@Singleton
@Provides
fun propertiesStorageRepo(
@Named(STORAGE_SCOPE) storageScope: CoroutineScope
): PropertiesStorageRepo {
return PropertiesStorageRepo(storageScope)
}

const val STORAGE_SCOPE = "storageScope"
}
24 changes: 21 additions & 3 deletions app/src/main/java/dev/arkbuilders/arkmemo/di/RepositoryModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,33 @@ package dev.arkbuilders.arkmemo.di

import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import dev.arkbuilders.arkmemo.data.repositories.TextNotesRepo
import dev.arkbuilders.arkmemo.data.repositories.TextNotesRepoImpl
import dev.arkbuilders.arklib.user.properties.PropertiesStorageRepo
import dev.arkbuilders.arkmemo.repo.graphics.GraphicNotesRepo
import dev.arkbuilders.arkmemo.repo.NotesRepo
import dev.arkbuilders.arkmemo.repo.text.TextNotesRepo
import dev.arkbuilders.arkmemo.models.GraphicNote
import dev.arkbuilders.arkmemo.models.TextNote
import dev.arkbuilders.arkmemo.preferences.MemoPreferences
import dev.arkbuilders.arkmemo.repo.NotesRepoHelper


@InstallIn(SingletonComponent::class)
@Module
abstract class RepositoryModule {
@Binds
abstract fun bindRepository(impl: TextNotesRepoImpl): TextNotesRepo
abstract fun bindTextNotesRepo(impl: TextNotesRepo): NotesRepo<TextNote>

@Binds
abstract fun bindGraphicNotesRepo(impl: GraphicNotesRepo): NotesRepo<GraphicNote>

companion object {
@Provides
fun provideNotesRepoHelper(
memoPreferences: MemoPreferences,
propertiesStorageRepo: PropertiesStorageRepo
) = NotesRepoHelper(memoPreferences, propertiesStorageRepo)
}
}
Loading

0 comments on commit 8b876e6

Please sign in to comment.