diff --git a/app/src/main/java/dev/arkbuilders/navigator/presentation/screen/folders/FoldersViewModel.kt b/app/src/main/java/dev/arkbuilders/navigator/presentation/screen/folders/FoldersViewModel.kt index 27178f0f..479dcb3a 100644 --- a/app/src/main/java/dev/arkbuilders/navigator/presentation/screen/folders/FoldersViewModel.kt +++ b/app/src/main/java/dev/arkbuilders/navigator/presentation/screen/folders/FoldersViewModel.kt @@ -1,6 +1,5 @@ package dev.arkbuilders.navigator.presentation.screen.folders -import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.viewModelScope @@ -23,6 +22,7 @@ import org.orbitmvi.orbit.syntax.simple.intent import org.orbitmvi.orbit.syntax.simple.postSideEffect import org.orbitmvi.orbit.syntax.simple.reduce import org.orbitmvi.orbit.viewmodel.container +import timber.log.Timber import java.nio.file.Path import javax.inject.Inject @@ -125,13 +125,13 @@ class FoldersViewModel @Inject constructor( } if (deleteFromMemory) { - Log.d( + Timber.d( LogTags.FOLDERS_TREE, "forgetting and deleting root folder $root" ) foldersRepo.deleteRoot(root) } else { - Log.d( + Timber.d( LogTags.FOLDERS_TREE, "forgetting root folder $root" ) @@ -158,13 +158,13 @@ class FoldersViewModel @Inject constructor( ) } if (deleteFromMemory) { - Log.d( + Timber.d( LogTags.FOLDERS_TREE, "forgetting and deleting favorite $favorite" ) foldersRepo.deleteFavorite(root, favorite) } else { - Log.d( + Timber.d( LogTags.FOLDERS_TREE, "forgetting favorite $favorite" ) @@ -205,7 +205,7 @@ class FoldersViewModel @Inject constructor( ) } - Log.d(LogTags.FOLDERS_SCREEN, "root $root added in RootsPresenter") + Timber.d(LogTags.FOLDERS_SCREEN, "root $root added in RootsPresenter") val path = withContext(defaultDispatcher) { root.toRealPath() } @@ -245,7 +245,7 @@ class FoldersViewModel @Inject constructor( ProgressWithText(true, "Adding favorite folder") ) } - Log.d( + Timber.d( LogTags.FOLDERS_SCREEN, "favorite $favorite added in RootsPresenter" ) diff --git a/app/src/main/java/dev/arkbuilders/navigator/presentation/screen/gallery/GalleryFragment.kt b/app/src/main/java/dev/arkbuilders/navigator/presentation/screen/gallery/GalleryFragment.kt index d01b4e44..edd6917a 100644 --- a/app/src/main/java/dev/arkbuilders/navigator/presentation/screen/gallery/GalleryFragment.kt +++ b/app/src/main/java/dev/arkbuilders/navigator/presentation/screen/gallery/GalleryFragment.kt @@ -5,7 +5,6 @@ import android.content.ActivityNotFoundException import android.content.Intent import android.net.Uri import android.os.Bundle -import android.util.Log import android.util.TypedValue import android.view.View import android.widget.Toast @@ -74,7 +73,7 @@ class GalleryFragment : ) .toMutableList(), ).apply { - Log.d(GALLERY_SCREEN, "creating GalleryPresenter") + Timber.d(GALLERY_SCREEN, "creating GalleryPresenter") App.instance.appComponent.inject(this) } } @@ -85,7 +84,7 @@ class GalleryFragment : } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - Log.d(GALLERY_SCREEN, "view created in GalleryFragment") + Timber.d(GALLERY_SCREEN, "view created in GalleryFragment") super.onViewCreated(view, savedInstanceState) App.instance.appComponent.inject(this) } @@ -96,7 +95,7 @@ class GalleryFragment : } override fun init() { - Log.d(GALLERY_SCREEN, "currentItem = ${binding.viewPager.currentItem}") + Timber.d(GALLERY_SCREEN, "currentItem = ${binding.viewPager.currentItem}") animatePagerAppearance() initResultListener() @@ -306,7 +305,7 @@ class GalleryFragment : override fun displayPreviewTags(resource: ResourceId, tags: Tags) { lifecycleScope.launch { - Log.d( + Timber.d( GALLERY_SCREEN, "displaying tags of resource $resource for preview" ) @@ -329,7 +328,7 @@ class GalleryFragment : override fun showEditTagsDialog( resource: ResourceId ) { - Log.d( + Timber.d( GALLERY_SCREEN, "showing [edit-tags] dialog for resource $resource" ) @@ -501,9 +500,10 @@ class GalleryFragment : actionType: String, detachProcess: Boolean ) { - Log.i(GALLERY_SCREEN, "Opening resource in an external application") - Log.i(GALLERY_SCREEN, "path: $resourcePath") - Log.i(GALLERY_SCREEN, "action: $actionType") + Timber.i(GALLERY_SCREEN, "Opening resource in an external application " + + "path: $resourcePath" + + "action: $actionType" + ) val intent = getExternalAppIntent(resourcePath, actionType, detachProcess) val title = when (actionType) { @@ -544,8 +544,10 @@ class GalleryFragment : addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) } } - Log.d(GALLERY_SCREEN, "URI: ${intent.data}") - Log.d(GALLERY_SCREEN, "MIME: ${intent.type}") + Timber.d( + GALLERY_SCREEN, "URI: ${intent.data}" + + "MIME: ${intent.type}" + ) return intent } @@ -570,7 +572,7 @@ class GalleryFragment : setOnClickListener { val position = binding.viewPager.currentItem - Log.d( + Timber.d( GALLERY_SCREEN, "[edit_tags] clicked at position $position" )