mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Rename BinaryStreamManager to BinaryDatabaseManager
This commit is contained in:
@@ -41,7 +41,7 @@ import com.kunzisoft.keepass.database.element.Database
|
|||||||
import com.kunzisoft.keepass.database.element.icon.IconImage
|
import com.kunzisoft.keepass.database.element.icon.IconImage
|
||||||
import com.kunzisoft.keepass.database.element.icon.IconImageCustom
|
import com.kunzisoft.keepass.database.element.icon.IconImageCustom
|
||||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||||
import com.kunzisoft.keepass.tasks.BinaryStreamManager
|
import com.kunzisoft.keepass.tasks.BinaryDatabaseManager
|
||||||
import com.kunzisoft.keepass.utils.UriUtil
|
import com.kunzisoft.keepass.utils.UriUtil
|
||||||
import com.kunzisoft.keepass.view.asError
|
import com.kunzisoft.keepass.view.asError
|
||||||
import com.kunzisoft.keepass.view.updateLockPaddingLeft
|
import com.kunzisoft.keepass.view.updateLockPaddingLeft
|
||||||
@@ -231,7 +231,7 @@ class IconPickerActivity : LockingActivity() {
|
|||||||
} else {
|
} else {
|
||||||
mDatabase?.buildNewCustomIcon(UriUtil.getBinaryDir(this@IconPickerActivity))?.let { customIcon ->
|
mDatabase?.buildNewCustomIcon(UriUtil.getBinaryDir(this@IconPickerActivity))?.let { customIcon ->
|
||||||
iconCustomState.iconCustom = customIcon
|
iconCustomState.iconCustom = customIcon
|
||||||
BinaryStreamManager.resizeBitmapAndStoreDataInBinaryFile(contentResolver,
|
BinaryDatabaseManager.resizeBitmapAndStoreDataInBinaryFile(contentResolver,
|
||||||
iconToUploadUri, customIcon.binaryFile)
|
iconToUploadUri, customIcon.binaryFile)
|
||||||
when {
|
when {
|
||||||
customIcon.binaryFile?.length ?: 0 <= 0 -> {}
|
customIcon.binaryFile?.length ?: 0 <= 0 -> {}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import com.kunzisoft.keepass.R
|
|||||||
import com.kunzisoft.keepass.activities.lock.LockingActivity
|
import com.kunzisoft.keepass.activities.lock.LockingActivity
|
||||||
import com.kunzisoft.keepass.database.element.Attachment
|
import com.kunzisoft.keepass.database.element.Attachment
|
||||||
import com.kunzisoft.keepass.database.element.Database
|
import com.kunzisoft.keepass.database.element.Database
|
||||||
import com.kunzisoft.keepass.tasks.BinaryStreamManager
|
import com.kunzisoft.keepass.tasks.BinaryDatabaseManager
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
class ImageViewerActivity : LockingActivity() {
|
class ImageViewerActivity : LockingActivity() {
|
||||||
@@ -66,7 +66,7 @@ class ImageViewerActivity : LockingActivity() {
|
|||||||
supportActionBar?.title = attachment.name
|
supportActionBar?.title = attachment.name
|
||||||
supportActionBar?.subtitle = Formatter.formatFileSize(this, attachment.binaryFile.length)
|
supportActionBar?.subtitle = Formatter.formatFileSize(this, attachment.binaryFile.length)
|
||||||
|
|
||||||
BinaryStreamManager.loadBitmap(
|
BinaryDatabaseManager.loadBitmap(
|
||||||
attachment.binaryFile,
|
attachment.binaryFile,
|
||||||
Database.getInstance().loadedCipherKey,
|
Database.getInstance().loadedCipherKey,
|
||||||
mImagePreviewMaxWidth
|
mImagePreviewMaxWidth
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import com.kunzisoft.keepass.database.element.database.CompressionAlgorithm
|
|||||||
import com.kunzisoft.keepass.model.AttachmentState
|
import com.kunzisoft.keepass.model.AttachmentState
|
||||||
import com.kunzisoft.keepass.model.EntryAttachmentState
|
import com.kunzisoft.keepass.model.EntryAttachmentState
|
||||||
import com.kunzisoft.keepass.model.StreamDirection
|
import com.kunzisoft.keepass.model.StreamDirection
|
||||||
import com.kunzisoft.keepass.tasks.BinaryStreamManager
|
import com.kunzisoft.keepass.tasks.BinaryDatabaseManager
|
||||||
import com.kunzisoft.keepass.view.expand
|
import com.kunzisoft.keepass.view.expand
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ class EntryAttachmentsItemsAdapter(context: Context)
|
|||||||
if (entryAttachmentState.previewState == AttachmentState.NULL) {
|
if (entryAttachmentState.previewState == AttachmentState.NULL) {
|
||||||
entryAttachmentState.previewState = AttachmentState.IN_PROGRESS
|
entryAttachmentState.previewState = AttachmentState.IN_PROGRESS
|
||||||
// Load the bitmap image
|
// Load the bitmap image
|
||||||
BinaryStreamManager.loadBitmap(
|
BinaryDatabaseManager.loadBitmap(
|
||||||
entryAttachmentState.attachment.binaryFile,
|
entryAttachmentState.attachment.binaryFile,
|
||||||
binaryCipherKey,
|
binaryCipherKey,
|
||||||
mImagePreviewMaxWidth
|
mImagePreviewMaxWidth
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import com.kunzisoft.keepass.database.element.Attachment
|
|||||||
import com.kunzisoft.keepass.model.AttachmentState
|
import com.kunzisoft.keepass.model.AttachmentState
|
||||||
import com.kunzisoft.keepass.model.EntryAttachmentState
|
import com.kunzisoft.keepass.model.EntryAttachmentState
|
||||||
import com.kunzisoft.keepass.model.StreamDirection
|
import com.kunzisoft.keepass.model.StreamDirection
|
||||||
import com.kunzisoft.keepass.tasks.BinaryStreamManager
|
import com.kunzisoft.keepass.tasks.BinaryDatabaseManager
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.CopyOnWriteArrayList
|
import java.util.concurrent.CopyOnWriteArrayList
|
||||||
@@ -344,7 +344,7 @@ class AttachmentFileNotificationService: LockNotificationService() {
|
|||||||
|
|
||||||
when (streamDirection) {
|
when (streamDirection) {
|
||||||
StreamDirection.UPLOAD -> {
|
StreamDirection.UPLOAD -> {
|
||||||
BinaryStreamManager.uploadToDatabase(
|
BinaryDatabaseManager.uploadToDatabase(
|
||||||
attachmentNotification.uri,
|
attachmentNotification.uri,
|
||||||
attachment.binaryFile,
|
attachment.binaryFile,
|
||||||
contentResolver,
|
contentResolver,
|
||||||
@@ -357,7 +357,7 @@ class AttachmentFileNotificationService: LockNotificationService() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
StreamDirection.DOWNLOAD -> {
|
StreamDirection.DOWNLOAD -> {
|
||||||
BinaryStreamManager.downloadFromDatabase(
|
BinaryDatabaseManager.downloadFromDatabase(
|
||||||
attachmentNotification.uri,
|
attachmentNotification.uri,
|
||||||
attachment.binaryFile,
|
attachment.binaryFile,
|
||||||
contentResolver,
|
contentResolver,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import kotlin.math.ln
|
|||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
import kotlin.math.pow
|
import kotlin.math.pow
|
||||||
|
|
||||||
object BinaryStreamManager {
|
object BinaryDatabaseManager {
|
||||||
|
|
||||||
fun downloadFromDatabase(attachmentToUploadUri: Uri,
|
fun downloadFromDatabase(attachmentToUploadUri: Uri,
|
||||||
binaryFile: BinaryFile,
|
binaryFile: BinaryFile,
|
||||||
@@ -186,5 +186,5 @@ object BinaryStreamManager {
|
|||||||
|
|
||||||
private const val DEFAULT_ICON_WIDTH = 64
|
private const val DEFAULT_ICON_WIDTH = 64
|
||||||
|
|
||||||
private val TAG = BinaryStreamManager::class.java.name
|
private val TAG = BinaryDatabaseManager::class.java.name
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user