mirror of
https://github.com/nextcloud/android.git
synced 2024-12-21 16:24:32 +03:00
Merge remote-tracking branch 'origin/master' into dev
This commit is contained in:
commit
4ff8624534
92 changed files with 1261 additions and 1291 deletions
|
@ -42,7 +42,10 @@ trim_trailing_whitespace=false
|
|||
indent_size=2
|
||||
|
||||
[*.{kt,kts}]
|
||||
ktlint_code_style = android_studio
|
||||
# IDE does not follow this Ktlint rule strictly, but the default ordering is pretty good anyway, so let's ditch it
|
||||
ktlint_standard_import-ordering = disabled
|
||||
ktlint_standard_no-consecutive-comments = disabled
|
||||
ktlint_function_naming_ignore_when_annotated_with = Composable
|
||||
ij_kotlin_allow_trailing_comma = false
|
||||
ij_kotlin_allow_trailing_comma_on_call_site = false
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
## 3.29.1 (June 27, 2024)
|
||||
|
||||
- Bugfixes
|
||||
|
||||
Minimum: NC 16 Server, Android 7.0 Nougat
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/android/milestone/93
|
||||
|
||||
<!--
|
||||
~ SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
~ SPDX-FileCopyrightText: 2016-2024 Tobias Kaminsky <tobias@kaminsky.me>
|
||||
|
|
30
Gemfile.lock
30
Gemfile.lock
|
@ -5,22 +5,22 @@ GEM
|
|||
base64
|
||||
nkf
|
||||
rexml
|
||||
addressable (2.8.6)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
addressable (2.8.7)
|
||||
public_suffix (>= 2.0.2, < 7.0)
|
||||
artifactory (3.0.17)
|
||||
atomos (0.1.3)
|
||||
aws-eventstream (1.3.0)
|
||||
aws-partitions (1.937.0)
|
||||
aws-sdk-core (3.196.1)
|
||||
aws-partitions (1.948.0)
|
||||
aws-sdk-core (3.199.0)
|
||||
aws-eventstream (~> 1, >= 1.3.0)
|
||||
aws-partitions (~> 1, >= 1.651.0)
|
||||
aws-sigv4 (~> 1.8)
|
||||
jmespath (~> 1, >= 1.6.1)
|
||||
aws-sdk-kms (1.82.0)
|
||||
aws-sdk-core (~> 3, >= 3.193.0)
|
||||
aws-sdk-kms (1.87.0)
|
||||
aws-sdk-core (~> 3, >= 3.199.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-s3 (1.151.0)
|
||||
aws-sdk-core (~> 3, >= 3.194.0)
|
||||
aws-sdk-s3 (1.154.0)
|
||||
aws-sdk-core (~> 3, >= 3.199.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.8)
|
||||
aws-sigv4 (1.8.0)
|
||||
|
@ -69,7 +69,7 @@ GEM
|
|||
faraday_middleware (1.2.0)
|
||||
faraday (~> 1.0)
|
||||
fastimage (2.3.1)
|
||||
fastlane (2.220.0)
|
||||
fastlane (2.221.1)
|
||||
CFPropertyList (>= 2.3, < 4.0.0)
|
||||
addressable (>= 2.8, < 3.0.0)
|
||||
artifactory (~> 3.0)
|
||||
|
@ -150,14 +150,14 @@ GEM
|
|||
os (>= 0.9, < 2.0)
|
||||
signet (>= 0.16, < 2.a)
|
||||
highline (2.0.3)
|
||||
http-cookie (1.0.5)
|
||||
http-cookie (1.0.6)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.8.3)
|
||||
jmespath (1.6.2)
|
||||
json (2.7.2)
|
||||
jwt (2.8.1)
|
||||
jwt (2.8.2)
|
||||
base64
|
||||
mini_magick (4.12.0)
|
||||
mini_magick (4.13.1)
|
||||
mini_mime (1.1.5)
|
||||
multi_json (1.15.0)
|
||||
multipart-post (2.4.1)
|
||||
|
@ -167,15 +167,15 @@ GEM
|
|||
optparse (0.5.0)
|
||||
os (1.1.4)
|
||||
plist (3.7.1)
|
||||
public_suffix (5.0.5)
|
||||
public_suffix (5.1.1)
|
||||
rake (13.2.1)
|
||||
representable (3.2.0)
|
||||
declarative (< 0.1.0)
|
||||
trailblazer-option (>= 0.1.1, < 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.1.2)
|
||||
rexml (3.2.8)
|
||||
strscan (>= 3.0.9)
|
||||
rexml (3.2.9)
|
||||
strscan
|
||||
rouge (2.0.7)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
|
|
|
@ -29,7 +29,7 @@ buildscript {
|
|||
|
||||
plugins {
|
||||
id "org.jetbrains.kotlin.plugin.compose" version "2.0.0"
|
||||
id "com.diffplug.spotless" version "6.20.0"
|
||||
id "com.diffplug.spotless" version "6.25.0"
|
||||
id "org.jetbrains.kotlin.kapt" version "2.0.0"
|
||||
id 'com.google.devtools.ksp' version '2.0.0-1.0.22' apply false
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ dependencies {
|
|||
implementation "androidx.lifecycle:lifecycle-service:2.8.2"
|
||||
implementation "androidx.work:work-runtime:$workRuntime"
|
||||
implementation "androidx.work:work-runtime-ktx:$workRuntime"
|
||||
implementation "androidx.fragment:fragment-ktx:1.8.0"
|
||||
implementation "androidx.fragment:fragment-ktx:1.8.1"
|
||||
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
|
||||
compileOnly 'com.google.code.findbugs:annotations:3.0.1u2'
|
||||
implementation 'commons-io:commons-io:2.16.1'
|
||||
|
@ -363,7 +363,7 @@ dependencies {
|
|||
}
|
||||
|
||||
if (perfAnalysis) {
|
||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.13'
|
||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
|
||||
}
|
||||
|
||||
// dependencies for local unit tests
|
||||
|
@ -411,7 +411,8 @@ dependencies {
|
|||
implementation "com.github.stateless4j:stateless4j:2.6.0"
|
||||
|
||||
// upon each update first test: new registration, receive push
|
||||
gplayImplementation "com.google.firebase:firebase-messaging:23.4.1"
|
||||
gplayImplementation "com.google.firebase:firebase-messaging:24.0.0"
|
||||
gplayImplementation 'com.google.android.gms:play-services-base:18.5.0'
|
||||
gplayImplementation 'com.google.android.play:review-ktx:2.0.1'
|
||||
|
||||
implementation 'com.github.nextcloud.android-common:ui:0.17.0'
|
||||
|
|
|
@ -177,31 +177,30 @@ object DocumentsProviderUtils {
|
|||
*/
|
||||
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||
@VisibleForTesting
|
||||
internal suspend fun getLoadedCursor(timeout: Long = 15_000, query: () -> Cursor?) =
|
||||
withTimeout(timeout) {
|
||||
suspendCancellableCoroutine<Cursor> { cont ->
|
||||
val cursor = query() ?: throw IOException("Initial query returned no results")
|
||||
cont.invokeOnCancellation { cursor.close() }
|
||||
val loading = cursor.extras.getBoolean(EXTRA_LOADING, false)
|
||||
if (loading) {
|
||||
Log_OC.e("TEST", "Cursor was loading, wait for update...")
|
||||
cursor.registerContentObserver(
|
||||
object : ContentObserver(null) {
|
||||
override fun onChange(selfChange: Boolean, uri: Uri?) {
|
||||
cursor.close()
|
||||
val newCursor = query()
|
||||
if (newCursor == null) {
|
||||
cont.cancel(IOException("Re-query returned no results"))
|
||||
} else {
|
||||
cont.resume(newCursor)
|
||||
}
|
||||
internal suspend fun getLoadedCursor(timeout: Long = 15_000, query: () -> Cursor?) = withTimeout(timeout) {
|
||||
suspendCancellableCoroutine<Cursor> { cont ->
|
||||
val cursor = query() ?: throw IOException("Initial query returned no results")
|
||||
cont.invokeOnCancellation { cursor.close() }
|
||||
val loading = cursor.extras.getBoolean(EXTRA_LOADING, false)
|
||||
if (loading) {
|
||||
Log_OC.e("TEST", "Cursor was loading, wait for update...")
|
||||
cursor.registerContentObserver(
|
||||
object : ContentObserver(null) {
|
||||
override fun onChange(selfChange: Boolean, uri: Uri?) {
|
||||
cursor.close()
|
||||
val newCursor = query()
|
||||
if (newCursor == null) {
|
||||
cont.cancel(IOException("Re-query returned no results"))
|
||||
} else {
|
||||
cont.resume(newCursor)
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
// not loading, return cursor right away
|
||||
cont.resume(cursor)
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
// not loading, return cursor right away
|
||||
cont.resume(cursor)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ import com.owncloud.android.R
|
|||
import com.owncloud.android.ui.TextDrawable
|
||||
|
||||
internal class AvatarTestFragment : Fragment() {
|
||||
lateinit var list1: LinearLayout
|
||||
lateinit var list2: LinearLayout
|
||||
private lateinit var list1: LinearLayout
|
||||
private lateinit var list2: LinearLayout
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
val view: View = inflater.inflate(R.layout.avatar_fragment, null)
|
||||
|
@ -34,7 +34,7 @@ internal class AvatarTestFragment : Fragment() {
|
|||
}
|
||||
|
||||
fun addAvatar(name: String, avatarRadius: Float, width: Int, targetContext: Context) {
|
||||
val margin = padding
|
||||
val margin = PADDING
|
||||
val imageView = ImageView(targetContext)
|
||||
imageView.setImageDrawable(TextDrawable.createNamedAvatar(name, avatarRadius))
|
||||
|
||||
|
@ -47,7 +47,7 @@ internal class AvatarTestFragment : Fragment() {
|
|||
}
|
||||
|
||||
fun addBitmap(bitmap: Bitmap, width: Int, list: Int, targetContext: Context) {
|
||||
val margin = padding
|
||||
val margin = PADDING
|
||||
val imageView = ImageView(targetContext)
|
||||
imageView.setImageBitmap(bitmap)
|
||||
|
||||
|
@ -64,6 +64,6 @@ internal class AvatarTestFragment : Fragment() {
|
|||
}
|
||||
|
||||
companion object {
|
||||
private const val padding = 10
|
||||
private const val PADDING = 10
|
||||
}
|
||||
}
|
||||
|
|
|
@ -672,10 +672,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
|
|||
}
|
||||
|
||||
// open bottom sheet with actions
|
||||
private fun openAdvancedPermissions(
|
||||
sut: FileDetailSharingFragment,
|
||||
userShare: OCShare
|
||||
) {
|
||||
private fun openAdvancedPermissions(sut: FileDetailSharingFragment, userShare: OCShare) {
|
||||
activity.handler.post {
|
||||
sut.showSharingMenuActionSheet(userShare)
|
||||
}
|
||||
|
@ -723,10 +720,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
|
|||
/**
|
||||
* verify send new email note text
|
||||
*/
|
||||
private fun verifySendNewEmail(
|
||||
sut: FileDetailSharingFragment,
|
||||
userShare: OCShare
|
||||
) {
|
||||
private fun verifySendNewEmail(sut: FileDetailSharingFragment, userShare: OCShare) {
|
||||
activity.runOnUiThread { sut.showSharingMenuActionSheet(userShare) }
|
||||
|
||||
waitForIdleSync()
|
||||
|
|
|
@ -20,7 +20,9 @@ import org.junit.Test
|
|||
|
||||
class TrashbinActivityIT : AbstractIT() {
|
||||
enum class TestCase {
|
||||
ERROR, EMPTY, FILES
|
||||
ERROR,
|
||||
EMPTY,
|
||||
FILES
|
||||
}
|
||||
|
||||
@get:Rule
|
||||
|
|
|
@ -36,8 +36,10 @@ class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase)
|
|||
"image/png",
|
||||
"/trashbin/test.png",
|
||||
"subFolder/test.png",
|
||||
1395847838, // random date
|
||||
1395847908 // random date
|
||||
// random date
|
||||
1395847838,
|
||||
// random date
|
||||
1395847908
|
||||
)
|
||||
)
|
||||
files.add(
|
||||
|
@ -46,8 +48,10 @@ class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase)
|
|||
"image/jpeg",
|
||||
"/trashbin/image.jpg",
|
||||
"image.jpg",
|
||||
1395841858, // random date
|
||||
1395837858 // random date
|
||||
// random date
|
||||
1395841858,
|
||||
// random date
|
||||
1395837858
|
||||
)
|
||||
)
|
||||
files.add(
|
||||
|
@ -56,8 +60,10 @@ class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase)
|
|||
"DIR",
|
||||
"/trashbin/folder/",
|
||||
"folder",
|
||||
1395347858, // random date
|
||||
1395849858 // random date
|
||||
// random date
|
||||
1395347858,
|
||||
// random date
|
||||
1395849858
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -290,7 +290,8 @@ class EncryptionUtilsV2IT : EncryptionIT() {
|
|||
mimeType = MimeType.JPEG
|
||||
},
|
||||
EncryptionUtils.generateIV(),
|
||||
EncryptionUtils.generateUid(), // random string, not real tag
|
||||
// random string, not real tag
|
||||
EncryptionUtils.generateUid(),
|
||||
EncryptionUtils.generateKey(),
|
||||
metadataFile,
|
||||
storageManager
|
||||
|
|
|
@ -85,11 +85,7 @@ class InAppReviewHelperImpl(val appPreferences: AppPreferences) : InAppReviewHel
|
|||
}
|
||||
}
|
||||
|
||||
private fun launchAppReviewFlow(
|
||||
manager: ReviewManager,
|
||||
activity: AppCompatActivity,
|
||||
reviewInfo: ReviewInfo
|
||||
) {
|
||||
private fun launchAppReviewFlow(manager: ReviewManager, activity: AppCompatActivity, reviewInfo: ReviewInfo) {
|
||||
val flow = manager.launchReviewFlow(activity, reviewInfo)
|
||||
flow.addOnCompleteListener { _ ->
|
||||
// The flow has finished. The API does not indicate whether the user
|
||||
|
|
|
@ -44,7 +44,7 @@ class AssistantViewModel(
|
|||
private val _taskTypes = MutableStateFlow<List<TaskType>?>(null)
|
||||
val taskTypes: StateFlow<List<TaskType>?> = _taskTypes
|
||||
|
||||
private var _taskList: List<Task>? = null
|
||||
private var taskList: List<Task>? = null
|
||||
|
||||
private val _filteredTaskList = MutableStateFlow<List<Task>?>(null)
|
||||
val filteredTaskList: StateFlow<List<Task>?> = _filteredTaskList
|
||||
|
@ -55,10 +55,7 @@ class AssistantViewModel(
|
|||
}
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
fun createTask(
|
||||
input: String,
|
||||
type: String
|
||||
) {
|
||||
fun createTask(input: String, type: String) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val result = repository.createTask(input, type)
|
||||
|
||||
|
@ -111,7 +108,7 @@ class AssistantViewModel(
|
|||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val result = repository.getTaskList(appId)
|
||||
if (result.isSuccess) {
|
||||
_taskList = result.resultData.tasks
|
||||
taskList = result.resultData.tasks
|
||||
|
||||
filterTaskList(_selectedTaskType.value?.id)
|
||||
|
||||
|
@ -157,11 +154,11 @@ class AssistantViewModel(
|
|||
private fun filterTaskList(taskTypeId: String?) {
|
||||
if (taskTypeId == null) {
|
||||
_filteredTaskList.update {
|
||||
_taskList
|
||||
taskList
|
||||
}
|
||||
} else {
|
||||
_filteredTaskList.update {
|
||||
_taskList?.filter { it.type == taskTypeId }
|
||||
taskList?.filter { it.type == taskTypeId }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -151,11 +151,7 @@ fun AssistantScreen(viewModel: AssistantViewModel, activity: Activity) {
|
|||
}
|
||||
|
||||
@Composable
|
||||
private fun ScreenState(
|
||||
state: AssistantViewModel.State,
|
||||
activity: Activity,
|
||||
viewModel: AssistantViewModel
|
||||
) {
|
||||
private fun ScreenState(state: AssistantViewModel.State, activity: Activity, viewModel: AssistantViewModel) {
|
||||
val messageId: Int? = when (state) {
|
||||
is AssistantViewModel.State.Error -> {
|
||||
state.messageId
|
||||
|
|
|
@ -22,10 +22,7 @@ class AssistantRepository(private val client: NextcloudClient) : AssistantReposi
|
|||
return GetTaskTypesRemoteOperation().execute(client)
|
||||
}
|
||||
|
||||
override fun createTask(
|
||||
input: String,
|
||||
type: String
|
||||
): RemoteOperationResult<Void> {
|
||||
override fun createTask(input: String, type: String): RemoteOperationResult<Void> {
|
||||
return CreateTaskRemoteOperation(input, type).execute(client)
|
||||
}
|
||||
|
||||
|
|
|
@ -14,10 +14,7 @@ import com.owncloud.android.lib.resources.assistant.model.TaskTypes
|
|||
interface AssistantRepositoryType {
|
||||
fun getTaskTypes(): RemoteOperationResult<TaskTypes>
|
||||
|
||||
fun createTask(
|
||||
input: String,
|
||||
type: String
|
||||
): RemoteOperationResult<Void>
|
||||
fun createTask(input: String, type: String): RemoteOperationResult<Void>
|
||||
|
||||
fun getTaskList(appId: String): RemoteOperationResult<TaskList>
|
||||
|
||||
|
|
|
@ -41,10 +41,7 @@ import com.owncloud.android.lib.resources.assistant.model.Task
|
|||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Suppress("LongMethod", "MagicNumber")
|
||||
@Composable
|
||||
fun TaskView(
|
||||
task: Task,
|
||||
showDeleteTaskAlertDialog: (Long) -> Unit
|
||||
) {
|
||||
fun TaskView(task: Task, showDeleteTaskAlertDialog: (Long) -> Unit) {
|
||||
var showTaskDetailBottomSheet by remember { mutableStateOf(false) }
|
||||
var showMoreActionsBottomSheet by remember { mutableStateOf(false) }
|
||||
|
||||
|
|
|
@ -55,21 +55,16 @@ fun TaskDetailBottomSheet(task: Task, dismiss: () -> Unit) {
|
|||
ModalBottomSheet(
|
||||
modifier = Modifier.padding(top = 32.dp),
|
||||
containerColor = Color.White,
|
||||
onDismissRequest = {
|
||||
dismiss()
|
||||
},
|
||||
onDismissRequest = { dismiss() },
|
||||
sheetState = sheetState
|
||||
) {
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(16.dp)
|
||||
) {
|
||||
LazyColumn(modifier = Modifier.fillMaxSize().padding(16.dp)) {
|
||||
stickyHeader {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.background(color = colorResource(id = R.color.light_grey), shape = RoundedCornerShape(8.dp))
|
||||
modifier = Modifier.fillMaxWidth().background(
|
||||
color = colorResource(id = R.color.light_grey),
|
||||
shape = RoundedCornerShape(8.dp)
|
||||
)
|
||||
) {
|
||||
TextInputSelectButton(
|
||||
Modifier.weight(1f),
|
||||
|
@ -95,10 +90,10 @@ fun TaskDetailBottomSheet(task: Task, dismiss: () -> Unit) {
|
|||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(color = colorResource(id = R.color.light_grey), shape = RoundedCornerShape(8.dp))
|
||||
.padding(16.dp)
|
||||
modifier = Modifier.fillMaxSize().background(
|
||||
color = colorResource(id = R.color.light_grey),
|
||||
shape = RoundedCornerShape(8.dp)
|
||||
).padding(16.dp)
|
||||
) {
|
||||
Text(
|
||||
text = if (showInput) {
|
||||
|
|
|
@ -71,7 +71,7 @@ abstract class NextcloudDatabase : RoomDatabase() {
|
|||
|
||||
companion object {
|
||||
const val FIRST_ROOM_DB_VERSION = 65
|
||||
private var INSTANCE: NextcloudDatabase? = null
|
||||
private var instance: NextcloudDatabase? = null
|
||||
|
||||
@JvmStatic
|
||||
@Suppress("DeprecatedCallableAddReplaceWith")
|
||||
|
@ -82,8 +82,8 @@ abstract class NextcloudDatabase : RoomDatabase() {
|
|||
|
||||
@JvmStatic
|
||||
fun getInstance(context: Context, clock: Clock): NextcloudDatabase {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = Room
|
||||
if (instance == null) {
|
||||
instance = Room
|
||||
.databaseBuilder(context, NextcloudDatabase::class.java, ProviderMeta.DB_NAME)
|
||||
.allowMainThreadQueries()
|
||||
.addLegacyMigrations(clock, context)
|
||||
|
@ -92,7 +92,7 @@ abstract class NextcloudDatabase : RoomDatabase() {
|
|||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
}
|
||||
return INSTANCE!!
|
||||
return instance!!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,11 +46,7 @@ object DatabaseMigrationUtil {
|
|||
/**
|
||||
* Utility method to create a new table with the given columns
|
||||
*/
|
||||
private fun createNewTable(
|
||||
database: SupportSQLiteDatabase,
|
||||
newTableName: String,
|
||||
columns: Map<String, String>
|
||||
) {
|
||||
private fun createNewTable(database: SupportSQLiteDatabase, newTableName: String, columns: Map<String, String>) {
|
||||
val columnsString = columns.entries.joinToString(",") { "${it.key} ${it.value}" }
|
||||
database.execSQL("CREATE TABLE $newTableName ($columnsString)")
|
||||
}
|
||||
|
@ -80,11 +76,7 @@ object DatabaseMigrationUtil {
|
|||
/**
|
||||
* Utility method to replace an old table with a new one, essentially deleting the old one and renaming the new one
|
||||
*/
|
||||
private fun replaceTable(
|
||||
database: SupportSQLiteDatabase,
|
||||
tableName: String,
|
||||
newTableTempName: String
|
||||
) {
|
||||
private fun replaceTable(database: SupportSQLiteDatabase, tableName: String, newTableTempName: String) {
|
||||
database.execSQL("DROP TABLE $tableName")
|
||||
database.execSQL("ALTER TABLE $newTableTempName RENAME TO $tableName")
|
||||
}
|
||||
|
|
|
@ -12,11 +12,7 @@ import androidx.fragment.app.FragmentManager
|
|||
import dagger.android.support.AndroidSupportInjection
|
||||
|
||||
internal class FragmentInjector : FragmentManager.FragmentLifecycleCallbacks() {
|
||||
override fun onFragmentPreAttached(
|
||||
fragmentManager: FragmentManager,
|
||||
fragment: Fragment,
|
||||
context: Context
|
||||
) {
|
||||
override fun onFragmentPreAttached(fragmentManager: FragmentManager, fragment: Fragment, context: Context) {
|
||||
super.onFragmentPreAttached(fragmentManager, fragment, context)
|
||||
if (fragment is Injectable) {
|
||||
try {
|
||||
|
|
|
@ -39,10 +39,8 @@ class DocumentPageListAdapter :
|
|||
}
|
||||
|
||||
private class DiffItemCallback : DiffUtil.ItemCallback<String>() {
|
||||
override fun areItemsTheSame(oldItem: String, newItem: String) =
|
||||
oldItem == newItem
|
||||
override fun areItemsTheSame(oldItem: String, newItem: String) = oldItem == newItem
|
||||
|
||||
override fun areContentsTheSame(oldItem: String, newItem: String) =
|
||||
oldItem == newItem
|
||||
override fun areContentsTheSame(oldItem: String, newItem: String) = oldItem == newItem
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,10 +36,7 @@ class GeneratePDFUseCase @Inject constructor(private val logger: Logger) {
|
|||
/**
|
||||
* @return `true` if the PDF was generated successfully, `false` otherwise
|
||||
*/
|
||||
private fun writePdfToFile(
|
||||
filePath: String,
|
||||
document: PdfDocument
|
||||
): Boolean {
|
||||
private fun writePdfToFile(filePath: String, document: PdfDocument): Boolean {
|
||||
return try {
|
||||
val fileOutputStream = FileOutputStream(filePath)
|
||||
document.writeTo(fileOutputStream)
|
||||
|
@ -52,10 +49,7 @@ class GeneratePDFUseCase @Inject constructor(private val logger: Logger) {
|
|||
}
|
||||
}
|
||||
|
||||
private fun fillDocumentPages(
|
||||
document: PdfDocument,
|
||||
imagePaths: List<String>
|
||||
) {
|
||||
private fun fillDocumentPages(document: PdfDocument, imagePaths: List<String>) {
|
||||
imagePaths.forEach { path ->
|
||||
val bitmap = BitmapFactory.decodeFile(path)
|
||||
val pageInfo = PdfDocument.PageInfo.Builder(bitmap.width, bitmap.height, 1).create()
|
||||
|
|
|
@ -112,7 +112,8 @@ class GeneratePdfFromImagesWork(
|
|||
user,
|
||||
arrayOf(pdfPath),
|
||||
arrayOf(uploadPath),
|
||||
FileUploadWorker.LOCAL_BEHAVIOUR_DELETE, // MIME type will be detected from file name
|
||||
// MIME type will be detected from file name
|
||||
FileUploadWorker.LOCAL_BEHAVIOUR_DELETE,
|
||||
true,
|
||||
UploadFileOperation.CREATED_BY_USER,
|
||||
false,
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.owncloud.android.databinding.FragmentEtmAccountsBinding
|
|||
|
||||
class EtmAccountsFragment : EtmBaseFragment() {
|
||||
private var _binding: FragmentEtmAccountsBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
val binding get() = _binding!!
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Locale
|
|||
|
||||
class EtmMigrations : EtmBaseFragment() {
|
||||
private var _binding: FragmentEtmMigrationsBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
val binding get() = _binding!!
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.owncloud.android.databinding.FragmentEtmPreferencesBinding
|
|||
|
||||
class EtmPreferencesFragment : EtmBaseFragment() {
|
||||
private var _binding: FragmentEtmPreferencesBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
val binding get() = _binding!!
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -25,8 +25,5 @@ interface DeckApi {
|
|||
* value otherwise
|
||||
* @see [Deck Server App](https://apps.nextcloud.com/apps/deck)
|
||||
*/
|
||||
fun createForwardToDeckActionIntent(
|
||||
notification: Notification,
|
||||
user: User
|
||||
): Optional<PendingIntent>
|
||||
fun createForwardToDeckActionIntent(notification: Notification, user: User): Optional<PendingIntent>
|
||||
}
|
||||
|
|
|
@ -100,10 +100,7 @@ class BackgroundJobFactory @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun createFilesExportWork(
|
||||
context: Context,
|
||||
params: WorkerParameters
|
||||
): ListenableWorker {
|
||||
private fun createFilesExportWork(context: Context, params: WorkerParameters): ListenableWorker {
|
||||
return FilesExportWork(
|
||||
context,
|
||||
accountManager.user,
|
||||
|
@ -113,10 +110,7 @@ class BackgroundJobFactory @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
private fun createContentObserverJob(
|
||||
context: Context,
|
||||
workerParameters: WorkerParameters
|
||||
): ListenableWorker {
|
||||
private fun createContentObserverJob(context: Context, workerParameters: WorkerParameters): ListenableWorker {
|
||||
return ContentObserverWork(
|
||||
context,
|
||||
workerParameters,
|
||||
|
|
|
@ -409,9 +409,7 @@ internal class BackgroundJobManagerImpl(
|
|||
workManager.isWorkRunning(JOB_IMMEDIATE_FILES_SYNC + "_" + syncedFolderID)
|
||||
}
|
||||
|
||||
override fun schedulePeriodicFilesSyncJob(
|
||||
syncedFolderID: Long
|
||||
) {
|
||||
override fun schedulePeriodicFilesSyncJob(syncedFolderID: Long) {
|
||||
val arguments = Data.Builder()
|
||||
.putLong(FilesSyncWork.SYNCED_FOLDER_ID, syncedFolderID)
|
||||
.build()
|
||||
|
|
|
@ -250,7 +250,8 @@ class FilesSyncWork(
|
|||
localPaths,
|
||||
remotePaths,
|
||||
uploadAction!!,
|
||||
true, // create parent folder if not existent
|
||||
// create parent folder if not existent
|
||||
true,
|
||||
UploadFileOperation.CREATED_AS_INSTANT_PICTURE,
|
||||
needsWifi,
|
||||
needsCharging,
|
||||
|
|
|
@ -8,5 +8,6 @@
|
|||
package com.nextcloud.client.jobs.download
|
||||
|
||||
enum class FileDownloadError {
|
||||
Failed, Cancelled
|
||||
Failed,
|
||||
Cancelled
|
||||
}
|
||||
|
|
|
@ -81,11 +81,7 @@ class FileDownloadHelper {
|
|||
backgroundJobManager.cancelFilesDownloadJob(currentUser, currentFile.fileId)
|
||||
}
|
||||
|
||||
fun saveFile(
|
||||
file: OCFile,
|
||||
currentDownload: DownloadFileOperation?,
|
||||
storageManager: FileDataStorageManager?
|
||||
) {
|
||||
fun saveFile(file: OCFile, currentDownload: DownloadFileOperation?, storageManager: FileDataStorageManager?) {
|
||||
val syncDate = System.currentTimeMillis()
|
||||
|
||||
file.apply {
|
||||
|
|
|
@ -22,10 +22,7 @@ import com.owncloud.android.ui.preview.PreviewImageFragment
|
|||
|
||||
class FileDownloadIntents(private val context: Context) {
|
||||
|
||||
fun newDownloadIntent(
|
||||
download: DownloadFileOperation,
|
||||
linkedToRemotePath: String
|
||||
): Intent {
|
||||
fun newDownloadIntent(download: DownloadFileOperation, linkedToRemotePath: String): Intent {
|
||||
return Intent(FileDownloadWorker.getDownloadAddedMessage()).apply {
|
||||
putExtra(FileDownloadWorker.EXTRA_ACCOUNT_NAME, download.user.accountName)
|
||||
putExtra(FileDownloadWorker.EXTRA_REMOTE_PATH, download.remotePath)
|
||||
|
|
|
@ -369,10 +369,7 @@ class FileDownloadWorker(
|
|||
notificationManager.showNewNotification(text)
|
||||
}
|
||||
|
||||
private fun notifyDownloadResult(
|
||||
download: DownloadFileOperation,
|
||||
downloadResult: RemoteOperationResult<*>
|
||||
) {
|
||||
private fun notifyDownloadResult(download: DownloadFileOperation, downloadResult: RemoteOperationResult<*>) {
|
||||
if (downloadResult.isCancelled) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -282,17 +282,11 @@ class FileUploadHelper {
|
|||
cancelAndRestartUploadJob(accountManager.getUser(accountName).get())
|
||||
}
|
||||
|
||||
fun addUploadTransferProgressListener(
|
||||
listener: OnDatatransferProgressListener,
|
||||
targetKey: String
|
||||
) {
|
||||
fun addUploadTransferProgressListener(listener: OnDatatransferProgressListener, targetKey: String) {
|
||||
mBoundListeners[targetKey] = listener
|
||||
}
|
||||
|
||||
fun removeUploadTransferProgressListener(
|
||||
listener: OnDatatransferProgressListener,
|
||||
targetKey: String
|
||||
) {
|
||||
fun removeUploadTransferProgressListener(listener: OnDatatransferProgressListener, targetKey: String) {
|
||||
if (mBoundListeners[targetKey] === listener) {
|
||||
mBoundListeners.remove(targetKey)
|
||||
}
|
||||
|
|
|
@ -269,7 +269,10 @@ class FileUploadWorker(
|
|||
|
||||
// Only notify if it is not same file on remote that causes conflict
|
||||
if (uploadResult.code == ResultCode.SYNC_CONFLICT && FileUploadHelper().isSameFileOnRemote(
|
||||
uploadFileOperation.user, File(uploadFileOperation.storagePath), uploadFileOperation.remotePath, context
|
||||
uploadFileOperation.user,
|
||||
File(uploadFileOperation.storagePath),
|
||||
uploadFileOperation.remotePath,
|
||||
context
|
||||
)
|
||||
) {
|
||||
context.showToast(R.string.file_upload_worker_same_file_already_exists)
|
||||
|
|
|
@ -329,7 +329,7 @@ public final class AppPreferencesImpl implements AppPreferences {
|
|||
userAccountManager.getUser(),
|
||||
PREF__FOLDER_SORT_ORDER,
|
||||
folder,
|
||||
FileSortOrder.sort_a_to_z.name));
|
||||
FileSortOrder.SORT_A_TO_Z.name));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -343,7 +343,7 @@ public final class AppPreferencesImpl implements AppPreferences {
|
|||
|
||||
@Override
|
||||
public FileSortOrder getSortOrderByType(FileSortOrder.Type type) {
|
||||
return getSortOrderByType(type, FileSortOrder.sort_a_to_z);
|
||||
return getSortOrderByType(type, FileSortOrder.SORT_A_TO_Z);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,5 +11,7 @@
|
|||
package com.nextcloud.client.preferences
|
||||
|
||||
enum class SubFolderRule {
|
||||
YEAR_MONTH, YEAR, YEAR_MONTH_DAY
|
||||
YEAR_MONTH,
|
||||
YEAR,
|
||||
YEAR_MONTH_DAY
|
||||
}
|
||||
|
|
|
@ -15,25 +15,22 @@ import com.owncloud.android.datamodel.OCFile
|
|||
object IntentUtil {
|
||||
|
||||
@JvmStatic
|
||||
public fun createSendIntent(context: Context, file: OCFile): Intent =
|
||||
createBaseSendFileIntent().apply {
|
||||
action = Intent.ACTION_SEND
|
||||
type = file.mimeType
|
||||
putExtra(Intent.EXTRA_STREAM, file.getExposedFileUri(context))
|
||||
}
|
||||
public fun createSendIntent(context: Context, file: OCFile): Intent = createBaseSendFileIntent().apply {
|
||||
action = Intent.ACTION_SEND
|
||||
type = file.mimeType
|
||||
putExtra(Intent.EXTRA_STREAM, file.getExposedFileUri(context))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun createSendIntent(context: Context, files: Array<OCFile>): Intent =
|
||||
createBaseSendFileIntent().apply {
|
||||
action = Intent.ACTION_SEND_MULTIPLE
|
||||
type = getUniqueMimetype(files)
|
||||
putParcelableArrayListExtra(Intent.EXTRA_STREAM, getExposedFileUris(context, files))
|
||||
}
|
||||
public fun createSendIntent(context: Context, files: Array<OCFile>): Intent = createBaseSendFileIntent().apply {
|
||||
action = Intent.ACTION_SEND_MULTIPLE
|
||||
type = getUniqueMimetype(files)
|
||||
putParcelableArrayListExtra(Intent.EXTRA_STREAM, getExposedFileUris(context, files))
|
||||
}
|
||||
|
||||
private fun createBaseSendFileIntent(): Intent =
|
||||
Intent().apply {
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
}
|
||||
private fun createBaseSendFileIntent(): Intent = Intent().apply {
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
}
|
||||
|
||||
private fun getUniqueMimetype(files: Array<OCFile>): String? = when {
|
||||
files.distinctBy { it.mimeType }.size > 1 -> "*/*"
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
||||
*/
|
||||
|
||||
package com.nextcloud.ui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
|
@ -55,7 +54,7 @@ class ChooseAccountDialogFragment :
|
|||
private var currentStatus: Status? = null
|
||||
|
||||
private var _binding: DialogChooseAccountBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
val binding get() = _binding!!
|
||||
|
||||
@Inject
|
||||
lateinit var clientFactory: ClientFactory
|
||||
|
@ -187,12 +186,11 @@ class ChooseAccountDialogFragment :
|
|||
*/
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun newInstance(user: User) =
|
||||
ChooseAccountDialogFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putParcelable(ARG_CURRENT_USER_PARAM, user)
|
||||
}
|
||||
fun newInstance(user: User) = ChooseAccountDialogFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putParcelable(ARG_CURRENT_USER_PARAM, user)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
|
|
|
@ -93,7 +93,8 @@ class ImageDetailFragment : Fragment(), Injectable {
|
|||
}
|
||||
|
||||
nominatimClient = NominatimClient(
|
||||
getString(R.string.osm_geocoder_url), getString(R.string.osm_geocoder_contact)
|
||||
getString(R.string.osm_geocoder_url),
|
||||
getString(R.string.osm_geocoder_contact)
|
||||
)
|
||||
|
||||
return binding.root
|
||||
|
|
|
@ -37,11 +37,7 @@ import kotlinx.coroutines.launch
|
|||
@SuppressLint("ResourceAsColor")
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun MoreActionsBottomSheet(
|
||||
title: String? = null,
|
||||
actions: List<Triple<Int, Int, () -> Unit>>,
|
||||
dismiss: () -> Unit
|
||||
) {
|
||||
fun MoreActionsBottomSheet(title: String? = null, actions: List<Triple<Int, Int, () -> Unit>>, dismiss: () -> Unit) {
|
||||
val sheetState = rememberModalBottomSheetState()
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
|
|||
private lateinit var viewModel: FileActionsViewModel
|
||||
|
||||
private var _binding: FileActionsBottomSheetBinding? = null
|
||||
private val binding
|
||||
val binding
|
||||
get() = _binding!!
|
||||
|
||||
private lateinit var componentsGetter: ComponentsGetter
|
||||
|
@ -99,9 +99,7 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
|
|||
return binding.root
|
||||
}
|
||||
|
||||
private fun handleState(
|
||||
state: FileActionsViewModel.UiState
|
||||
) {
|
||||
private fun handleState(state: FileActionsViewModel.UiState) {
|
||||
toggleLoadingOrContent(state)
|
||||
when (state) {
|
||||
is FileActionsViewModel.UiState.LoadedForSingleFile -> {
|
||||
|
@ -192,9 +190,7 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
|
|||
}
|
||||
}
|
||||
|
||||
private fun displayActions(
|
||||
actions: List<FileAction>
|
||||
) {
|
||||
private fun displayActions(actions: List<FileAction>) {
|
||||
if (binding.fileActionsList.isEmpty()) {
|
||||
actions.forEach { action ->
|
||||
val view = inflateActionView(action)
|
||||
|
|
|
@ -54,10 +54,7 @@ class FileActionsViewModel @Inject constructor(
|
|||
@IdRes
|
||||
get() = _clickActionId
|
||||
|
||||
fun load(
|
||||
arguments: Bundle,
|
||||
componentsGetter: ComponentsGetter
|
||||
) {
|
||||
fun load(arguments: Bundle, componentsGetter: ComponentsGetter) {
|
||||
val files: List<OCFile>? = arguments.getParcelableArrayList(ARG_FILES)
|
||||
val numberOfAllFiles: Int = arguments.getInt(ARG_ALL_FILES_COUNT, 1)
|
||||
val isOverflow = arguments.getBoolean(ARG_IS_OVERFLOW, false)
|
||||
|
@ -104,17 +101,11 @@ class FileActionsViewModel @Inject constructor(
|
|||
.getToHide(inSingleFileFragment)
|
||||
}
|
||||
|
||||
private fun getActionsToShow(
|
||||
additionalFilter: IntArray?,
|
||||
toHide: List<Int>
|
||||
) = FileAction.SORTED_VALUES
|
||||
private fun getActionsToShow(additionalFilter: IntArray?, toHide: List<Int>) = FileAction.SORTED_VALUES
|
||||
.filter { additionalFilter == null || it.id !in additionalFilter }
|
||||
.filter { it.id !in toHide }
|
||||
|
||||
private fun updateStateLoaded(
|
||||
files: Collection<OCFile>,
|
||||
availableActions: List<FileAction>
|
||||
) {
|
||||
private fun updateStateLoaded(files: Collection<OCFile>, availableActions: List<FileAction>) {
|
||||
val state: UiState = when (files.size) {
|
||||
1 -> {
|
||||
val file = files.first()
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.owncloud.android.lib.common.utils.Log_OC
|
|||
import java.io.Serializable
|
||||
|
||||
@Suppress("TopLevelPropertyNaming")
|
||||
private const val tag = "BundleExtension"
|
||||
private const val TAG = "BundleExtension"
|
||||
|
||||
fun <T : Serializable?> Bundle?.getSerializableArgument(key: String, type: Class<T>): T? {
|
||||
if (this == null) {
|
||||
|
@ -33,7 +33,7 @@ fun <T : Serializable?> Bundle?.getSerializableArgument(key: String, type: Class
|
|||
}
|
||||
}
|
||||
} catch (e: ClassCastException) {
|
||||
Log_OC.e(tag, e.localizedMessage)
|
||||
Log_OC.e(TAG, e.localizedMessage)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ fun <T : Parcelable?> Bundle?.getParcelableArgument(key: String, type: Class<T>)
|
|||
this.getParcelable(key)
|
||||
}
|
||||
} catch (e: ClassCastException) {
|
||||
Log_OC.e(tag, e.localizedMessage)
|
||||
Log_OC.e(TAG, e.localizedMessage)
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.owncloud.android.lib.common.utils.Log_OC
|
|||
import java.io.Serializable
|
||||
|
||||
@Suppress("TopLevelPropertyNaming")
|
||||
private const val tag = "IntentExtension"
|
||||
private const val TAG = "IntentExtension"
|
||||
|
||||
fun <T : Serializable?> Intent?.getSerializableArgument(key: String, type: Class<T>): T? {
|
||||
if (this == null) {
|
||||
|
@ -33,7 +33,7 @@ fun <T : Serializable?> Intent?.getSerializableArgument(key: String, type: Class
|
|||
}
|
||||
}
|
||||
} catch (e: ClassCastException) {
|
||||
Log_OC.e(tag, e.localizedMessage)
|
||||
Log_OC.e(TAG, e.localizedMessage)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ fun <T : Parcelable?> Intent?.getParcelableArgument(key: String, type: Class<T>)
|
|||
this.getParcelableExtra(key)
|
||||
}
|
||||
} catch (e: ClassCastException) {
|
||||
Log_OC.e(tag, e.localizedMessage)
|
||||
Log_OC.e(TAG, e.localizedMessage)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,5 @@ package com.nextcloud.utils.extensions
|
|||
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
fun OnDatatransferProgressListener.getPercent(
|
||||
totalTransferredSoFar: Long,
|
||||
totalToTransfer: Long
|
||||
): Int = ((100.0 * totalTransferredSoFar.toDouble() / totalToTransfer.toDouble()).toInt()).coerceAtMost(100)
|
||||
fun OnDatatransferProgressListener.getPercent(totalTransferredSoFar: Long, totalToTransfer: Long): Int =
|
||||
((100.0 * totalTransferredSoFar.toDouble() / totalToTransfer.toDouble()).toInt()).coerceAtMost(100)
|
||||
|
|
|
@ -17,10 +17,7 @@ import javax.inject.Inject
|
|||
|
||||
class FastScrollUtils @Inject constructor(private val viewThemeUtils: ViewThemeUtils) {
|
||||
@JvmOverloads
|
||||
fun applyFastScroll(
|
||||
recyclerView: RecyclerView,
|
||||
viewHelper: FastScroller.ViewHelper? = null
|
||||
) {
|
||||
fun applyFastScroll(recyclerView: RecyclerView, viewHelper: FastScroller.ViewHelper? = null) {
|
||||
val builder =
|
||||
FastScrollerBuilder(recyclerView).let {
|
||||
viewThemeUtils.files.themeFastScrollerBuilder(
|
||||
|
|
|
@ -33,7 +33,8 @@ class DeepLinkLoginActivity : AuthenticatorActivity(), Injectable {
|
|||
val loginUrlInfo = parseLoginDataUrl(prefix, it.toString())
|
||||
val loginText = findViewById<TextView>(R.id.loginInfo)
|
||||
loginText.text = String.format(
|
||||
getString(R.string.direct_login_text), loginUrlInfo.username,
|
||||
getString(R.string.direct_login_text),
|
||||
loginUrlInfo.username,
|
||||
loginUrlInfo.serverAddress
|
||||
)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
|
|
|
@ -19,6 +19,7 @@ import com.owncloud.android.utils.SyncedFolderUtils;
|
|||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashSet;
|
||||
|
@ -212,7 +213,8 @@ public class FilesystemDataProvider {
|
|||
|
||||
private long getFileChecksum(String filepath) {
|
||||
|
||||
try (InputStream inputStream = new BufferedInputStream(new FileInputStream(filepath))) {
|
||||
try (FileInputStream fileInputStream = new FileInputStream(filepath);
|
||||
InputStream inputStream = new BufferedInputStream(fileInputStream)) {
|
||||
CRC32 crc = new CRC32();
|
||||
byte[] buf = new byte[1024 * 64];
|
||||
int size;
|
||||
|
|
|
@ -18,7 +18,8 @@ import androidx.annotation.RequiresApi
|
|||
* This wrapper is designed for compatibility on those versions.
|
||||
*/
|
||||
enum class ForegroundServiceType {
|
||||
DataSync, MediaPlayback;
|
||||
DataSync,
|
||||
MediaPlayback;
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
fun getId(): Int {
|
||||
|
|
|
@ -12,7 +12,9 @@ import android.util.SparseArray
|
|||
* Types of media folder.
|
||||
*/
|
||||
enum class MediaFolderType(@JvmField val id: Int) {
|
||||
CUSTOM(0), IMAGE(1), VIDEO(2);
|
||||
CUSTOM(0),
|
||||
IMAGE(1),
|
||||
VIDEO(2);
|
||||
|
||||
companion object {
|
||||
private val reverseMap = SparseArray<MediaFolderType>(3)
|
||||
|
|
|
@ -22,7 +22,10 @@ data class Template(
|
|||
val extension: String
|
||||
) : Parcelable {
|
||||
enum class Type {
|
||||
DOCUMENT, SPREADSHEET, PRESENTATION, UNKNOWN;
|
||||
DOCUMENT,
|
||||
SPREADSHEET,
|
||||
PRESENTATION,
|
||||
UNKNOWN;
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
|
|
|
@ -286,58 +286,70 @@ public final class ThumbnailsCacheManager {
|
|||
protected Bitmap doInBackground(Object... params) {
|
||||
Bitmap thumbnail;
|
||||
|
||||
file = (OCFile) params[0];
|
||||
|
||||
|
||||
if (file.getRemoteId() != null && file.isPreviewAvailable()) {
|
||||
// Thumbnail in cache?
|
||||
thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(
|
||||
ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE + file.getRemoteId()
|
||||
);
|
||||
|
||||
if (thumbnail != null && !file.isUpdateThumbnailNeeded()) {
|
||||
Float size = (float) ThumbnailsCacheManager.getThumbnailDimension();
|
||||
|
||||
// resized dimensions
|
||||
ImageDimension imageDimension = file.getImageDimension();
|
||||
if (imageDimension == null ||
|
||||
imageDimension.getWidth() != size ||
|
||||
imageDimension.getHeight() != size) {
|
||||
file.setImageDimension(new ImageDimension(thumbnail.getWidth(), thumbnail.getHeight()));
|
||||
storageManager.saveFile(file);
|
||||
}
|
||||
|
||||
if (MimeTypeUtil.isVideo(file)) {
|
||||
return ThumbnailsCacheManager.addVideoOverlay(thumbnail, MainApp.getAppContext());
|
||||
} else {
|
||||
return thumbnail;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
mClient = OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(user.toOwnCloudAccount(),
|
||||
MainApp.getAppContext());
|
||||
|
||||
thumbnail = doResizedImageInBackground(file, storageManager);
|
||||
newImage = true;
|
||||
|
||||
if (MimeTypeUtil.isVideo(file) && thumbnail != null) {
|
||||
thumbnail = addVideoOverlay(thumbnail, MainApp.getAppContext());
|
||||
}
|
||||
|
||||
} catch (OutOfMemoryError oome) {
|
||||
Log_OC.e(TAG, "Out of memory");
|
||||
} catch (Throwable t) {
|
||||
// the app should never break due to a problem with thumbnails
|
||||
Log_OC.e(TAG, "Generation of gallery image for " + file + " failed", t);
|
||||
}
|
||||
|
||||
return thumbnail;
|
||||
}
|
||||
if (params == null || params.length == 0 || !(params[0] instanceof OCFile)) {
|
||||
Log_OC.d(TAG, "Downloaded file is null or is not an instance of OCFile");
|
||||
return null;
|
||||
}
|
||||
|
||||
file = (OCFile) params[0];
|
||||
|
||||
if (file.getRemoteId() != null || file.isPreviewAvailable()) {
|
||||
// Thumbnail in cache?
|
||||
thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(
|
||||
ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE + file.getRemoteId());
|
||||
|
||||
if (thumbnail != null && !file.isUpdateThumbnailNeeded())
|
||||
return getThumbnailFromCache(thumbnail);
|
||||
|
||||
return getThumbnailFromServerAndAddToCache(thumbnail);
|
||||
}
|
||||
|
||||
Log_OC.d(TAG, "File cannot be previewed");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Bitmap getThumbnailFromServerAndAddToCache(Bitmap thumbnail) {
|
||||
try {
|
||||
mClient = OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(user.toOwnCloudAccount(),
|
||||
MainApp.getAppContext());
|
||||
|
||||
thumbnail = doResizedImageInBackground(file, storageManager);
|
||||
newImage = true;
|
||||
|
||||
if (MimeTypeUtil.isVideo(file) && thumbnail != null) {
|
||||
thumbnail = addVideoOverlay(thumbnail, MainApp.getAppContext());
|
||||
}
|
||||
|
||||
} catch (OutOfMemoryError oome) {
|
||||
Log_OC.e(TAG, "Out of memory");
|
||||
} catch (Throwable t) {
|
||||
// the app should never break due to a problem with thumbnails
|
||||
Log_OC.e(TAG, "Generation of gallery image for " + file + " failed", t);
|
||||
}
|
||||
|
||||
return thumbnail;
|
||||
}
|
||||
|
||||
private Bitmap getThumbnailFromCache(Bitmap thumbnail) {
|
||||
float size = (float) ThumbnailsCacheManager.getThumbnailDimension();
|
||||
|
||||
// resized dimensions
|
||||
ImageDimension imageDimension = file.getImageDimension();
|
||||
if (imageDimension == null ||
|
||||
imageDimension.getWidth() != size ||
|
||||
imageDimension.getHeight() != size) {
|
||||
file.setImageDimension(new ImageDimension(thumbnail.getWidth(), thumbnail.getHeight()));
|
||||
storageManager.saveFile(file);
|
||||
}
|
||||
|
||||
if (MimeTypeUtil.isVideo(file)) {
|
||||
return ThumbnailsCacheManager.addVideoOverlay(thumbnail, MainApp.getAppContext());
|
||||
} else {
|
||||
return thumbnail;
|
||||
}
|
||||
}
|
||||
|
||||
protected void onPostExecute(Bitmap bitmap) {
|
||||
if (bitmap != null && imageViewReference != null) {
|
||||
final ImageView imageView = imageViewReference.get();
|
||||
|
@ -1423,9 +1435,10 @@ public final class ThumbnailsCacheManager {
|
|||
}
|
||||
}
|
||||
|
||||
// resized dimensions
|
||||
// resized dimensions and set update thumbnail needed to false to prevent rendering loop
|
||||
if (thumbnail != null) {
|
||||
file.setImageDimension(new ImageDimension(thumbnail.getWidth(), thumbnail.getHeight()));
|
||||
file.setUpdateThumbnailNeeded(false);
|
||||
storageManager.saveFile(file);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,10 +227,20 @@ class MediaControlView(context: Context, attrs: AttributeSet?) :
|
|||
context,
|
||||
if (playerControl?.isPlaying == true) {
|
||||
R.drawable.ic_pause
|
||||
} else { R.drawable.ic_play }
|
||||
} else {
|
||||
R.drawable.ic_play
|
||||
}
|
||||
)
|
||||
binding.forwardBtn.visibility = if (playerControl?.canSeekForward() == true) { VISIBLE } else { INVISIBLE }
|
||||
binding.rewindBtn.visibility = if (playerControl?.canSeekBackward() == true) { VISIBLE } else { INVISIBLE }
|
||||
binding.forwardBtn.visibility = if (playerControl?.canSeekForward() == true) {
|
||||
VISIBLE
|
||||
} else {
|
||||
INVISIBLE
|
||||
}
|
||||
binding.rewindBtn.visibility = if (playerControl?.canSeekBackward() == true) {
|
||||
VISIBLE
|
||||
} else {
|
||||
INVISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
private fun doPauseResume() {
|
||||
|
|
|
@ -254,13 +254,7 @@ class ConflictsResolveActivity : FileActivity(), OnConflictDecisionMadeListener
|
|||
private val TAG = ConflictsResolveActivity::class.java.simpleName
|
||||
|
||||
@JvmStatic
|
||||
fun createIntent(
|
||||
file: OCFile?,
|
||||
user: User?,
|
||||
conflictUploadId: Long,
|
||||
flag: Int?,
|
||||
context: Context?
|
||||
): Intent {
|
||||
fun createIntent(file: OCFile?, user: User?, conflictUploadId: Long, flag: Int?, context: Context?): Intent {
|
||||
val intent = Intent(context, ConflictsResolveActivity::class.java)
|
||||
if (flag != null) {
|
||||
intent.flags = intent.flags or flag
|
||||
|
|
|
@ -475,10 +475,7 @@ open class FolderPickerActivity :
|
|||
* @param operation Creation operation performed.
|
||||
* @param result Result of the creation.
|
||||
*/
|
||||
private fun onCreateFolderOperationFinish(
|
||||
operation: CreateFolderOperation,
|
||||
result: RemoteOperationResult<*>
|
||||
) {
|
||||
private fun onCreateFolderOperationFinish(operation: CreateFolderOperation, result: RemoteOperationResult<*>) {
|
||||
if (result.isSuccess) {
|
||||
val fileListFragment = listOfFilesFragment
|
||||
fileListFragment?.onItemClicked(storageManager.getFileByPath(operation.remotePath))
|
||||
|
|
|
@ -343,11 +343,7 @@ class NotificationsActivity : DrawerActivity(), NotificationsContract.View {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onActionCallback(
|
||||
isSuccess: Boolean,
|
||||
notification: Notification,
|
||||
holder: NotificationViewHolder
|
||||
) {
|
||||
override fun onActionCallback(isSuccess: Boolean, notification: Notification, holder: NotificationViewHolder) {
|
||||
if (isSuccess) {
|
||||
adapter?.removeNotification(holder)
|
||||
} else {
|
||||
|
|
|
@ -222,11 +222,12 @@ class SyncedFoldersActivity :
|
|||
|
||||
private fun showPowerCheckDialog() {
|
||||
val alertDialog = AlertDialog.Builder(this)
|
||||
.setView(findViewById(R.id.root_layout))
|
||||
.setView(R.id.root_layout)
|
||||
.setPositiveButton(R.string.common_ok) { dialog, _ -> dialog.dismiss() }
|
||||
.setTitle(R.string.autoupload_disable_power_save_check)
|
||||
.setMessage(getString(R.string.power_save_check_dialog_message))
|
||||
.show()
|
||||
|
||||
viewThemeUtils.platform.colorTextButtons(alertDialog.getButton(AlertDialog.BUTTON_POSITIVE))
|
||||
}
|
||||
|
||||
|
@ -307,7 +308,8 @@ class SyncedFoldersActivity :
|
|||
}
|
||||
val syncFolderItems = sortSyncedFolderItems(
|
||||
mergeFolderData(currentAccountSyncedFoldersList, mediaFolders)
|
||||
)
|
||||
).filterNotNull()
|
||||
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
adapter.setSyncFolderItems(syncFolderItems)
|
||||
adapter.notifyDataSetChanged()
|
||||
|
@ -315,7 +317,9 @@ class SyncedFoldersActivity :
|
|||
if (!TextUtils.isEmpty(path)) {
|
||||
val section = adapter.getSectionByLocalPathAndType(path, type)
|
||||
if (section >= 0) {
|
||||
onSyncFolderSettingsClick(section, adapter[section])
|
||||
adapter.get(section)?.let {
|
||||
onSyncFolderSettingsClick(section, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
loadJob = null
|
||||
|
@ -559,7 +563,9 @@ class SyncedFoldersActivity :
|
|||
return result
|
||||
}
|
||||
|
||||
override fun onSyncStatusToggleClick(section: Int, syncedFolderDisplayItem: SyncedFolderDisplayItem) {
|
||||
override fun onSyncStatusToggleClick(section: Int, syncedFolderDisplayItem: SyncedFolderDisplayItem?) {
|
||||
if (syncedFolderDisplayItem == null) return
|
||||
|
||||
if (syncedFolderDisplayItem.id > SyncedFolder.UNPERSISTED_ID) {
|
||||
syncedFolderProvider.updateSyncedFolderEnabled(
|
||||
syncedFolderDisplayItem.id,
|
||||
|
@ -577,7 +583,7 @@ class SyncedFoldersActivity :
|
|||
}
|
||||
}
|
||||
|
||||
override fun onSyncFolderSettingsClick(section: Int, syncedFolderDisplayItem: SyncedFolderDisplayItem) {
|
||||
override fun onSyncFolderSettingsClick(section: Int, syncedFolderDisplayItem: SyncedFolderDisplayItem?) {
|
||||
val fragmentTransaction = supportFragmentManager.beginTransaction().apply {
|
||||
addToBackStack(null)
|
||||
}
|
||||
|
@ -596,7 +602,9 @@ class SyncedFoldersActivity :
|
|||
}
|
||||
}
|
||||
|
||||
override fun onVisibilityToggleClick(section: Int, syncedFolder: SyncedFolderDisplayItem) {
|
||||
override fun onVisibilityToggleClick(section: Int, syncedFolder: SyncedFolderDisplayItem?) {
|
||||
if (syncedFolder == null) return
|
||||
|
||||
syncedFolder.isHidden = !syncedFolder.isHidden
|
||||
saveOrUpdateSyncedFolder(syncedFolder)
|
||||
adapter.setSyncFolderItem(section, syncedFolder)
|
||||
|
@ -676,7 +684,7 @@ class SyncedFoldersActivity :
|
|||
saveOrUpdateSyncedFolder(newCustomFolder)
|
||||
adapter.addSyncFolderItem(newCustomFolder)
|
||||
} else {
|
||||
val item = adapter[syncedFolder.section]
|
||||
val item = adapter.get(syncedFolder.section) ?: return
|
||||
updateSyncedFolderItem(
|
||||
item,
|
||||
syncedFolder.id,
|
||||
|
@ -793,11 +801,7 @@ class SyncedFoldersActivity :
|
|||
item.setExcludeHidden(excludeHidden)
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(
|
||||
requestCode: Int,
|
||||
permissions: Array<String>,
|
||||
grantResults: IntArray
|
||||
) {
|
||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
|
||||
when (requestCode) {
|
||||
PermissionUtil.PERMISSIONS_EXTERNAL_STORAGE -> {
|
||||
// If request is cancelled, result arrays are empty.
|
||||
|
|
|
@ -17,19 +17,17 @@ import android.print.PrintDocumentInfo;
|
|||
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PrintAdapter extends PrintDocumentAdapter {
|
||||
private static final String TAG = PrintAdapter.class.getSimpleName();
|
||||
private static final String PDF_NAME = "finalPrint.pdf";
|
||||
|
||||
private String filePath;
|
||||
private final String filePath;
|
||||
|
||||
public PrintAdapter(String filePath) {
|
||||
this.filePath = filePath;
|
||||
|
@ -58,11 +56,9 @@ public class PrintAdapter extends PrintDocumentAdapter {
|
|||
ParcelFileDescriptor destination,
|
||||
CancellationSignal cancellationSignal,
|
||||
WriteResultCallback callback) {
|
||||
InputStream in = null;
|
||||
OutputStream out = null;
|
||||
try {
|
||||
in = new FileInputStream(new File(filePath));
|
||||
out = new FileOutputStream(destination.getFileDescriptor());
|
||||
|
||||
try (InputStream in = new FileInputStream(filePath);
|
||||
OutputStream out = new FileOutputStream(destination.getFileDescriptor())) {
|
||||
|
||||
byte[] buf = new byte[16384];
|
||||
int size;
|
||||
|
@ -79,14 +75,6 @@ public class PrintAdapter extends PrintDocumentAdapter {
|
|||
|
||||
} catch (IOException e) {
|
||||
Log_OC.e(TAG, "Error using temp file", e);
|
||||
} finally {
|
||||
try {
|
||||
Objects.requireNonNull(in).close();
|
||||
Objects.requireNonNull(out).close();
|
||||
|
||||
} catch (IOException | NullPointerException e) {
|
||||
Log_OC.e(TAG, "Error closing streams", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,454 +0,0 @@
|
|||
/*
|
||||
* Nextcloud - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2016 Andy Scherzinger
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
||||
*/
|
||||
package com.owncloud.android.ui.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.PopupMenu;
|
||||
|
||||
import com.afollestad.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||
import com.afollestad.sectionedrecyclerview.SectionedViewHolder;
|
||||
import com.nextcloud.client.core.Clock;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.databinding.GridSyncItemBinding;
|
||||
import com.owncloud.android.databinding.SyncedFoldersEmptyBinding;
|
||||
import com.owncloud.android.databinding.SyncedFoldersFooterBinding;
|
||||
import com.owncloud.android.databinding.SyncedFoldersItemHeaderBinding;
|
||||
import com.owncloud.android.datamodel.MediaFolderType;
|
||||
import com.owncloud.android.datamodel.SyncedFolderDisplayItem;
|
||||
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
|
||||
import com.owncloud.android.utils.theme.ViewThemeUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
/**
|
||||
* Adapter to display all auto-synced folders and/or instant upload media folders.
|
||||
*/
|
||||
public class SyncedFolderAdapter extends SectionedRecyclerViewAdapter<SectionedViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final Clock clock;
|
||||
private final int gridWidth;
|
||||
private final int gridTotal;
|
||||
private final ClickListener clickListener;
|
||||
private final List<SyncedFolderDisplayItem> syncFolderItems;
|
||||
private final List<SyncedFolderDisplayItem> filteredSyncFolderItems;
|
||||
private final boolean light;
|
||||
private static final int VIEW_TYPE_EMPTY = Integer.MAX_VALUE;
|
||||
private static final int VIEW_TYPE_ITEM = 1;
|
||||
private static final int VIEW_TYPE_HEADER = 2;
|
||||
private static final int VIEW_TYPE_FOOTER = 3;
|
||||
private boolean hideItems;
|
||||
private final ViewThemeUtils viewThemeUtils;
|
||||
private final Executor thumbnailThreadPool;
|
||||
|
||||
public SyncedFolderAdapter(Context context,
|
||||
Clock clock,
|
||||
int gridWidth,
|
||||
ClickListener listener,
|
||||
boolean light,
|
||||
ViewThemeUtils viewThemeUtils) {
|
||||
this.context = context;
|
||||
this.clock = clock;
|
||||
this.gridWidth = gridWidth;
|
||||
gridTotal = gridWidth * 2;
|
||||
clickListener = listener;
|
||||
syncFolderItems = new ArrayList<>();
|
||||
filteredSyncFolderItems = new ArrayList<>();
|
||||
this.light = light;
|
||||
this.hideItems = true;
|
||||
this.viewThemeUtils = viewThemeUtils;
|
||||
this.thumbnailThreadPool = Executors.newCachedThreadPool();
|
||||
|
||||
shouldShowHeadersForEmptySections(true);
|
||||
shouldShowFooters(true);
|
||||
}
|
||||
|
||||
public void toggleHiddenItemsVisibility() {
|
||||
hideItems = !hideItems;
|
||||
filteredSyncFolderItems.clear();
|
||||
filteredSyncFolderItems.addAll(filterHiddenItems(syncFolderItems, hideItems));
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setSyncFolderItems(List<SyncedFolderDisplayItem> syncFolderItems) {
|
||||
this.syncFolderItems.clear();
|
||||
this.syncFolderItems.addAll(syncFolderItems);
|
||||
|
||||
this.filteredSyncFolderItems.clear();
|
||||
this.filteredSyncFolderItems.addAll(filterHiddenItems(this.syncFolderItems, hideItems));
|
||||
}
|
||||
|
||||
public void setSyncFolderItem(int location, SyncedFolderDisplayItem syncFolderItem) {
|
||||
if (hideItems && syncFolderItem.isHidden() && filteredSyncFolderItems.contains(syncFolderItem)) {
|
||||
filteredSyncFolderItems.remove(location);
|
||||
} else {
|
||||
if (filteredSyncFolderItems.contains(syncFolderItem)) {
|
||||
filteredSyncFolderItems.set(filteredSyncFolderItems.indexOf(syncFolderItem), syncFolderItem);
|
||||
} else {
|
||||
filteredSyncFolderItems.add(syncFolderItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (syncFolderItems.contains(syncFolderItem)) {
|
||||
syncFolderItems.set(syncFolderItems.indexOf(syncFolderItem), syncFolderItem);
|
||||
} else {
|
||||
syncFolderItems.add(syncFolderItem);
|
||||
}
|
||||
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addSyncFolderItem(SyncedFolderDisplayItem syncFolderItem) {
|
||||
syncFolderItems.add(syncFolderItem);
|
||||
|
||||
// add item for display when either all items should be shown (!hideItems)
|
||||
// or if item should be shown (!.isHidden())
|
||||
if (!hideItems || !syncFolderItem.isHidden()) {
|
||||
filteredSyncFolderItems.add(syncFolderItem);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void removeItem(int section) {
|
||||
if (filteredSyncFolderItems.contains(syncFolderItems.get(section))) {
|
||||
filteredSyncFolderItems.remove(syncFolderItems.get(section));
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
syncFolderItems.remove(section);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter for hidden items
|
||||
*
|
||||
* @param items Collection of items to filter
|
||||
* @return Non-hidden items
|
||||
*/
|
||||
private List<SyncedFolderDisplayItem> filterHiddenItems(List<SyncedFolderDisplayItem> items, boolean hide) {
|
||||
if (!hide) {
|
||||
return items;
|
||||
} else {
|
||||
List<SyncedFolderDisplayItem> result = new ArrayList<>();
|
||||
|
||||
for (SyncedFolderDisplayItem item : items) {
|
||||
if (!item.isHidden() && !result.contains(item)) {
|
||||
result.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSectionCount() {
|
||||
if (filteredSyncFolderItems.size() > 0) {
|
||||
return filteredSyncFolderItems.size() + 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void clear() {
|
||||
filteredSyncFolderItems.clear();
|
||||
syncFolderItems.clear();
|
||||
}
|
||||
|
||||
public int getUnfilteredSectionCount() {
|
||||
if (syncFolderItems.size() > 0) {
|
||||
return syncFolderItems.size() + 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount(int section) {
|
||||
if (section < filteredSyncFolderItems.size()) {
|
||||
List<String> filePaths = filteredSyncFolderItems.get(section).getFilePaths();
|
||||
|
||||
if (filePaths != null) {
|
||||
return filteredSyncFolderItems.get(section).getFilePaths().size();
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public SyncedFolderDisplayItem get(int section) {
|
||||
return filteredSyncFolderItems.get(section);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int section, int relativePosition, int absolutePosition) {
|
||||
if (isLastSection(section)) {
|
||||
return VIEW_TYPE_EMPTY;
|
||||
} else {
|
||||
return VIEW_TYPE_ITEM;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeaderViewType(int section) {
|
||||
if (isLastSection(section)) {
|
||||
return VIEW_TYPE_EMPTY;
|
||||
} else {
|
||||
return VIEW_TYPE_HEADER;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFooterViewType(int section) {
|
||||
if (isLastSection(section) && showFooter()) {
|
||||
return VIEW_TYPE_FOOTER;
|
||||
} else {
|
||||
// only show footer after last item and only if folders have been hidden
|
||||
return VIEW_TYPE_EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean showFooter() {
|
||||
return syncFolderItems.size() > filteredSyncFolderItems.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the section of a synced folder for the given local path and type.
|
||||
*
|
||||
* @param localPath the local path of the synced folder
|
||||
* @param type the of the synced folder
|
||||
* @return the section index of the looked up synced folder, <code>-1</code> if not present
|
||||
*/
|
||||
public int getSectionByLocalPathAndType(String localPath, int type) {
|
||||
for (int i = 0; i < filteredSyncFolderItems.size(); i++) {
|
||||
if (filteredSyncFolderItems.get(i).getLocalPath().equalsIgnoreCase(localPath) &&
|
||||
filteredSyncFolderItems.get(i).getType().id == type) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindHeaderViewHolder(SectionedViewHolder commonHolder, final int section, boolean expanded) {
|
||||
if (section < filteredSyncFolderItems.size()) {
|
||||
HeaderViewHolder holder = (HeaderViewHolder) commonHolder;
|
||||
holder.binding.headerContainer.setVisibility(View.VISIBLE);
|
||||
|
||||
holder.binding.title.setText(filteredSyncFolderItems.get(section).getFolderName());
|
||||
|
||||
if (MediaFolderType.VIDEO == filteredSyncFolderItems.get(section).getType()) {
|
||||
holder.binding.type.setImageResource(R.drawable.video_32dp);
|
||||
} else if (MediaFolderType.IMAGE == filteredSyncFolderItems.get(section).getType()) {
|
||||
holder.binding.type.setImageResource(R.drawable.image_32dp);
|
||||
} else {
|
||||
holder.binding.type.setImageResource(R.drawable.folder_star_32dp);
|
||||
}
|
||||
|
||||
holder.binding.syncStatusButton.setVisibility(View.VISIBLE);
|
||||
holder.binding.syncStatusButton.setTag(section);
|
||||
holder.binding.syncStatusButton.setOnClickListener(v -> {
|
||||
filteredSyncFolderItems.get(section).setEnabled(
|
||||
!filteredSyncFolderItems.get(section).isEnabled(),
|
||||
clock.getCurrentTime()
|
||||
);
|
||||
setSyncButtonActiveIcon(
|
||||
holder.binding.syncStatusButton,
|
||||
filteredSyncFolderItems.get(section).isEnabled());
|
||||
clickListener.onSyncStatusToggleClick(section, filteredSyncFolderItems.get(section));
|
||||
});
|
||||
setSyncButtonActiveIcon(holder.binding.syncStatusButton, filteredSyncFolderItems.get(section).isEnabled());
|
||||
|
||||
if (light) {
|
||||
holder.binding.settingsButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.binding.settingsButton.setVisibility(View.VISIBLE);
|
||||
holder.binding.settingsButton.setTag(section);
|
||||
holder.binding.settingsButton.setOnClickListener(
|
||||
v -> onOverflowIconClicked(section, filteredSyncFolderItems.get(section), v));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void onOverflowIconClicked(int section, SyncedFolderDisplayItem item, View view) {
|
||||
PopupMenu popup = new PopupMenu(context, view);
|
||||
popup.inflate(R.menu.synced_folders_adapter);
|
||||
popup.setOnMenuItemClickListener(i -> optionsItemSelected(i, section, item));
|
||||
popup.getMenu()
|
||||
.findItem(R.id.action_auto_upload_folder_toggle_visibility)
|
||||
.setChecked(item.isHidden());
|
||||
|
||||
popup.show();
|
||||
}
|
||||
|
||||
private boolean optionsItemSelected(MenuItem menuItem, int section, SyncedFolderDisplayItem item) {
|
||||
if (menuItem.getItemId() == R.id.action_auto_upload_folder_toggle_visibility) {
|
||||
clickListener.onVisibilityToggleClick(section, item);
|
||||
} else {
|
||||
// default: R.id.action_create_custom_folder
|
||||
clickListener.onSyncFolderSettingsClick(section, item);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindFooterViewHolder(SectionedViewHolder holder, int section) {
|
||||
if (isLastSection(section) && showFooter()) {
|
||||
FooterViewHolder footerHolder = (FooterViewHolder) holder;
|
||||
footerHolder.binding.footerText.setOnClickListener(v -> toggleHiddenItemsVisibility());
|
||||
footerHolder.binding.footerText.setText(
|
||||
context.getResources().getQuantityString(
|
||||
R.plurals.synced_folders_show_hidden_folders,
|
||||
getHiddenFolderCount(),
|
||||
getHiddenFolderCount()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(SectionedViewHolder commonHolder, int section, int relativePosition,
|
||||
int absolutePosition) {
|
||||
if (section < filteredSyncFolderItems.size() && filteredSyncFolderItems.get(section).getFilePaths() != null) {
|
||||
MainViewHolder holder = (MainViewHolder) commonHolder;
|
||||
|
||||
File file = new File(filteredSyncFolderItems.get(section).getFilePaths().get(relativePosition));
|
||||
|
||||
ThumbnailsCacheManager.MediaThumbnailGenerationTask task =
|
||||
new ThumbnailsCacheManager.MediaThumbnailGenerationTask(holder.binding.thumbnail,
|
||||
context,
|
||||
viewThemeUtils);
|
||||
|
||||
ThumbnailsCacheManager.AsyncMediaThumbnailDrawable asyncDrawable =
|
||||
new ThumbnailsCacheManager.AsyncMediaThumbnailDrawable(
|
||||
context.getResources(),
|
||||
ThumbnailsCacheManager.mDefaultImg
|
||||
);
|
||||
holder.binding.thumbnail.setImageDrawable(asyncDrawable);
|
||||
|
||||
task.executeOnExecutor(thumbnailThreadPool, file);
|
||||
|
||||
// set proper tag
|
||||
holder.binding.thumbnail.setTag(file.hashCode());
|
||||
|
||||
holder.itemView.setTag(relativePosition % gridWidth);
|
||||
|
||||
if (filteredSyncFolderItems.get(section).getNumberOfFiles() > gridTotal &&
|
||||
relativePosition >= gridTotal - 1) {
|
||||
holder.binding.counter.setText(
|
||||
String.format(
|
||||
Locale.US,
|
||||
"%d",
|
||||
filteredSyncFolderItems.get(section).getNumberOfFiles() - gridTotal));
|
||||
holder.binding.counterLayout.setVisibility(View.VISIBLE);
|
||||
holder.binding.thumbnailDarkener.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.binding.counterLayout.setVisibility(View.GONE);
|
||||
holder.binding.thumbnailDarkener.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SectionedViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (viewType == VIEW_TYPE_HEADER) {
|
||||
return new HeaderViewHolder(
|
||||
SyncedFoldersItemHeaderBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)
|
||||
);
|
||||
} else if (viewType == VIEW_TYPE_FOOTER) {
|
||||
return new FooterViewHolder(
|
||||
SyncedFoldersFooterBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)
|
||||
);
|
||||
} else if (viewType == VIEW_TYPE_EMPTY) {
|
||||
return new EmptyViewHolder(
|
||||
SyncedFoldersEmptyBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)
|
||||
);
|
||||
} else {
|
||||
return new MainViewHolder(
|
||||
GridSyncItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isLastSection(int section) {
|
||||
return section >= getSectionCount() - 1;
|
||||
}
|
||||
|
||||
public int getHiddenFolderCount() {
|
||||
if (syncFolderItems != null && filteredSyncFolderItems != null) {
|
||||
return syncFolderItems.size() - filteredSyncFolderItems.size();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public interface ClickListener {
|
||||
void onSyncStatusToggleClick(int section, SyncedFolderDisplayItem syncedFolderDisplayItem);
|
||||
void onSyncFolderSettingsClick(int section, SyncedFolderDisplayItem syncedFolderDisplayItem);
|
||||
void onVisibilityToggleClick(int section, SyncedFolderDisplayItem item);
|
||||
}
|
||||
|
||||
static class HeaderViewHolder extends SectionedViewHolder {
|
||||
protected SyncedFoldersItemHeaderBinding binding;
|
||||
|
||||
private HeaderViewHolder(SyncedFoldersItemHeaderBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
}
|
||||
|
||||
static class FooterViewHolder extends SectionedViewHolder {
|
||||
protected SyncedFoldersFooterBinding binding;
|
||||
|
||||
private FooterViewHolder(SyncedFoldersFooterBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
}
|
||||
|
||||
static class EmptyViewHolder extends SectionedViewHolder {
|
||||
private EmptyViewHolder(SyncedFoldersEmptyBinding binding) {
|
||||
super(binding.getRoot());
|
||||
}
|
||||
}
|
||||
|
||||
static class MainViewHolder extends SectionedViewHolder {
|
||||
protected GridSyncItemBinding binding;
|
||||
|
||||
private MainViewHolder(GridSyncItemBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
}
|
||||
|
||||
private void setSyncButtonActiveIcon(ImageButton syncStatusButton, boolean enabled) {
|
||||
if (enabled) {
|
||||
syncStatusButton.setImageDrawable(
|
||||
viewThemeUtils.platform.tintPrimaryDrawable(context, R.drawable.ic_cloud_sync_on)
|
||||
);
|
||||
} else {
|
||||
syncStatusButton.setImageResource(R.drawable.ic_cloud_sync_off);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,456 @@
|
|||
/*
|
||||
* Nextcloud - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2016 Andy Scherzinger
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
||||
*/
|
||||
package com.owncloud.android.ui.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageButton
|
||||
import android.widget.PopupMenu
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import com.afollestad.sectionedrecyclerview.SectionedRecyclerViewAdapter
|
||||
import com.afollestad.sectionedrecyclerview.SectionedViewHolder
|
||||
import com.nextcloud.android.common.ui.theme.utils.ColorRole
|
||||
import com.nextcloud.client.core.Clock
|
||||
import com.owncloud.android.R
|
||||
import com.owncloud.android.databinding.GridSyncItemBinding
|
||||
import com.owncloud.android.databinding.SyncedFoldersEmptyBinding
|
||||
import com.owncloud.android.databinding.SyncedFoldersFooterBinding
|
||||
import com.owncloud.android.databinding.SyncedFoldersItemHeaderBinding
|
||||
import com.owncloud.android.datamodel.MediaFolderType
|
||||
import com.owncloud.android.datamodel.SyncedFolderDisplayItem
|
||||
import com.owncloud.android.datamodel.ThumbnailsCacheManager
|
||||
import com.owncloud.android.datamodel.ThumbnailsCacheManager.AsyncMediaThumbnailDrawable
|
||||
import com.owncloud.android.datamodel.ThumbnailsCacheManager.MediaThumbnailGenerationTask
|
||||
import com.owncloud.android.utils.theme.ViewThemeUtils
|
||||
import java.io.File
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.Executor
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
/**
|
||||
* Adapter to display all auto-synced folders and/or instant upload media folders.
|
||||
*/
|
||||
@Suppress("LongParameterList")
|
||||
class SyncedFolderAdapter(
|
||||
private val context: Context,
|
||||
private val clock: Clock,
|
||||
private val gridWidth: Int,
|
||||
private val clickListener: ClickListener,
|
||||
private val light: Boolean,
|
||||
private val viewThemeUtils: ViewThemeUtils
|
||||
) : SectionedRecyclerViewAdapter<SectionedViewHolder>() {
|
||||
|
||||
private val gridTotal = gridWidth * 2
|
||||
private val syncFolderItems: MutableList<SyncedFolderDisplayItem> = ArrayList()
|
||||
private val filteredSyncFolderItems: MutableList<SyncedFolderDisplayItem> = ArrayList()
|
||||
private var hideItems = true
|
||||
private val thumbnailThreadPool: Executor = Executors.newCachedThreadPool()
|
||||
|
||||
init {
|
||||
shouldShowHeadersForEmptySections(true)
|
||||
shouldShowFooters(true)
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun toggleHiddenItemsVisibility() {
|
||||
hideItems = !hideItems
|
||||
|
||||
filterHiddenItems(syncFolderItems, hideItems)?.let {
|
||||
filteredSyncFolderItems.clear()
|
||||
filteredSyncFolderItems.addAll(it)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
fun setSyncFolderItems(syncFolderItems: List<SyncedFolderDisplayItem>) {
|
||||
this.syncFolderItems.clear()
|
||||
this.syncFolderItems.addAll(syncFolderItems)
|
||||
|
||||
filterHiddenItems(this.syncFolderItems, hideItems)?.let {
|
||||
filteredSyncFolderItems.clear()
|
||||
filteredSyncFolderItems.addAll(it)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun setSyncFolderItem(location: Int, syncFolderItem: SyncedFolderDisplayItem) {
|
||||
if (hideItems && syncFolderItem.isHidden && filteredSyncFolderItems.contains(syncFolderItem)) {
|
||||
filteredSyncFolderItems.removeAt(location)
|
||||
} else {
|
||||
if (filteredSyncFolderItems.contains(syncFolderItem)) {
|
||||
filteredSyncFolderItems[filteredSyncFolderItems.indexOf(syncFolderItem)] = syncFolderItem
|
||||
} else {
|
||||
filteredSyncFolderItems.add(syncFolderItem)
|
||||
}
|
||||
}
|
||||
|
||||
if (syncFolderItems.contains(syncFolderItem)) {
|
||||
syncFolderItems[syncFolderItems.indexOf(syncFolderItem)] = syncFolderItem
|
||||
} else {
|
||||
syncFolderItems.add(syncFolderItem)
|
||||
}
|
||||
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun addSyncFolderItem(syncFolderItem: SyncedFolderDisplayItem) {
|
||||
syncFolderItems.add(syncFolderItem)
|
||||
|
||||
// add item for display when either all items should be shown (!hideItems)
|
||||
// or if item should be shown (!.isHidden())
|
||||
if (!hideItems || !syncFolderItem.isHidden) {
|
||||
filteredSyncFolderItems.add(syncFolderItem)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun removeItem(section: Int) {
|
||||
if (filteredSyncFolderItems.contains(syncFolderItems[section])) {
|
||||
filteredSyncFolderItems.remove(syncFolderItems[section])
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
syncFolderItems.removeAt(section)
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter for hidden items
|
||||
*
|
||||
* @param items Collection of items to filter
|
||||
* @return Non-hidden items
|
||||
*/
|
||||
private fun filterHiddenItems(
|
||||
items: List<SyncedFolderDisplayItem>?,
|
||||
hide: Boolean
|
||||
): List<SyncedFolderDisplayItem>? {
|
||||
if (!hide) {
|
||||
return items
|
||||
} else {
|
||||
val result: MutableList<SyncedFolderDisplayItem> = ArrayList()
|
||||
|
||||
for (item in items!!) {
|
||||
if (!item.isHidden && !result.contains(item)) {
|
||||
result.add(item)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
override fun getSectionCount(): Int {
|
||||
return if (filteredSyncFolderItems.size > 0) {
|
||||
filteredSyncFolderItems.size + 1
|
||||
} else {
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
fun clear() {
|
||||
filteredSyncFolderItems.clear()
|
||||
syncFolderItems.clear()
|
||||
}
|
||||
|
||||
val unfilteredSectionCount: Int
|
||||
get() = if (syncFolderItems.size > 0) {
|
||||
syncFolderItems.size + 1
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
||||
override fun getItemCount(section: Int): Int {
|
||||
if (section < filteredSyncFolderItems.size) {
|
||||
val filePaths = filteredSyncFolderItems[section].filePaths
|
||||
|
||||
return if (filePaths != null) {
|
||||
filteredSyncFolderItems[section].filePaths.size
|
||||
} else {
|
||||
1
|
||||
}
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
fun get(section: Int): SyncedFolderDisplayItem? {
|
||||
return if (section in filteredSyncFolderItems.indices) {
|
||||
filteredSyncFolderItems[section]
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemViewType(section: Int, relativePosition: Int, absolutePosition: Int): Int {
|
||||
return if (isLastSection(section)) {
|
||||
VIEW_TYPE_EMPTY
|
||||
} else {
|
||||
VIEW_TYPE_ITEM
|
||||
}
|
||||
}
|
||||
|
||||
override fun getHeaderViewType(section: Int): Int {
|
||||
return if (isLastSection(section)) {
|
||||
VIEW_TYPE_EMPTY
|
||||
} else {
|
||||
VIEW_TYPE_HEADER
|
||||
}
|
||||
}
|
||||
|
||||
override fun getFooterViewType(section: Int): Int {
|
||||
return if (isLastSection(section) && showFooter()) {
|
||||
VIEW_TYPE_FOOTER
|
||||
} else {
|
||||
// only show footer after last item and only if folders have been hidden
|
||||
VIEW_TYPE_EMPTY
|
||||
}
|
||||
}
|
||||
|
||||
private fun showFooter(): Boolean {
|
||||
return syncFolderItems.size > filteredSyncFolderItems.size
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the section of a synced folder for the given local path and type.
|
||||
*
|
||||
* @param localPath the local path of the synced folder
|
||||
* @param type the of the synced folder
|
||||
* @return the section index of the looked up synced folder, `-1` if not present
|
||||
*/
|
||||
fun getSectionByLocalPathAndType(localPath: String?, type: Int): Int {
|
||||
for (i in filteredSyncFolderItems.indices) {
|
||||
if (filteredSyncFolderItems[i].localPath.equals(localPath, ignoreCase = true) &&
|
||||
filteredSyncFolderItems[i].type.id == type
|
||||
) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
|
||||
return -1
|
||||
}
|
||||
|
||||
override fun onBindHeaderViewHolder(commonHolder: SectionedViewHolder, section: Int, expanded: Boolean) {
|
||||
if (section < filteredSyncFolderItems.size) {
|
||||
val holder = commonHolder as HeaderViewHolder
|
||||
holder.binding.headerContainer.visibility = View.VISIBLE
|
||||
|
||||
holder.binding.title.text = filteredSyncFolderItems[section].folderName
|
||||
|
||||
if (MediaFolderType.VIDEO == filteredSyncFolderItems[section].type) {
|
||||
holder.binding.type.setImageResource(R.drawable.video_32dp)
|
||||
} else if (MediaFolderType.IMAGE == filteredSyncFolderItems[section].type) {
|
||||
holder.binding.type.setImageResource(R.drawable.image_32dp)
|
||||
} else {
|
||||
holder.binding.type.setImageResource(R.drawable.folder_star_32dp)
|
||||
}
|
||||
|
||||
holder.binding.syncStatusButton.visibility = View.VISIBLE
|
||||
holder.binding.syncStatusButton.tag = section
|
||||
holder.binding.syncStatusButton.setOnClickListener {
|
||||
filteredSyncFolderItems[section].setEnabled(
|
||||
!filteredSyncFolderItems[section].isEnabled,
|
||||
clock.currentTime
|
||||
)
|
||||
setSyncButtonActiveIcon(
|
||||
holder.binding.syncStatusButton,
|
||||
filteredSyncFolderItems[section].isEnabled
|
||||
)
|
||||
clickListener.onSyncStatusToggleClick(section, filteredSyncFolderItems[section])
|
||||
}
|
||||
setSyncButtonActiveIcon(holder.binding.syncStatusButton, filteredSyncFolderItems[section].isEnabled)
|
||||
|
||||
if (light) {
|
||||
holder.binding.settingsButton.visibility = View.GONE
|
||||
} else {
|
||||
holder.binding.settingsButton.visibility = View.VISIBLE
|
||||
holder.binding.settingsButton.tag = section
|
||||
holder.binding.settingsButton.setOnClickListener { v: View ->
|
||||
onOverflowIconClicked(
|
||||
section,
|
||||
filteredSyncFolderItems[section],
|
||||
v
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun onOverflowIconClicked(section: Int, item: SyncedFolderDisplayItem, view: View) {
|
||||
val popup = PopupMenu(context, view).apply {
|
||||
inflate(R.menu.synced_folders_adapter)
|
||||
setOnMenuItemClickListener { i: MenuItem -> optionsItemSelected(i, section, item) }
|
||||
menu
|
||||
.findItem(R.id.action_auto_upload_folder_toggle_visibility)
|
||||
.setChecked(item.isHidden)
|
||||
}
|
||||
|
||||
popup.show()
|
||||
}
|
||||
|
||||
private fun optionsItemSelected(menuItem: MenuItem, section: Int, item: SyncedFolderDisplayItem): Boolean {
|
||||
if (menuItem.itemId == R.id.action_auto_upload_folder_toggle_visibility) {
|
||||
clickListener.onVisibilityToggleClick(section, item)
|
||||
} else {
|
||||
// default: R.id.action_create_custom_folder
|
||||
clickListener.onSyncFolderSettingsClick(section, item)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onBindFooterViewHolder(holder: SectionedViewHolder, section: Int) {
|
||||
if (isLastSection(section) && showFooter()) {
|
||||
val footerHolder = holder as FooterViewHolder
|
||||
footerHolder.binding.footerText.setOnClickListener { toggleHiddenItemsVisibility() }
|
||||
footerHolder.binding.footerText.text = context.resources.getQuantityString(
|
||||
R.plurals.synced_folders_show_hidden_folders,
|
||||
hiddenFolderCount,
|
||||
hiddenFolderCount
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(
|
||||
commonHolder: SectionedViewHolder,
|
||||
section: Int,
|
||||
relativePosition: Int,
|
||||
absolutePosition: Int
|
||||
) {
|
||||
if (section < filteredSyncFolderItems.size && filteredSyncFolderItems[section].filePaths != null) {
|
||||
val holder = commonHolder as MainViewHolder
|
||||
|
||||
val file = File(filteredSyncFolderItems[section].filePaths[relativePosition])
|
||||
|
||||
val task =
|
||||
MediaThumbnailGenerationTask(
|
||||
holder.binding.thumbnail,
|
||||
context,
|
||||
viewThemeUtils
|
||||
)
|
||||
|
||||
val asyncDrawable =
|
||||
AsyncMediaThumbnailDrawable(
|
||||
context.resources,
|
||||
ThumbnailsCacheManager.mDefaultImg
|
||||
)
|
||||
holder.binding.thumbnail.setImageDrawable(asyncDrawable)
|
||||
|
||||
task.executeOnExecutor(thumbnailThreadPool, file)
|
||||
|
||||
// set proper tag
|
||||
holder.binding.thumbnail.tag = file.hashCode()
|
||||
|
||||
holder.itemView.tag = relativePosition % gridWidth
|
||||
|
||||
if (filteredSyncFolderItems[section].numberOfFiles > gridTotal &&
|
||||
relativePosition >= gridTotal - 1
|
||||
) {
|
||||
holder.binding.counter.text = String.format(
|
||||
Locale.US,
|
||||
"%d",
|
||||
filteredSyncFolderItems[section].numberOfFiles - gridTotal
|
||||
)
|
||||
holder.binding.counterLayout.visibility = View.VISIBLE
|
||||
holder.binding.thumbnailDarkener.visibility = View.VISIBLE
|
||||
} else {
|
||||
holder.binding.counterLayout.visibility = View.GONE
|
||||
holder.binding.thumbnailDarkener.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SectionedViewHolder {
|
||||
return when (viewType) {
|
||||
VIEW_TYPE_HEADER -> {
|
||||
HeaderViewHolder(
|
||||
SyncedFoldersItemHeaderBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
parent,
|
||||
false
|
||||
)
|
||||
)
|
||||
}
|
||||
VIEW_TYPE_FOOTER -> {
|
||||
FooterViewHolder(
|
||||
SyncedFoldersFooterBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
parent,
|
||||
false
|
||||
)
|
||||
)
|
||||
}
|
||||
VIEW_TYPE_EMPTY -> {
|
||||
EmptyViewHolder(
|
||||
SyncedFoldersEmptyBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
parent,
|
||||
false
|
||||
)
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
MainViewHolder(
|
||||
GridSyncItemBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
parent,
|
||||
false
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun isLastSection(section: Int): Boolean {
|
||||
return section >= sectionCount - 1
|
||||
}
|
||||
|
||||
val hiddenFolderCount: Int
|
||||
get() = syncFolderItems.size - filteredSyncFolderItems.size
|
||||
|
||||
interface ClickListener {
|
||||
fun onSyncStatusToggleClick(section: Int, syncedFolderDisplayItem: SyncedFolderDisplayItem?)
|
||||
fun onSyncFolderSettingsClick(section: Int, syncedFolderDisplayItem: SyncedFolderDisplayItem?)
|
||||
fun onVisibilityToggleClick(section: Int, item: SyncedFolderDisplayItem?)
|
||||
}
|
||||
|
||||
internal class HeaderViewHolder(var binding: SyncedFoldersItemHeaderBinding) : SectionedViewHolder(
|
||||
binding.root
|
||||
)
|
||||
|
||||
internal class FooterViewHolder(var binding: SyncedFoldersFooterBinding) : SectionedViewHolder(
|
||||
binding.root
|
||||
)
|
||||
|
||||
internal class EmptyViewHolder(binding: SyncedFoldersEmptyBinding) : SectionedViewHolder(binding.root)
|
||||
|
||||
internal class MainViewHolder(var binding: GridSyncItemBinding) : SectionedViewHolder(
|
||||
binding.root
|
||||
)
|
||||
|
||||
private fun setSyncButtonActiveIcon(syncStatusButton: ImageButton, enabled: Boolean) {
|
||||
if (enabled) {
|
||||
syncStatusButton.setImageDrawable(
|
||||
viewThemeUtils.platform.tintDrawable(context, R.drawable.ic_cloud_sync_on, ColorRole.PRIMARY)
|
||||
)
|
||||
} else {
|
||||
syncStatusButton.setImageResource(R.drawable.ic_cloud_sync_off)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val VIEW_TYPE_EMPTY = Int.MAX_VALUE
|
||||
private const val VIEW_TYPE_ITEM = 1
|
||||
private const val VIEW_TYPE_HEADER = 2
|
||||
private const val VIEW_TYPE_FOOTER = 3
|
||||
}
|
||||
}
|
|
@ -83,7 +83,7 @@ public class TrashbinListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
files.addAll(trashbinFiles);
|
||||
|
||||
files = preferences.getSortOrderByType(FileSortOrder.Type.trashBinView,
|
||||
FileSortOrder.sort_new_to_old).sortTrashbinFiles(files);
|
||||
FileSortOrder.SORT_NEW_TO_OLD).sortTrashbinFiles(files);
|
||||
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
|
|
@ -78,10 +78,7 @@ class UnifiedSearchItemViewHolder(
|
|||
binding.unifiedSearchItemLayout.setOnClickListener { listInterface.onSearchResultClicked(entry) }
|
||||
}
|
||||
|
||||
private fun getPlaceholder(
|
||||
entry: SearchResultEntry,
|
||||
mimetype: String?
|
||||
): Drawable {
|
||||
private fun getPlaceholder(entry: SearchResultEntry, mimetype: String?): Drawable {
|
||||
val drawable = with(entry.icon) {
|
||||
when {
|
||||
equals("icon-folder") ->
|
||||
|
|
|
@ -103,14 +103,16 @@ class UnifiedSearchListAdapter(
|
|||
}
|
||||
|
||||
override fun onBindHeaderViewHolder(holder: SectionedViewHolder, section: Int, expanded: Boolean) {
|
||||
val headerViewHolder = holder as UnifiedSearchHeaderViewHolder
|
||||
headerViewHolder.bind(sections[section])
|
||||
(holder as UnifiedSearchHeaderViewHolder).run {
|
||||
bind(sections[section])
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindFooterViewHolder(holder: SectionedViewHolder, section: Int) {
|
||||
if (sections[section].hasMoreResults) {
|
||||
val footerViewHolder = holder as UnifiedSearchFooterViewHolder
|
||||
footerViewHolder.bind(sections[section])
|
||||
(holder as UnifiedSearchFooterViewHolder).run {
|
||||
bind(sections[section])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,17 +128,19 @@ class UnifiedSearchListAdapter(
|
|||
absolutePosition: Int
|
||||
) {
|
||||
// TODO different binding (and also maybe diff UI) for non-file results
|
||||
val itemViewHolder = holder as UnifiedSearchItemViewHolder
|
||||
val entry = sections[section].entries[relativePosition]
|
||||
itemViewHolder.bind(entry)
|
||||
(holder as UnifiedSearchItemViewHolder).run {
|
||||
val entry = sections[section].entries[relativePosition]
|
||||
bind(entry)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewAttachedToWindow(holder: SectionedViewHolder) {
|
||||
if (holder is UnifiedSearchItemViewHolder) {
|
||||
val thumbnailShimmer = holder.binding.thumbnailShimmer
|
||||
if (thumbnailShimmer.visibility == View.VISIBLE) {
|
||||
thumbnailShimmer.setImageResource(R.drawable.background)
|
||||
thumbnailShimmer.resetLoader()
|
||||
holder.binding.thumbnailShimmer.run {
|
||||
if (visibility == View.VISIBLE) {
|
||||
setImageResource(R.drawable.background)
|
||||
resetLoader()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class AccountRemovalDialog : DialogFragment(), AvatarGenerationListener, Injecta
|
|||
private var user: User? = null
|
||||
private lateinit var alertDialog: AlertDialog
|
||||
private var _binding: AccountRemovalDialogBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
val binding get() = _binding!!
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -80,11 +80,13 @@ class ChooseTemplateDialogFragment : DialogFragment(), View.OnClickListener, Tem
|
|||
private var creator: Creator? = null
|
||||
|
||||
enum class Type {
|
||||
DOCUMENT, SPREADSHEET, PRESENTATION
|
||||
DOCUMENT,
|
||||
SPREADSHEET,
|
||||
PRESENTATION
|
||||
}
|
||||
|
||||
private var _binding: ChooseTemplateBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
val binding get() = _binding!!
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
|
|
|
@ -52,11 +52,7 @@ class SendFilesDialog : BottomSheetDialogFragment(R.layout.send_files_fragment),
|
|||
}
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
binding = SendFilesFragmentBinding.inflate(inflater, container, false)
|
||||
|
||||
setupSendButtonRecyclerView()
|
||||
|
@ -102,7 +98,8 @@ class SendFilesDialog : BottomSheetDialogFragment(R.layout.send_files_fragment),
|
|||
icon = match.loadIcon(requireActivity().packageManager)
|
||||
label = match.loadLabel(requireActivity().packageManager)
|
||||
sendButtonData = SendButtonData(
|
||||
icon, label,
|
||||
icon,
|
||||
label,
|
||||
match.activityInfo.packageName,
|
||||
match.activityInfo.name
|
||||
)
|
||||
|
|
|
@ -200,7 +200,8 @@ class SendShareDialog : BottomSheetDialogFragment(R.layout.send_share_fragment),
|
|||
icon = match.loadIcon(requireActivity().packageManager)
|
||||
label = match.loadLabel(requireActivity().packageManager)
|
||||
sendButtonData = SendButtonData(
|
||||
icon, label,
|
||||
icon,
|
||||
label,
|
||||
match.activityInfo.packageName,
|
||||
match.activityInfo.name
|
||||
)
|
||||
|
|
|
@ -41,7 +41,7 @@ class SortingOrderDialogFragment : DialogFragment(), Injectable {
|
|||
retainInstance = true
|
||||
|
||||
binding = null
|
||||
currentSortOrderName = requireArguments().getString(KEY_SORT_ORDER, FileSortOrder.sort_a_to_z.name)
|
||||
currentSortOrderName = requireArguments().getString(KEY_SORT_ORDER, FileSortOrder.SORT_A_TO_Z.name)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,12 +51,12 @@ class SortingOrderDialogFragment : DialogFragment(), Injectable {
|
|||
*/
|
||||
private fun setupDialogElements(binding: SortingOrderFragmentBinding) {
|
||||
val bindings = listOf(
|
||||
binding.sortByNameAscending to FileSortOrder.sort_a_to_z,
|
||||
binding.sortByNameDescending to FileSortOrder.sort_z_to_a,
|
||||
binding.sortByModificationDateAscending to FileSortOrder.sort_old_to_new,
|
||||
binding.sortByModificationDateDescending to FileSortOrder.sort_new_to_old,
|
||||
binding.sortBySizeAscending to FileSortOrder.sort_small_to_big,
|
||||
binding.sortBySizeDescending to FileSortOrder.sort_big_to_small
|
||||
binding.sortByNameAscending to FileSortOrder.SORT_A_TO_Z,
|
||||
binding.sortByNameDescending to FileSortOrder.SORT_Z_TO_A,
|
||||
binding.sortByModificationDateAscending to FileSortOrder.SORT_OLD_TO_NEW,
|
||||
binding.sortByModificationDateDescending to FileSortOrder.SORT_NEW_TO_OLD,
|
||||
binding.sortBySizeAscending to FileSortOrder.SORT_SMALL_TO_BIG,
|
||||
binding.sortBySizeDescending to FileSortOrder.SORT_BIG_TO_SMALL
|
||||
)
|
||||
|
||||
bindings.forEach { (view, sortOrder) ->
|
||||
|
|
|
@ -97,7 +97,9 @@ class StoragePermissionDialogFragment : DialogFragment(), Injectable {
|
|||
|
||||
@Parcelize
|
||||
enum class Result : Parcelable {
|
||||
CANCEL, FULL_ACCESS, MEDIA_READ_ONLY
|
||||
CANCEL,
|
||||
FULL_ACCESS,
|
||||
MEDIA_READ_ONLY
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -274,17 +274,17 @@ class SyncedFolderPreferencesDialogFragment : DialogFragment(), Injectable {
|
|||
private fun checkWritableFolder() {
|
||||
if (!syncedFolder!!.isEnabled) {
|
||||
binding?.settingInstantBehaviourContainer?.isEnabled = false
|
||||
binding?.settingInstantBehaviourContainer?.alpha = alphaDisabled
|
||||
binding?.settingInstantBehaviourContainer?.alpha = ALPHA_DISABLED
|
||||
return
|
||||
}
|
||||
if (syncedFolder!!.localPath != null && File(syncedFolder!!.localPath).canWrite()) {
|
||||
binding?.settingInstantBehaviourContainer?.isEnabled = true
|
||||
binding?.settingInstantBehaviourContainer?.alpha = alphaEnabled
|
||||
binding?.settingInstantBehaviourContainer?.alpha = ALPHA_ENABLED
|
||||
binding?.settingInstantBehaviourSummary?.text =
|
||||
uploadBehaviorItemStrings[syncedFolder!!.uploadActionInteger]
|
||||
} else {
|
||||
binding?.settingInstantBehaviourContainer?.isEnabled = false
|
||||
binding?.settingInstantBehaviourContainer?.alpha = alphaDisabled
|
||||
binding?.settingInstantBehaviourContainer?.alpha = ALPHA_DISABLED
|
||||
syncedFolder?.setUploadAction(
|
||||
resources.getTextArray(R.array.pref_behaviour_entryValues)[0].toString()
|
||||
)
|
||||
|
@ -294,9 +294,9 @@ class SyncedFolderPreferencesDialogFragment : DialogFragment(), Injectable {
|
|||
|
||||
private fun setupViews(optionalBinding: SyncedFoldersSettingsLayoutBinding?, enable: Boolean) {
|
||||
val alpha: Float = if (enable) {
|
||||
alphaEnabled
|
||||
ALPHA_ENABLED
|
||||
} else {
|
||||
alphaDisabled
|
||||
ALPHA_DISABLED
|
||||
}
|
||||
|
||||
optionalBinding?.let { binding ->
|
||||
|
@ -518,8 +518,8 @@ class SyncedFolderPreferencesDialogFragment : DialogFragment(), Injectable {
|
|||
private val TAG = SyncedFolderPreferencesDialogFragment::class.java.simpleName
|
||||
private const val BEHAVIOUR_DIALOG_STATE = "BEHAVIOUR_DIALOG_STATE"
|
||||
private const val NAME_COLLISION_POLICY_DIALOG_STATE = "NAME_COLLISION_POLICY_DIALOG_STATE"
|
||||
private const val alphaEnabled = 1.0f
|
||||
private const val alphaDisabled = 0.7f
|
||||
private const val ALPHA_ENABLED = 1.0f
|
||||
private const val ALPHA_DISABLED = 0.7f
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(syncedFolder: SyncedFolderDisplayItem?, section: Int): SyncedFolderPreferencesDialogFragment? {
|
||||
|
|
|
@ -91,8 +91,12 @@ class FileDetailsSharingProcessFragment :
|
|||
* fragment instance to be called while modifying existing share information
|
||||
*/
|
||||
@JvmStatic
|
||||
fun newInstance(share: OCShare, screenType: Int, isReshareShown: Boolean, isExpirationDateShown: Boolean):
|
||||
FileDetailsSharingProcessFragment {
|
||||
fun newInstance(
|
||||
share: OCShare,
|
||||
screenType: Int,
|
||||
isReshareShown: Boolean,
|
||||
isExpirationDateShown: Boolean
|
||||
): FileDetailsSharingProcessFragment {
|
||||
val args = Bundle()
|
||||
args.putParcelable(ARG_OCSHARE, share)
|
||||
args.putInt(ARG_SCREEN_TYPE, screenType)
|
||||
|
|
|
@ -40,7 +40,7 @@ class ProfileBottomSheetDialog(
|
|||
private var _binding: ProfileBottomSheetFragmentBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
val binding get() = _binding!!
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -59,7 +59,7 @@ class UnifiedSearchFragment :
|
|||
UnifiedSearchItemViewHolder.FilesAction {
|
||||
private lateinit var adapter: UnifiedSearchListAdapter
|
||||
private var _binding: ListFragmentBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
val binding get() = _binding!!
|
||||
private var searchView: SearchView? = null
|
||||
lateinit var vm: IUnifiedSearchViewModel
|
||||
|
||||
|
|
|
@ -132,12 +132,9 @@ public class FileOperationsHelper {
|
|||
private String getUrlFromFile(String storagePath, Pattern pattern) {
|
||||
String url = null;
|
||||
|
||||
InputStreamReader fr = null;
|
||||
BufferedReader br = null;
|
||||
try {
|
||||
fr = new InputStreamReader(new FileInputStream(storagePath), StandardCharsets.UTF_8);
|
||||
br = new BufferedReader(fr);
|
||||
|
||||
try (FileInputStream inputStream = new FileInputStream(storagePath);
|
||||
InputStreamReader fr = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
|
||||
BufferedReader br = new BufferedReader(fr)) {
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
Matcher m = pattern.matcher(line);
|
||||
|
@ -148,23 +145,8 @@ public class FileOperationsHelper {
|
|||
}
|
||||
} catch (IOException e) {
|
||||
Log_OC.d(TAG, e.getMessage());
|
||||
} finally {
|
||||
if (br != null) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
Log_OC.d(TAG, "Error closing buffered reader for URL file", e);
|
||||
}
|
||||
}
|
||||
|
||||
if (fr != null) {
|
||||
try {
|
||||
fr.close();
|
||||
} catch (IOException e) {
|
||||
Log_OC.d(TAG, "Error closing file reader for URL file", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,11 @@ class UriUploader(
|
|||
) {
|
||||
|
||||
enum class UriUploaderResultCode {
|
||||
OK, ERROR_UNKNOWN, ERROR_NO_FILE_TO_UPLOAD, ERROR_READ_PERMISSION_NOT_GRANTED, ERROR_SENSITIVE_PATH
|
||||
OK,
|
||||
ERROR_UNKNOWN,
|
||||
ERROR_NO_FILE_TO_UPLOAD,
|
||||
ERROR_READ_PERMISSION_NOT_GRANTED,
|
||||
ERROR_SENSITIVE_PATH
|
||||
}
|
||||
|
||||
fun uploadUris(): UriUploaderResultCode {
|
||||
|
@ -121,11 +125,12 @@ class UriUploader(
|
|||
arrayOf(localPath ?: ""),
|
||||
arrayOf(remotePath),
|
||||
mBehaviour,
|
||||
false, // do not create parent folder if not existent
|
||||
// do not create parent folder if not existent
|
||||
false,
|
||||
UploadFileOperation.CREATED_BY_USER,
|
||||
false,
|
||||
false,
|
||||
NameCollisionPolicy.ASK_USER
|
||||
requiresWifi = false,
|
||||
requiresCharging = false,
|
||||
nameCollisionPolicy = NameCollisionPolicy.ASK_USER
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ class PreviewPdfFragment : Fragment(), Injectable {
|
|||
requireContext().startActivity(intent)
|
||||
}
|
||||
}
|
||||
viewModel.shouldShowZoomTip.observe(viewLifecycleOwner) { shouldShow ->
|
||||
viewModel.showZoomTip.observe(viewLifecycleOwner) { shouldShow ->
|
||||
if (shouldShow) {
|
||||
snack = DisplayUtils.showSnackMessage(binding.root, R.string.pdf_zoom_tip)
|
||||
viewModel.onZoomTipShown()
|
||||
|
@ -100,8 +100,7 @@ class PreviewPdfFragment : Fragment(), Injectable {
|
|||
setHasOptionsMenu(true)
|
||||
}
|
||||
|
||||
private fun getScreenWidth(): Int =
|
||||
requireContext().resources.displayMetrics.widthPixels
|
||||
private fun getScreenWidth(): Int = requireContext().resources.displayMetrics.widthPixels
|
||||
|
||||
override fun onPrepareOptionsMenu(menu: Menu) {
|
||||
super.onPrepareOptionsMenu(menu)
|
||||
|
|
|
@ -36,7 +36,7 @@ class PreviewPdfViewModel @Inject constructor(val appPreferences: AppPreferences
|
|||
get() = _previewImagePath
|
||||
|
||||
private var _showZoomTip = MutableLiveData<Boolean>()
|
||||
val shouldShowZoomTip: LiveData<Boolean>
|
||||
val showZoomTip: LiveData<Boolean>
|
||||
get() = _showZoomTip
|
||||
|
||||
override fun onCleared() {
|
||||
|
|
|
@ -159,7 +159,7 @@ class TrashbinActivity :
|
|||
supportFragmentManager,
|
||||
preferences?.getSortOrderByType(
|
||||
FileSortOrder.Type.trashBinView,
|
||||
FileSortOrder.sort_new_to_old
|
||||
FileSortOrder.SORT_NEW_TO_OLD
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -247,10 +247,10 @@ class TrashbinActivity :
|
|||
onBackPressedCallback.isEnabled = !isRoot
|
||||
}
|
||||
|
||||
override fun onSortingOrderChosen(sortOrder: FileSortOrder?) {
|
||||
override fun onSortingOrderChosen(selection: FileSortOrder?) {
|
||||
val sortButton = findViewById<TextView>(R.id.sort_button)
|
||||
sortButton.setText(DisplayUtils.getSortOrderStringId(sortOrder))
|
||||
trashbinListAdapter?.setSortOrder(sortOrder)
|
||||
sortButton.setText(DisplayUtils.getSortOrderStringId(selection))
|
||||
trashbinListAdapter?.setSortOrder(selection)
|
||||
}
|
||||
|
||||
override fun showTrashbinFolder(trashbinFiles: List<TrashbinFile?>?) {
|
||||
|
|
|
@ -30,26 +30,20 @@ import javax.inject.Inject
|
|||
class UnifiedSearchViewModel(application: Application) : AndroidViewModel(application), IUnifiedSearchViewModel {
|
||||
companion object {
|
||||
private const val TAG = "UnifiedSearchViewModel"
|
||||
private const val DEFAULT_LIMIT = 5
|
||||
private const val FILES_PROVIDER_ID = "files"
|
||||
}
|
||||
|
||||
private data class UnifiedSearchMetadata(
|
||||
var results: MutableList<SearchResult> = mutableListOf()
|
||||
) {
|
||||
fun nextCursor(): Int? = results.lastOrNull()?.cursor?.toInt()
|
||||
fun name(): String? = results.lastOrNull()?.name
|
||||
fun isFinished(): Boolean {
|
||||
if (results.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
val lastResult = results.last()
|
||||
return when {
|
||||
!lastResult.isPaginated -> true
|
||||
lastResult.entries.size < DEFAULT_LIMIT -> true
|
||||
else -> false
|
||||
fun nextCursor(): Int? {
|
||||
return try {
|
||||
results.lastOrNull()?.cursor?.toInt()
|
||||
} catch (e: NumberFormatException) {
|
||||
null
|
||||
}
|
||||
}
|
||||
fun name(): String? = results.lastOrNull()?.name
|
||||
}
|
||||
|
||||
private lateinit var currentAccountProvider: CurrentAccountProvider
|
||||
|
@ -62,7 +56,6 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
|||
get() = getApplication<Application>().applicationContext
|
||||
|
||||
private lateinit var repository: IUnifiedSearchRepository
|
||||
private var loadingStarted: Boolean = false
|
||||
private var results: MutableMap<ProviderID, UnifiedSearchMetadata> = mutableMapOf()
|
||||
|
||||
override val isLoading = MutableLiveData(false)
|
||||
|
@ -94,14 +87,6 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
|||
)
|
||||
}
|
||||
|
||||
open fun startLoading(query: String) {
|
||||
if (!loadingStarted) {
|
||||
loadingStarted = true
|
||||
this.query.value = query
|
||||
initialQuery()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears data and queries all available providers
|
||||
*/
|
||||
|
@ -146,6 +131,7 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
|||
isLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
else -> block()
|
||||
}
|
||||
}
|
||||
|
@ -166,6 +152,7 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
|||
val fullUrl = serverUrl + result.resourceUrl
|
||||
Uri.parse(fullUrl)
|
||||
}
|
||||
|
||||
else -> uri
|
||||
}
|
||||
}
|
||||
|
@ -185,10 +172,6 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
|||
}
|
||||
}
|
||||
|
||||
open fun clearError() {
|
||||
error.value = ""
|
||||
}
|
||||
|
||||
fun onError(error: Throwable) {
|
||||
Log_OC.e(TAG, "Error: " + error.stackTrace)
|
||||
}
|
||||
|
@ -213,11 +196,13 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
|||
searchResults.value = results
|
||||
.filter { it.value.results.isNotEmpty() }
|
||||
.map { (key, value) ->
|
||||
val isLastEntryHaveValue = results[key]?.results?.last()?.entries?.isEmpty() != true
|
||||
|
||||
UnifiedSearchSection(
|
||||
providerID = key,
|
||||
name = value.name()!!,
|
||||
entries = value.results.flatMap { it.entries },
|
||||
hasMoreResults = !value.isFinished()
|
||||
hasMoreResults = isLastEntryHaveValue && results[key]?.nextCursor() != null
|
||||
)
|
||||
}
|
||||
.sortedWith { o1, o2 ->
|
||||
|
|
|
@ -110,12 +110,12 @@ import androidx.fragment.app.FragmentManager;
|
|||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import static com.owncloud.android.ui.dialog.SortingOrderDialogFragment.SORTING_ORDER_FRAGMENT;
|
||||
import static com.owncloud.android.utils.FileSortOrder.sort_a_to_z_id;
|
||||
import static com.owncloud.android.utils.FileSortOrder.sort_big_to_small_id;
|
||||
import static com.owncloud.android.utils.FileSortOrder.sort_new_to_old_id;
|
||||
import static com.owncloud.android.utils.FileSortOrder.sort_old_to_new_id;
|
||||
import static com.owncloud.android.utils.FileSortOrder.sort_small_to_big_id;
|
||||
import static com.owncloud.android.utils.FileSortOrder.sort_z_to_a_id;
|
||||
import static com.owncloud.android.utils.FileSortOrder.SORT_A_TO_Z_ID;
|
||||
import static com.owncloud.android.utils.FileSortOrder.SORT_BIG_TO_SMALL_ID;
|
||||
import static com.owncloud.android.utils.FileSortOrder.SORT_NEW_TO_OLD_ID;
|
||||
import static com.owncloud.android.utils.FileSortOrder.SORT_OLD_TO_NEW_ID;
|
||||
import static com.owncloud.android.utils.FileSortOrder.SORT_SMALL_TO_BIG_ID;
|
||||
import static com.owncloud.android.utils.FileSortOrder.SORT_Z_TO_A_ID;
|
||||
|
||||
/**
|
||||
* A helper class for UI/display related operations.
|
||||
|
@ -819,17 +819,17 @@ public final class DisplayUtils {
|
|||
|
||||
public static @StringRes int getSortOrderStringId(FileSortOrder sortOrder) {
|
||||
switch (sortOrder.name) {
|
||||
case sort_z_to_a_id:
|
||||
case SORT_Z_TO_A_ID:
|
||||
return R.string.menu_item_sort_by_name_z_a;
|
||||
case sort_new_to_old_id:
|
||||
case SORT_NEW_TO_OLD_ID:
|
||||
return R.string.menu_item_sort_by_date_newest_first;
|
||||
case sort_old_to_new_id:
|
||||
case SORT_OLD_TO_NEW_ID:
|
||||
return R.string.menu_item_sort_by_date_oldest_first;
|
||||
case sort_big_to_small_id:
|
||||
case SORT_BIG_TO_SMALL_ID:
|
||||
return R.string.menu_item_sort_by_size_biggest_first;
|
||||
case sort_small_to_big_id:
|
||||
case SORT_SMALL_TO_BIG_ID:
|
||||
return R.string.menu_item_sort_by_size_smallest_first;
|
||||
case sort_a_to_z_id:
|
||||
case SORT_A_TO_Z_ID:
|
||||
default:
|
||||
return R.string.menu_item_sort_by_name_a_z;
|
||||
}
|
||||
|
|
|
@ -196,7 +196,8 @@ class EncryptionUtilsV2 {
|
|||
|
||||
DecryptedFolderMetadataFile(
|
||||
decryptedMetadata,
|
||||
mutableListOf(), // subfolder do not store user array
|
||||
// subfolder do not store user array
|
||||
mutableListOf(),
|
||||
mutableMapOf()
|
||||
)
|
||||
} else {
|
||||
|
@ -530,20 +531,13 @@ class EncryptionUtilsV2 {
|
|||
}
|
||||
|
||||
@Throws(IllegalStateException::class)
|
||||
fun removeFileFromMetadata(
|
||||
fileName: String,
|
||||
metadata: DecryptedFolderMetadataFile
|
||||
) {
|
||||
fun removeFileFromMetadata(fileName: String, metadata: DecryptedFolderMetadataFile) {
|
||||
metadata.metadata.files.remove(fileName)
|
||||
?: throw IllegalStateException("File $fileName not found in metadata!")
|
||||
}
|
||||
|
||||
@Throws(IllegalStateException::class)
|
||||
fun renameFile(
|
||||
key: String,
|
||||
newName: String,
|
||||
metadataFile: DecryptedFolderMetadataFile
|
||||
) {
|
||||
fun renameFile(key: String, newName: String, metadataFile: DecryptedFolderMetadataFile) {
|
||||
if (!metadataFile.metadata.files.containsKey(key)) {
|
||||
throw IllegalStateException("File with key $key not found in metadata!")
|
||||
}
|
||||
|
@ -956,7 +950,8 @@ class EncryptionUtilsV2 {
|
|||
encryptedFolderMetadataFile: EncryptedFolderMetadataFile,
|
||||
decryptedFolderMetadataFile: DecryptedFolderMetadataFile,
|
||||
oldCounter: Long,
|
||||
ans: String // base 64 encoded BER
|
||||
// base 64 encoded BER
|
||||
ans: String
|
||||
) {
|
||||
// check counter
|
||||
if (decryptedFolderMetadataFile.metadata.counter < oldCounter) {
|
||||
|
|
|
@ -25,13 +25,7 @@ import java.io.InputStream
|
|||
|
||||
class FileExportUtils {
|
||||
@Throws(IllegalStateException::class)
|
||||
fun exportFile(
|
||||
fileName: String,
|
||||
mimeType: String,
|
||||
contentResolver: ContentResolver,
|
||||
ocFile: OCFile?,
|
||||
file: File?
|
||||
) {
|
||||
fun exportFile(fileName: String, mimeType: String, contentResolver: ContentResolver, ocFile: OCFile?, file: File?) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
exportFileAndroid10AndAbove(
|
||||
fileName,
|
||||
|
|
|
@ -29,44 +29,46 @@ open class FileSortOrder(@JvmField var name: String, var isAscending: Boolean) {
|
|||
}
|
||||
|
||||
enum class SortType {
|
||||
SIZE, ALPHABET, DATE
|
||||
SIZE,
|
||||
ALPHABET,
|
||||
DATE
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val sort_a_to_z_id = "sort_a_to_z"
|
||||
const val sort_z_to_a_id = "sort_z_to_a"
|
||||
const val sort_old_to_new_id = "sort_old_to_new"
|
||||
const val sort_new_to_old_id = "sort_new_to_old"
|
||||
const val sort_small_to_big_id = "sort_small_to_big"
|
||||
const val sort_big_to_small_id = "sort_big_to_small"
|
||||
const val SORT_A_TO_Z_ID = "sort_a_to_z"
|
||||
const val SORT_Z_TO_A_ID = "sort_z_to_a"
|
||||
const val SORT_OLD_TO_NEW_ID = "sort_old_to_new"
|
||||
const val SORT_NEW_TO_OLD_ID = "sort_new_to_old"
|
||||
const val SORT_SMALL_TO_BIG_ID = "sort_small_to_big"
|
||||
const val SORT_BIG_TO_SMALL_ID = "sort_big_to_small"
|
||||
|
||||
@JvmField
|
||||
val sort_a_to_z: FileSortOrder = FileSortOrderByName(sort_a_to_z_id, true)
|
||||
val SORT_A_TO_Z: FileSortOrder = FileSortOrderByName(SORT_A_TO_Z_ID, true)
|
||||
|
||||
@JvmField
|
||||
val sort_z_to_a: FileSortOrder = FileSortOrderByName(sort_z_to_a_id, false)
|
||||
val SORT_Z_TO_A: FileSortOrder = FileSortOrderByName(SORT_Z_TO_A_ID, false)
|
||||
|
||||
@JvmField
|
||||
val sort_old_to_new: FileSortOrder = FileSortOrderByDate(sort_old_to_new_id, true)
|
||||
val SORT_OLD_TO_NEW: FileSortOrder = FileSortOrderByDate(SORT_OLD_TO_NEW_ID, true)
|
||||
|
||||
@JvmField
|
||||
val sort_new_to_old: FileSortOrder = FileSortOrderByDate(sort_new_to_old_id, false)
|
||||
val SORT_NEW_TO_OLD: FileSortOrder = FileSortOrderByDate(SORT_NEW_TO_OLD_ID, false)
|
||||
|
||||
@JvmField
|
||||
val sort_small_to_big: FileSortOrder = FileSortOrderBySize(sort_small_to_big_id, true)
|
||||
val SORT_SMALL_TO_BIG: FileSortOrder = FileSortOrderBySize(SORT_SMALL_TO_BIG_ID, true)
|
||||
|
||||
@JvmField
|
||||
val sort_big_to_small: FileSortOrder = FileSortOrderBySize(sort_big_to_small_id, false)
|
||||
val SORT_BIG_TO_SMALL: FileSortOrder = FileSortOrderBySize(SORT_BIG_TO_SMALL_ID, false)
|
||||
|
||||
@JvmField
|
||||
val sortOrders: Map<String, FileSortOrder> = Collections.unmodifiableMap(
|
||||
mapOf(
|
||||
sort_a_to_z.name to sort_a_to_z,
|
||||
sort_z_to_a.name to sort_z_to_a,
|
||||
sort_old_to_new.name to sort_old_to_new,
|
||||
sort_new_to_old.name to sort_new_to_old,
|
||||
sort_small_to_big.name to sort_small_to_big,
|
||||
sort_big_to_small.name to sort_big_to_small
|
||||
SORT_A_TO_Z.name to SORT_A_TO_Z,
|
||||
SORT_Z_TO_A.name to SORT_Z_TO_A,
|
||||
SORT_OLD_TO_NEW.name to SORT_OLD_TO_NEW,
|
||||
SORT_NEW_TO_OLD.name to SORT_NEW_TO_OLD,
|
||||
SORT_SMALL_TO_BIG.name to SORT_SMALL_TO_BIG,
|
||||
SORT_BIG_TO_SMALL.name to SORT_BIG_TO_SMALL
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -103,14 +105,14 @@ open class FileSortOrder(@JvmField var name: String, var isAscending: Boolean) {
|
|||
|
||||
open fun getType(): SortType {
|
||||
return when (name) {
|
||||
sort_z_to_a_id,
|
||||
sort_a_to_z_id -> SortType.ALPHABET
|
||||
SORT_Z_TO_A_ID,
|
||||
SORT_A_TO_Z_ID -> SortType.ALPHABET
|
||||
|
||||
sort_small_to_big_id,
|
||||
sort_big_to_small_id -> SortType.SIZE
|
||||
SORT_SMALL_TO_BIG_ID,
|
||||
SORT_BIG_TO_SMALL_ID -> SortType.SIZE
|
||||
|
||||
sort_new_to_old_id,
|
||||
sort_old_to_new_id -> SortType.DATE
|
||||
SORT_NEW_TO_OLD_ID,
|
||||
SORT_OLD_TO_NEW_ID -> SortType.DATE
|
||||
|
||||
else -> SortType.ALPHABET
|
||||
}
|
||||
|
|
|
@ -371,17 +371,13 @@ public final class FileStorageUtils {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressFBWarnings(value="OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE",
|
||||
justification="False-positive on the output stream")
|
||||
@SuppressFBWarnings(value = "OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE",
|
||||
justification = "False-positive on the output stream")
|
||||
public static boolean copyFile(File src, File target) {
|
||||
boolean ret = true;
|
||||
|
||||
InputStream in = null;
|
||||
OutputStream out = null;
|
||||
|
||||
try {
|
||||
in = new FileInputStream(src);
|
||||
out = new FileOutputStream(target);
|
||||
try (InputStream in = new FileInputStream(src);
|
||||
OutputStream out = new FileOutputStream(target)) {
|
||||
byte[] buf = new byte[1024];
|
||||
int len;
|
||||
while ((len = in.read(buf)) > 0) {
|
||||
|
@ -389,21 +385,6 @@ public final class FileStorageUtils {
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
ret = false;
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
Log_OC.e(TAG, "Error closing input stream during copy", e);
|
||||
}
|
||||
}
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
Log_OC.e(TAG, "Error closing output stream during copy", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -108,9 +108,7 @@ class FilesSpecificViewThemeUtils @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun getThumbDrawable(
|
||||
context: Context
|
||||
): Drawable {
|
||||
private fun getThumbDrawable(context: Context): Drawable {
|
||||
val thumbDrawable =
|
||||
ResourcesCompat.getDrawable(
|
||||
context.resources,
|
||||
|
|
|
@ -574,6 +574,7 @@
|
|||
<string name="upload_action_global_upload_pause">Posar toles descargues</string>
|
||||
<string name="upload_action_global_upload_resume">Siguir con toles descargues</string>
|
||||
<string name="upload_cannot_create_file">Nun se pue crear el ficheru llocal</string>
|
||||
<string name="upload_direct_camera_video">Videu</string>
|
||||
<string name="upload_file_dialog_filename">Nome de ficheru</string>
|
||||
<string name="upload_file_dialog_filetype">Triba de ficheru</string>
|
||||
<string name="upload_global_pause_title">Toles descargues tán posaes</string>
|
||||
|
|
|
@ -33,7 +33,7 @@ class OCFileSortTest {
|
|||
fun testFileSortOrder() {
|
||||
val toSort = getShuffledList()
|
||||
|
||||
FileSortOrder.sort_a_to_z.sortCloudFiles(toSort)
|
||||
FileSortOrder.SORT_A_TO_Z.sortCloudFiles(toSort)
|
||||
|
||||
verifySort(toSort)
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -25,6 +25,7 @@
|
|||
</trusted-key>
|
||||
<trusted-key id="08EF3EC268A80497ED2030812838A2C567F74226" group="org.scala-lang.modules" name="scala-parallel-collections_2.13" version="1.0.4"/>
|
||||
<trusted-key id="08F0AAB4D0C1A4BDDE340765B341DDB020FCB6AB" group="org.bouncycastle"/>
|
||||
<trusted-key id="09939C73246B4BA7444CAA453D002DBC5EA9615F" group="dev.drewhamilton.poko"/>
|
||||
<trusted-key id="0A784736254716AC0EBEF6E2365D826E84B11B58" group="com.karumi"/>
|
||||
<trusted-key id="0C6914BDDF32BD0AF3AAEB8A2148325ADD28A1AD" group="^com[.]atlassian($|([.].*))" regex="true"/>
|
||||
<trusted-key id="0CC641C3A62453AB390066C4A41F13C999945293">
|
||||
|
@ -1652,6 +1653,11 @@
|
|||
<sha256 value="7ff14d11a3167a854ac12e62aa6b5a68d230821664199244d1563cf30b5c6fd0" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="androidx.fragment" name="fragment" version="1.8.1">
|
||||
<artifact name="fragment-1.8.1.aar">
|
||||
<sha256 value="81526b28c3e4b513760174ee26142c1372c9e13d1c8bf3a220830307aca1971f" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="androidx.fragment" name="fragment-ktx" version="1.3.2">
|
||||
<artifact name="fragment-ktx-1.3.2.aar">
|
||||
<sha256 value="29af1e9ee0e93b5fc638600c230705584aecc49205c363f0923ba1e5be675533" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -3050,6 +3056,11 @@
|
|||
<sha256 value="80717d62484256843ba1221b6f2ef867acd1c515a08311dad487b7272685bb45" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="ch.qos.logback" name="logback-parent" version="1.3.14">
|
||||
<artifact name="logback-parent-1.3.14.pom">
|
||||
<sha256 value="796dcc4cbfd42aeb7f72432445f5364619678928242b9f3e4749d4c4e0dd9dc4" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.adobe.xmp" name="xmpcore" version="5.1.2">
|
||||
<artifact name="xmpcore-5.1.2.jar">
|
||||
<sha256 value="0adcd63003aaff0a87b938f6accc2d890a2169c751a9b36881237f8546287090" origin="Generated by Gradle"/>
|
||||
|
@ -6276,6 +6287,14 @@
|
|||
<sha256 value="42698696ebd5af1eb33f917e582baa416e289a21cd83ee329c255852216b8a78" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.datatransport" name="transport-backend-cct" version="3.1.9">
|
||||
<artifact name="transport-backend-cct-3.1.9.aar">
|
||||
<sha256 value="07a32025a65b08ee7e11d14dc539a758b66713f0c1d13900a81599ceadbaf44d" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="transport-backend-cct-3.1.9.pom">
|
||||
<sha256 value="3ce9eb56f52c15e96683030fffc8db553bc41d1e999e207cb904cbec45d4fd49" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.datatransport" name="transport-runtime" version="3.1.8">
|
||||
<artifact name="transport-runtime-3.1.8.aar">
|
||||
<sha256 value="cb9353ef1791ae17097d878ca711e25a9c32cec9042adc49b00cadfee1a7290b" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6284,6 +6303,14 @@
|
|||
<sha256 value="d6ff762251fb35594afe5efe860b5871064e18c0bd1bdb77084e3573f90e4e8f" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.datatransport" name="transport-runtime" version="3.1.9">
|
||||
<artifact name="transport-runtime-3.1.9.aar">
|
||||
<sha256 value="41745c5b8f427d24439015b84f651ad420718991867d2afc262c264009b802c1" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="transport-runtime-3.1.9.pom">
|
||||
<sha256 value="86f452b74551062623fad0b0bb6bc4dc2a6ba9f44a99834d0e50fb047051357b" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.flexbox" name="flexbox" version="3.0.0">
|
||||
<artifact name="flexbox-3.0.0.aar">
|
||||
<sha256 value="5e19500486fd7c8e2e8c7aad6bbba9c8d0ada7057c6b32b9b5c61439814e7574" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6300,6 +6327,14 @@
|
|||
<sha256 value="ec5c1be82d425fcaa6da54c6202bc25bc63fd61519d36c3ee813ffae7d203f25" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-base" version="18.5.0">
|
||||
<artifact name="play-services-base-18.5.0.aar">
|
||||
<sha256 value="59a5c0c2da12311d75d965ce1f419498536b1a167fb28ff7dfc2dfd9cefa4157" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="play-services-base-18.5.0.pom">
|
||||
<sha256 value="2570b515c2717af386c890e97f644782e3f86da7b677a4ff1036147e7ea622a4" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-basement" version="18.1.0">
|
||||
<artifact name="play-services-basement-18.1.0.aar">
|
||||
<sha256 value="03ba15f386cf260bde72fc4010fb89a820c47d51ce63bc09297eabe6cce09bdd" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6308,6 +6343,22 @@
|
|||
<sha256 value="c633e42daf94df10b7e1d75cd6efb8247c924b8a35c385f5cd1f3cbaeee1bf7d" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-basement" version="18.3.0">
|
||||
<artifact name="play-services-basement-18.3.0.aar">
|
||||
<sha256 value="6c11ae3eb2dd7f17373f919c4c557a70e4cf891bc0c9b66926a0a6445d654352" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="play-services-basement-18.3.0.pom">
|
||||
<sha256 value="9cef5dc9a6950ff09a85ff522b476f855eb7ef2373aa4c17339cb114ac5397e2" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-basement" version="18.4.0">
|
||||
<artifact name="play-services-basement-18.4.0.aar">
|
||||
<sha256 value="ce5c936fd66814b3602f5c6a5e929911ff973d4b05f6de9996da596bef97cad2" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="play-services-basement-18.4.0.pom">
|
||||
<sha256 value="05ca7c0ace0d6260931f97ed32c60ce598071ff560d3fa44f49e6f0695d2b687" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-cloud-messaging" version="17.0.1">
|
||||
<artifact name="play-services-cloud-messaging-17.0.1.aar">
|
||||
<sha256 value="1e759adcf0350731ce4dc73b035705e4c7d08bdf7db069cc0468eca3e7bb9dc2" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6324,6 +6375,14 @@
|
|||
<sha256 value="adec3fb60acc63f7a95927a69961936772f5ec2cceb0f8c235767d2d8940b3e4" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-cloud-messaging" version="17.2.0">
|
||||
<artifact name="play-services-cloud-messaging-17.2.0.aar">
|
||||
<sha256 value="27255e7fe9706483816b158db25cf319f6a26a0566feff41597ce8807a350e37" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="play-services-cloud-messaging-17.2.0.pom">
|
||||
<sha256 value="65f5833e621368dfb0eb203dcafcf070c5cece5a60ca18842ce7081d440e0419" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-stats" version="17.0.2">
|
||||
<artifact name="play-services-stats-17.0.2.aar">
|
||||
<sha256 value="dd4314a53f49a378ec146103d36232b96c75454d29526336ccbdf132941764d3" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6345,6 +6404,22 @@
|
|||
<sha256 value="e07cdb8e9e63f3e94596bcd8984c7379c47d9f289ecb9a5e35fcb9f2f573ba9f" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-tasks" version="18.1.0">
|
||||
<artifact name="play-services-tasks-18.1.0.aar">
|
||||
<sha256 value="d60575eae39350e6234858bc9d7d775375707ae82a684e6caf7f3e41a12e25a2" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="play-services-tasks-18.1.0.pom">
|
||||
<sha256 value="cf29ed846108d7a8f2c17d8ef5b63399735757c5a09bb663d7e784e02ad84bcd" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.gms" name="play-services-tasks" version="18.2.0">
|
||||
<artifact name="play-services-tasks-18.2.0.aar">
|
||||
<sha256 value="7f2aaa8f502068eaf54356ca92aec04271d6e7c416c52c45c0d23440fcbd1654" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="play-services-tasks-18.2.0.pom">
|
||||
<sha256 value="6b99c48a895d155e58abcee66cc22146db83abd5d84caf6c8f7a2aea9b1bcd21" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.android.material" name="material" version="1.10.0">
|
||||
<artifact name="material-1.10.0.aar">
|
||||
<sha256 value="2d204ee4f116b988a6a6b5db8cf43de3f8a74d0ae1ba17586f90aae38e3e1a2d" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6887,6 +6962,14 @@
|
|||
<sha256 value="d8e2223227f267d95f5580f746ca009342e466938964c515b8d66f5da0e493b6" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-common" version="21.0.0">
|
||||
<artifact name="firebase-common-21.0.0.aar">
|
||||
<sha256 value="379287d7171371512493681b398e78c341b333cf974ee81a18b1d56e7c2e385d" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="firebase-common-21.0.0.pom">
|
||||
<sha256 value="11c26461b6bff2549a7554fdaaa58c070550abf47255e9bda32dd238324cc73f" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-common-ktx" version="20.4.2">
|
||||
<artifact name="firebase-common-ktx-20.4.2.aar">
|
||||
<sha256 value="170b44690e480d1dde79a8d163586a1025ab5542ee0aac3874b76e7d1c27718f" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6895,6 +6978,14 @@
|
|||
<sha256 value="749101fe70375aefd4d87ea01255dc990d6477745ba752f18d31b960a2a3074b" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-common-ktx" version="21.0.0">
|
||||
<artifact name="firebase-common-ktx-21.0.0.aar">
|
||||
<sha256 value="25fc80c9bb9ecb1672908718c294afcc4ac1e47473677be060c795e04f120066" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="firebase-common-ktx-21.0.0.pom">
|
||||
<sha256 value="c27eccb48b9588116d6fd32f4657bc59df855002432293558dbb97e9878adeb8" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-components" version="17.1.0">
|
||||
<artifact name="firebase-components-17.1.0.aar">
|
||||
<sha256 value="352c71f89994cb4481daeb45ed3630bbf1789bdf1be4563988e2c18618af4f60" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6911,6 +7002,14 @@
|
|||
<sha256 value="e781684bd1d2132ab32ba29c419ba2174ff8983edeb4d93782178e8b6dc6f804" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-components" version="18.0.0">
|
||||
<artifact name="firebase-components-18.0.0.aar">
|
||||
<sha256 value="c7c48a3a80f44a499ebd6473bcfc7dd5a45ef523fabe2414a62515ff3c640972" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="firebase-components-18.0.0.pom">
|
||||
<sha256 value="6e6dd34d4512c7393e89ecdd8b829ebcdd31e6be2c931e7d1100a87d56880049" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-datatransport" version="18.1.7">
|
||||
<artifact name="firebase-datatransport-18.1.7.aar">
|
||||
<sha256 value="5f23d5750ae248dca2312c5963aa89f851be36132fb89f15114c3585e605ff08" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -6919,6 +7018,14 @@
|
|||
<sha256 value="c4a7ad00ca868d373e15c5eb7c88db618fec495241c69f80feb3447d2f56e50c" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-datatransport" version="18.2.0">
|
||||
<artifact name="firebase-datatransport-18.2.0.aar">
|
||||
<sha256 value="b2b28f6ba173f5e0c4fe3d36a2d7ee5239c7acbf4143b549ecf031a3485b35bb" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="firebase-datatransport-18.2.0.pom">
|
||||
<sha256 value="b8be11825ba56c04de8374094840b56383df24634931802668d70268d0c7bbe8" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-encoders" version="17.0.0">
|
||||
<artifact name="firebase-encoders-17.0.0.jar">
|
||||
<sha256 value="282a5a703f9b7eb56508dde97ea918e95d73318b157050f457f7a86dca750150" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
|
@ -7007,6 +7114,14 @@
|
|||
<sha256 value="188ee169e2d73488e9b14c7610bf3fd9a834658c0759af51b16b0b255865f7c6" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.firebase" name="firebase-messaging" version="24.0.0">
|
||||
<artifact name="firebase-messaging-24.0.0.aar">
|
||||
<sha256 value="6f22a7905a2d304d28724b0bacaf6717813693ffb7fcdb9cbfd9417881539c35" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
<artifact name="firebase-messaging-24.0.0.pom">
|
||||
<sha256 value="ae232cb0e20e90ecf2153f3bd213dd9cec915e7e2a721d6e51b032b1b9a27ca8" origin="Generated by Gradle" reason="Artifact is not signed"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.flatbuffers" name="flatbuffers-java" version="1.12.0">
|
||||
<artifact name="flatbuffers-java-1.12.0.jar">
|
||||
<sha256 value="3f8c088b4dd04a9858721f2e162508c94db0dd86f961e306ee63ef2eda871bf7" origin="Generated by Gradle"/>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
DO NOT TOUCH; GENERATED BY DRONE
|
||||
<span class="mdl-layout-title">Lint Report: 3 errors and 68 warnings</span>
|
||||
<span class="mdl-layout-title">Lint Report: 3 errors and 64 warnings</span>
|
||||
|
|
Loading…
Reference in a new issue