Skip to content

Commit

Permalink
Remove duplicated business logic between Navigator and filepicker mod…
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech committed Mar 24, 2024
1 parent fc2ffe2 commit 1b7f58c
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 45 deletions.
20 changes: 16 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ dependencies {
//For local developments of arklib-android:
releaseImplementation "dev.arkbuilders:arklib:$ark_lib_version"
debugImplementation "dev.arkbuilders:arklib-debug:$ark_lib_version"
implementation("dev.arkbuilders:components:$ark_components_version") {
exclude group: "dev.arkbuilders", module: "arklib"
}
// implementation("dev.arkbuilders:components:$ark_components_version") {
// exclude group: "dev.arkbuilders", module: "arklib"
// }

//// For local development, you can inject local AAR dependency:
// implementation files('/tmp/arklib-android/lib/build/outputs/aar/lib-debug.aar')
Expand Down Expand Up @@ -147,7 +147,19 @@ dependencies {
implementation "com.davemorrissey.labs:subsampling-scale-image-view-androidx:$scale_image_view_androidx_version"
implementation "com.github.MikeOrtiz:TouchImageView:$touch_image_view_version"

implementation "dev.arkbuilders:arkfilepicker:$dev_ark_picker_file_version"
// implementation "dev.arkbuilders:arkfilepicker:$dev_ark_picker_file_version"
implementation ("dev.arkbuilders.components:filepicker:0.1.1-SNAPSHOT-04") {
exclude group: "dev.arkbuilders", module: "arklib"
}
implementation ("dev.arkbuilders.components:tagselector:0.0.9-SNAPSHOT-02") {
exclude group: "dev.arkbuilders", module: "arklib"
}
implementation ("dev.arkbuilders.components:folderstree:0.0.9-SNAPSHOT-02") {
exclude group: "dev.arkbuilders", module: "arklib"
}
implementation ("dev.arkbuilders.components:scorewidget:0.0.9-SNAPSHOT-02") {
exclude group: "dev.arkbuilders", module: "arklib"
}

implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_json_version"

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

import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ 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 dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import dev.arkbuilders.navigator.analytics.AnalyticsModule
import dev.arkbuilders.navigator.di.modules.DispatcherModule
import javax.inject.Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import dagger.Provides
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableSharedFlow
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import dev.arkbuilders.arklib.data.index.ResourceIndexRepo
import dev.arkbuilders.arklib.data.meta.MetadataProcessorRepo
import dev.arkbuilders.arklib.data.preview.PreviewProcessorRepo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package dev.arkbuilders.navigator.presentation

import android.app.Application
import android.os.StrictMode
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import dev.arkbuilders.arklib.initArkLib
import dev.arkbuilders.arklib.initRustLogger
import dev.arkbuilders.navigator.BuildConfig
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 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.arklib.data.folders.FoldersRepo.Companion.DELETE_FOLDER_KEY
import dev.arkbuilders.arklib.data.folders.FoldersRepo.Companion.FORGET_FAVORITE_KEY
import dev.arkbuilders.arklib.data.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 @@ -8,9 +8,9 @@ import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import dev.arkbuilders.navigator.presentation.App
import kotlinx.coroutines.launch
import dev.arkbuilders.arkfilepicker.ArkFilePickerConfig
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arkfilepicker.presentation.filepicker.ArkFilePickerFragment
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import dev.arkbuilders.components.filepicker.ArkFilePickerConfig
import dev.arkbuilders.components.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 @@ -19,8 +19,8 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import moxy.MvpAppCompatDialogFragment
import moxy.ktx.moxyPresenter
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.arklib.data.index.ResourceIndex
import dev.arkbuilders.arklib.user.tags.TagStorage
import dev.arkbuilders.navigator.R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import moxy.MvpPresenter
import moxy.presenterScope
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.index.ResourceIndex
import dev.arkbuilders.arklib.data.index.ResourceIndexRepo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.arkbuilders.navigator.presentation.navigation

import ru.terrakok.cicerone.android.support.SupportAppScreen
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.navigator.presentation.screen.folders.FoldersFragment
import dev.arkbuilders.navigator.presentation.screen.gallery.GalleryFragment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.OnScrollListener
import by.kirich1409.viewbindingdelegate.viewBinding
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo.Companion.DELETE_FOLDER_KEY
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo.Companion.FAVORITE_KEY
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo.Companion.FORGET_FAVORITE_KEY
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo.Companion.FORGET_ROOT_KEY
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo.Companion.ROOT_KEY
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arkfilepicker.presentation.folderstree.DeviceNode
import dev.arkbuilders.arkfilepicker.presentation.folderstree.FavoriteNode
import dev.arkbuilders.arkfilepicker.presentation.folderstree.FolderNode
import dev.arkbuilders.arkfilepicker.presentation.folderstree.FolderTreeView
import dev.arkbuilders.arkfilepicker.presentation.folderstree.RootNode
import dev.arkbuilders.arklib.data.folders.FoldersRepo.Companion.DELETE_FOLDER_KEY
import dev.arkbuilders.arklib.data.folders.FoldersRepo.Companion.FAVORITE_KEY
import dev.arkbuilders.arklib.data.folders.FoldersRepo.Companion.FORGET_FAVORITE_KEY
import dev.arkbuilders.arklib.data.folders.FoldersRepo.Companion.FORGET_ROOT_KEY
import dev.arkbuilders.arklib.data.folders.FoldersRepo.Companion.ROOT_KEY
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.components.folderstree.DeviceNode
import dev.arkbuilders.components.folderstree.FavoriteNode
import dev.arkbuilders.components.folderstree.FolderNode
import dev.arkbuilders.components.folderstree.FolderTreeView
import dev.arkbuilders.components.folderstree.RootNode
import dev.arkbuilders.navigator.R
import dev.arkbuilders.navigator.analytics.folders.FoldersAnalytics
import dev.arkbuilders.navigator.data.utils.LogTags.FOLDERS_SCREEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.lifecycle.viewModelScope
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import dev.arkbuilders.arklib.data.index.ResourceIndexRepo
import dev.arkbuilders.navigator.analytics.folders.FoldersAnalytics
import dev.arkbuilders.navigator.data.PermissionsHelper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import dev.arkbuilders.navigator.presentation.view.StackedToasts
import kotlinx.coroutines.launch
import moxy.MvpAppCompatFragment
import moxy.ktx.moxyPresenter
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.index.Resource
import dev.arkbuilders.arklib.data.meta.Metadata
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.arkbuilders.navigator.presentation.screen.gallery

import androidx.recyclerview.widget.DiffUtil
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.Message
import dev.arkbuilders.arklib.data.index.Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import dev.arkbuilders.navigator.presentation.navigation.Screens
import dev.arkbuilders.navigator.presentation.utils.toast
import kotlinx.coroutines.launch
import ru.terrakok.cicerone.NavigatorHolder
import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import dev.arkbuilders.arklib.data.folders.RootAndFav
import timber.log.Timber
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import androidx.fragment.app.setFragmentResultListener
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager
import by.kirich1409.viewbindingdelegate.viewBinding
import dev.arkbuilders.components.databinding.TagSelectorDragHandlerBinding
import dev.arkbuilders.components.databinding.TagSelectorTagsLayoutBinding
import dev.arkbuilders.components.tagselector.QueryMode
import dev.arkbuilders.components.tagselector.TagSelector
import dev.arkbuilders.navigator.BuildConfig
Expand All @@ -40,10 +38,12 @@ import kotlinx.coroutines.launch
import moxy.MvpAppCompatFragment
import moxy.ktx.moxyPresenter
import moxy.presenterScope
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arkfilepicker.presentation.onArkPathPicked
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.user.tags.Tag
import dev.arkbuilders.components.filepicker.onArkPathPicked
import dev.arkbuilders.components.tagselector.databinding.TagSelectorDragHandlerBinding
import dev.arkbuilders.components.tagselector.databinding.TagSelectorTagsLayoutBinding
import timber.log.Timber
import java.nio.file.Path
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package dev.arkbuilders.navigator.presentation.screen.resources

import android.view.View
import androidx.core.view.isVisible
import dev.arkbuilders.arkfilepicker.ArkFilePickerConfig
import dev.arkbuilders.arkfilepicker.presentation.filepicker.ArkFilePickerFragment
import dev.arkbuilders.arkfilepicker.presentation.filepicker.ArkFilePickerMode
import dev.arkbuilders.components.filepicker.ArkFilePickerConfig
import dev.arkbuilders.components.filepicker.ArkFilePickerFragment
import dev.arkbuilders.components.filepicker.ArkFilePickerMode
import dev.arkbuilders.navigator.R
import dev.arkbuilders.navigator.databinding.PopupSelectedResourcesActionsBinding
import dev.arkbuilders.navigator.presentation.dialog.ConfirmationDialogFragment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.arkbuilders.navigator.presentation.screen.resources

import dev.arkbuilders.arkfilepicker.folders.FoldersRepo
import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.data.folders.FoldersRepo
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.Message
import dev.arkbuilders.arklib.data.index.ResourceIndex
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.arkbuilders.navigator.presentation.screen.resources.adapter

import dev.arkbuilders.arkfilepicker.folders.RootAndFav
import dev.arkbuilders.arklib.data.folders.RootAndFav
import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.index.Resource
import dev.arkbuilders.arklib.data.index.ResourceIndex
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
buildscript {
ext {
//region ARK lib
ark_lib_version = "0.3.4"
ark_lib_version = "0.3.5"
ark_components_version = "0.0.11"
dev_ark_picker_file_version = "0.1.2"
//endregion ARK lib
Expand Down Expand Up @@ -51,6 +51,7 @@ buildscript {

maven { url "https://plugins.gradle.org/m2/" }
gradlePluginPortal()
mavenLocal()
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.4.1.3373"
Expand All @@ -73,7 +74,7 @@ allprojects {
repositories {
google()
//// Uncomment this repo for easier library development:
//mavenLocal()
mavenLocal()

//// This is how you can push the library into local repo:
//// ./gradlew --info lib:publishToMavenLocal
Expand Down

0 comments on commit 1b7f58c

Please sign in to comment.