Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure project #393

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ android {
dependencies {
//For local developments of arklib-android:
//def arklibVersion = '999'
def arklibVersion = '0.2.6'
def arklibVersion = '0.3.2'

releaseImplementation "space.taran:arklib:$arklibVersion"
debugImplementation "space.taran:arklib-debug:$arklibVersion"
implementation("dev.arkbuilders:components:0.0.3") {
exclude group: "space.taran", module: "arklib"
releaseImplementation "dev.arkbuilders:arklib:$arklibVersion"
debugImplementation "dev.arkbuilders:arklib-debug:$arklibVersion"
implementation("dev.arkbuilders:components:0.0.5") {
exclude group: "dev.arkbuilders", module: "arklib"
}

//// For local development, you can inject local AAR dependency:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.arkbuilders.navigator.data

import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arklib.ArkFiles
import dev.arkbuilders.arklib.arkFolder
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import space.taran.arkfilepicker.folders.FoldersRepo
import space.taran.arklib.ArkFiles
import space.taran.arklib.arkFolder
import dev.arkbuilders.navigator.data.preferences.PreferenceKey
import dev.arkbuilders.navigator.data.preferences.Preferences
import java.nio.file.Path
Expand Down Expand Up @@ -33,8 +33,8 @@ class StorageBackup @Inject constructor(
private val today: String = keepDates[0]

private val foldersToIgnore = listOf(
ArkFiles.PREVIEWS_FOLDER,
ArkFiles.THUMBNAILS_FOLDER
ArkFiles.PREVIEWS_STORAGE_FOLDER,
ArkFiles.THUMBNAILS_STORAGE_FOLDER
)
private val filesToIgnore = listOf<String>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.arkbuilders.navigator.data.stats

import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.Tag
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.joinAll
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.Tag

class AggregatedStatsStorage(val shards: List<StatsStorage>) : StatsStorage {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
package dev.arkbuilders.navigator.data.stats

import dev.arkbuilders.arklib.arkFolder
import dev.arkbuilders.arklib.arkStats
import dev.arkbuilders.arklib.data.index.RootIndex
import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.RootTagsStorage
import dev.arkbuilders.navigator.data.preferences.PreferenceKey
import dev.arkbuilders.navigator.data.preferences.Preferences
import dev.arkbuilders.navigator.data.stats.category.StatsCategoryStorage
import dev.arkbuilders.navigator.data.stats.category.TagLabeledNStorage
import dev.arkbuilders.navigator.data.stats.category.TagLabeledTSStorage
import dev.arkbuilders.navigator.data.stats.category.TagQueriedNStorage
import dev.arkbuilders.navigator.data.stats.category.TagQueriedTSStorage
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.SharedFlow
Expand All @@ -8,18 +20,6 @@ import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.joinAll
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import space.taran.arklib.arkFolder
import space.taran.arklib.arkStats
import space.taran.arklib.domain.index.RootIndex
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.RootTagsStorage
import dev.arkbuilders.navigator.data.preferences.PreferenceKey
import dev.arkbuilders.navigator.data.preferences.Preferences
import dev.arkbuilders.navigator.data.stats.category.StatsCategoryStorage
import dev.arkbuilders.navigator.data.stats.category.TagLabeledNStorage
import dev.arkbuilders.navigator.data.stats.category.TagLabeledTSStorage
import dev.arkbuilders.navigator.data.stats.category.TagQueriedNStorage
import dev.arkbuilders.navigator.data.stats.category.TagQueriedTSStorage
import timber.log.Timber
import kotlin.io.path.createDirectories

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.arkbuilders.navigator.data.stats

import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.Tag
import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.Tag

interface StatsStorage {
suspend fun init()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package dev.arkbuilders.navigator.data.stats

import kotlinx.coroutines.flow.SharedFlow
import space.taran.arklib.domain.index.ResourceIndex
import space.taran.arklib.domain.index.RootIndex
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.RootTagsStorage
import space.taran.arklib.domain.tags.TagsStorageRepo
import dev.arkbuilders.arklib.data.index.ResourceIndex
import dev.arkbuilders.arklib.data.index.RootIndex
import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.RootTagsStorage
import dev.arkbuilders.arklib.user.tags.TagsStorageRepo
import dev.arkbuilders.navigator.data.preferences.Preferences
import kotlinx.coroutines.flow.SharedFlow
import java.nio.file.Path

class StatsStorageRepo(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package dev.arkbuilders.navigator.data.stats.category

import dev.arkbuilders.arklib.arkFolder
import dev.arkbuilders.arklib.arkStats
import dev.arkbuilders.arklib.data.stats.StatsEvent
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import space.taran.arklib.arkFolder
import space.taran.arklib.arkStats
import space.taran.arklib.domain.stats.StatsEvent
import timber.log.Timber
import java.nio.file.Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package dev.arkbuilders.navigator.data.stats.category

import dev.arkbuilders.arklib.data.index.ResourceIndex
import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.Tag
import dev.arkbuilders.arklib.user.tags.TagStorage
import kotlinx.coroutines.CoroutineScope
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import space.taran.arklib.domain.index.ResourceIndex
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.TagStorage
import space.taran.arklib.domain.tags.Tag
import timber.log.Timber
import java.nio.file.Path
import kotlin.io.path.exists
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package dev.arkbuilders.navigator.data.stats.category

import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.Tag
import kotlinx.coroutines.CoroutineScope
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.Tag
import timber.log.Timber
import java.nio.file.Path
import kotlin.io.path.inputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

package dev.arkbuilders.navigator.data.stats.category

import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.Tag
import kotlinx.coroutines.CoroutineScope
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.Tag
import timber.log.Timber
import java.nio.file.Path
import kotlin.io.path.inputStream
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package dev.arkbuilders.navigator.data.stats.category

import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.Tag
import kotlinx.coroutines.CoroutineScope
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.Tag
import timber.log.Timber
import java.nio.file.Path
import kotlin.io.path.inputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dev.arkbuilders.navigator.di
import android.content.Context
import dagger.BindsInstance
import dagger.Component
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.navigator.data.StorageBackup
import dev.arkbuilders.navigator.data.preferences.Preferences
import dev.arkbuilders.navigator.di.modules.AppModule
Expand All @@ -25,7 +26,6 @@ import dev.arkbuilders.navigator.presentation.screen.resources.ResourcesPresente
import dev.arkbuilders.navigator.presentation.screen.resources.adapter.FileItemViewHolder
import dev.arkbuilders.navigator.presentation.screen.resources.adapter.ResourcesGridPresenter
import dev.arkbuilders.navigator.presentation.screen.settings.SettingsFragment
import space.taran.arkfilepicker.folders.FoldersRepo
import javax.inject.Singleton

@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package dev.arkbuilders.navigator.di.modules
import android.util.Log
import dagger.Module
import dagger.Provides
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arklib.data.Message
import dev.arkbuilders.arklib.data.index.ResourceIndexRepo
import dev.arkbuilders.arklib.data.meta.MetadataProcessorRepo
import dev.arkbuilders.arklib.data.preview.PreviewProcessorRepo
import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.score.ScoreStorageRepo
import dev.arkbuilders.arklib.user.tags.TagsStorageRepo
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableSharedFlow
import space.taran.arkfilepicker.folders.FoldersRepo
import space.taran.arklib.domain.Message
import space.taran.arklib.domain.index.ResourceIndexRepo
import space.taran.arklib.domain.meta.MetadataProcessorRepo
import space.taran.arklib.domain.preview.PreviewProcessorRepo
import space.taran.arklib.domain.score.ScoreStorageRepo
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.TagsStorageRepo
import dev.arkbuilders.navigator.data.preferences.Preferences
import dev.arkbuilders.navigator.data.stats.StatsStorageRepo
import dev.arkbuilders.navigator.data.utils.LogTags.MAIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package dev.arkbuilders.navigator.presentation

import android.app.Application
import android.os.StrictMode
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arklib.initArkLib
import dev.arkbuilders.arklib.initRustLogger
import dev.arkbuilders.navigator.BuildConfig
import dev.arkbuilders.navigator.R
import dev.arkbuilders.navigator.di.AppComponent
Expand All @@ -15,9 +18,6 @@ import org.acra.config.httpSender
import org.acra.data.StringFormat
import org.acra.ktx.initAcra
import org.acra.sender.HttpSender
import space.taran.arkfilepicker.folders.FoldersRepo
import space.taran.arklib.initArkLib
import space.taran.arklib.initRustLogger
import timber.log.Timber

class App : Application() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import androidx.core.os.bundleOf
import androidx.core.view.isVisible
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.setFragmentResult
import space.taran.arkfilepicker.folders.FoldersRepo.Companion.DELETE_FOLDER_KEY
import space.taran.arkfilepicker.folders.FoldersRepo.Companion.FORGET_FAVORITE_KEY
import space.taran.arkfilepicker.folders.FoldersRepo.Companion.FORGET_ROOT_KEY
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo.Companion.DELETE_FOLDER_KEY
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo.Companion.FORGET_FAVORITE_KEY
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo.Companion.FORGET_ROOT_KEY
import dev.arkbuilders.navigator.databinding.DialogInfoBinding
import dev.arkbuilders.navigator.presentation.utils.textOrGone

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.InsetDrawable
import android.os.Bundle
import android.view.WindowManager
import dev.arkbuilders.arklib.data.index.Resource
import org.apache.commons.io.FileUtils
import dev.arkbuilders.navigator.R
import dev.arkbuilders.navigator.databinding.DialogResourceInfoBinding
import space.taran.arklib.domain.index.Resource
import space.taran.arklib.domain.meta.Metadata
import dev.arkbuilders.arklib.data.meta.Metadata

import dev.arkbuilders.navigator.presentation.utils.extra.ExtraLoader
import java.nio.file.Path
import kotlin.io.path.absolutePathString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import androidx.fragment.app.FragmentManager
import androidx.fragment.app.setFragmentResult
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import dev.arkbuilders.arkfilepicker.ArkFilePickerConfig
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arkfilepicker.presentation.filepicker.ArkFilePickerFragment
import dev.arkbuilders.navigator.presentation.App
import kotlinx.coroutines.launch
import space.taran.arkfilepicker.ArkFilePickerConfig
import space.taran.arkfilepicker.folders.FoldersRepo
import space.taran.arkfilepicker.presentation.filepicker.ArkFilePickerFragment
import java.nio.file.Path
import javax.inject.Inject
import kotlin.io.path.Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ import androidx.core.widget.doAfterTextChanged
import androidx.fragment.app.setFragmentResult
import androidx.lifecycle.lifecycleScope
import com.google.android.material.chip.Chip
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import moxy.MvpAppCompatDialogFragment
import moxy.ktx.moxyPresenter
import space.taran.arkfilepicker.folders.RootAndFav
import space.taran.arklib.ResourceId
import space.taran.arklib.domain.index.ResourceIndex
import space.taran.arklib.domain.tags.TagStorage
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.index.ResourceIndex
import dev.arkbuilders.arklib.user.tags.Tag
import dev.arkbuilders.arklib.user.tags.TagStorage
import dev.arkbuilders.arklib.user.tags.Tags
import dev.arkbuilders.navigator.R
import dev.arkbuilders.navigator.databinding.DialogEditTagsBinding
import dev.arkbuilders.navigator.data.stats.StatsStorage
import dev.arkbuilders.navigator.databinding.DialogEditTagsBinding
import dev.arkbuilders.navigator.presentation.App
import dev.arkbuilders.navigator.presentation.dialog.tagssort.TagsSortDialogFragment
import space.taran.arklib.domain.tags.Tag
import space.taran.arklib.domain.tags.Tags
import dev.arkbuilders.navigator.presentation.utils.placeCursorToEnd
import dev.arkbuilders.navigator.presentation.utils.showKeyboard
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import moxy.MvpAppCompatDialogFragment
import moxy.ktx.moxyPresenter

class EditTagsDialogFragment(
private val index: ResourceIndex? = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package dev.arkbuilders.navigator.presentation.dialog.edittags

import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.index.ResourceIndex
import dev.arkbuilders.arklib.data.index.ResourceIndexRepo
import dev.arkbuilders.arklib.data.stats.StatsEvent
import dev.arkbuilders.arklib.user.tags.Tag
import dev.arkbuilders.arklib.user.tags.TagStorage
import dev.arkbuilders.arklib.user.tags.TagUtils
import dev.arkbuilders.arklib.user.tags.TagsStorageRepo
import dev.arkbuilders.navigator.data.preferences.PreferenceKey
import dev.arkbuilders.navigator.data.preferences.Preferences
import dev.arkbuilders.navigator.data.stats.StatsStorage
Expand All @@ -14,15 +23,6 @@ import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import moxy.MvpPresenter
import moxy.presenterScope
import space.taran.arkfilepicker.folders.RootAndFav
import space.taran.arklib.ResourceId
import space.taran.arklib.domain.index.ResourceIndex
import space.taran.arklib.domain.index.ResourceIndexRepo
import space.taran.arklib.domain.stats.StatsEvent
import space.taran.arklib.domain.tags.Tag
import space.taran.arklib.domain.tags.TagStorage
import space.taran.arklib.domain.tags.TagUtils
import space.taran.arklib.domain.tags.TagsStorageRepo
import javax.inject.Inject

sealed class EditTagsAction {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.arkbuilders.navigator.presentation.dialog.edittags

import dev.arkbuilders.arklib.user.tags.Tag
import dev.arkbuilders.arklib.user.tags.Tags
import moxy.MvpView
import moxy.viewstate.strategy.AddToEndSingleStrategy
import moxy.viewstate.strategy.SkipStrategy
import moxy.viewstate.strategy.StateStrategyType
import space.taran.arklib.domain.tags.Tag
import space.taran.arklib.domain.tags.Tags

@StateStrategyType(AddToEndSingleStrategy::class)
interface EditTagsDialogView : MvpView {
Expand Down
Loading