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

Move to Core some classes used by kMail #839

Merged
merged 4 commits into from
Jul 19, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import okhttp3.OkHttpClient
object ApiRepository : ApiRepositoryCore() {

var PER_PAGE = 200

private const val ACTIONS = "&actions[]=file_create" +
"&actions[]=file_rename" +
"&actions[]=file_move" +
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/infomaniak/drive/ui/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import com.infomaniak.drive.utils.SyncUtils.isSyncScheduled
import com.infomaniak.drive.utils.SyncUtils.syncImmediately
import com.infomaniak.lib.core.models.ApiResponse
import com.infomaniak.lib.core.networking.HttpClient
import com.infomaniak.lib.core.utils.SingleLiveEvent
import io.realm.Realm
import io.sentry.Sentry
import kotlinx.coroutines.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ class SearchFilterDateBottomSheetDialog : BottomSheetDialogFragment() {
}

private fun intervalAsText(start: Date, end: Date): String {
val longDate = "d MMM yyyy"
val longDate = FORMAT_DATE_CLEAR_MONTH_DAY_ONE_CHAR
val separator = " - "
val startFormat = when {
start.year() != end.year() -> start.format(longDate) + separator
start.month() != end.month() -> start.format("d MMM") + separator
start.month() != end.month() -> start.format(FORMAT_DATE_SHORT_DAY_ONE_CHAR) + separator
start.day() != end.day() -> start.format("d") + separator
else -> ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import com.infomaniak.drive.ui.fileList.FileListFragment.FolderFilesResult
import com.infomaniak.drive.utils.AccountUtils
import com.infomaniak.drive.utils.FileId
import com.infomaniak.drive.utils.Position
import com.infomaniak.drive.utils.SingleLiveEvent
import com.infomaniak.lib.core.utils.SingleLiveEvent
import kotlinx.coroutines.*
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.infomaniak.drive.data.models.ExtensionType
import com.infomaniak.drive.data.models.SearchCategoriesOwnershipFilter
import com.infomaniak.drive.data.models.SearchDateFilter
import com.infomaniak.drive.data.models.drive.Category
import com.infomaniak.drive.utils.SingleLiveEvent
import com.infomaniak.lib.core.utils.SingleLiveEvent

class SearchFiltersViewModel : ViewModel() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.infomaniak.drive.R
import com.infomaniak.drive.data.cache.DriveInfosController
import com.infomaniak.drive.data.models.UploadFile
import com.infomaniak.drive.utils.*
import com.infomaniak.lib.core.utils.FormatterFileSize
import com.infomaniak.lib.core.utils.UtilsUi.openUrl
import com.infomaniak.lib.core.utils.loadAvatar
import com.infomaniak.lib.core.utils.safeNavigate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import androidx.lifecycle.liveData
import com.infomaniak.drive.data.api.ApiRepository
import com.infomaniak.drive.data.models.File
import com.infomaniak.drive.ui.fileList.FileListFragment
import com.infomaniak.drive.utils.SingleLiveEvent
import com.infomaniak.lib.core.utils.SingleLiveEvent
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job

Expand Down Expand Up @@ -110,5 +110,4 @@ class TrashViewModel : ViewModel() {
fun cancelTrashFileJob() {
getDeletedFilesJob.cancel()
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import com.infomaniak.drive.data.models.MediaFolder
import com.infomaniak.drive.utils.DrivePermissions
import com.infomaniak.drive.utils.IsComplete
import com.infomaniak.drive.utils.MediaFoldersProvider
import com.infomaniak.drive.views.DividerItemDecorator
import com.infomaniak.drive.views.FullScreenBottomSheetDialog
import com.infomaniak.lib.core.views.DividerItemDecorator
import io.realm.Realm
import kotlinx.android.synthetic.main.fragment_bottom_sheet_select_media_folders.*
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -175,4 +175,4 @@ class SelectMediaFoldersDialog : FullScreenBottomSheetDialog() {
elementsToRemove.postValue(deletedMediaFolderList)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import com.infomaniak.drive.ui.fileList.FileListFragment.Companion.MAX_DISPLAYED
import com.infomaniak.drive.ui.fileList.FileViewHolder
import com.infomaniak.drive.utils.Utils.ROOT_ID
import com.infomaniak.drive.views.CategoryIconView
import com.infomaniak.lib.core.utils.FormatterFileSize
import com.infomaniak.lib.core.utils.format
import io.sentry.Sentry
import kotlinx.android.synthetic.main.cardview_file_grid.view.filePreview2
Expand Down
121 changes: 0 additions & 121 deletions app/src/main/java/com/infomaniak/drive/utils/FormatterFileSize.kt

This file was deleted.

72 changes: 0 additions & 72 deletions app/src/main/java/com/infomaniak/drive/utils/SingleLiveEvent.kt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import com.infomaniak.drive.R
import com.infomaniak.drive.data.api.ApiRoutes
import com.infomaniak.drive.data.models.drive.Drive
import com.infomaniak.drive.utils.AccountUtils
import com.infomaniak.drive.utils.FormatterFileSize
import com.infomaniak.lib.core.utils.FormatterFileSize
import com.infomaniak.lib.core.utils.UtilsUi.openUrl
import kotlinx.android.synthetic.main.view_not_enough_storage.view.*

Expand Down Expand Up @@ -79,4 +79,4 @@ class NotEnoughStorageView @JvmOverloads constructor(
}
}
}
}
}