forked from nextcloud/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nextcloud#13408 from nextcloud/feature/offline-cre…
…ate-folder-operation Feature - Create Folder When Device Don't Have Internet Connection
- Loading branch information
Showing
116 changed files
with
3,355 additions
and
488 deletions.
There are no files selected for viewing
1,301 changes: 1,301 additions & 0 deletions
1,301
app/schemas/com.nextcloud.client.database.NextcloudDatabase/84.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/nextcloud/client/database/dao/OfflineOperationDao.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Nextcloud - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
package com.nextcloud.client.database.dao | ||
|
||
import androidx.room.Dao | ||
import androidx.room.Delete | ||
import androidx.room.Insert | ||
import androidx.room.Query | ||
import androidx.room.Update | ||
import com.nextcloud.client.database.entity.OfflineOperationEntity | ||
|
||
@Dao | ||
interface OfflineOperationDao { | ||
@Query("SELECT * FROM offline_operations") | ||
fun getAll(): List<OfflineOperationEntity> | ||
|
||
@Insert | ||
fun insert(vararg entity: OfflineOperationEntity) | ||
|
||
@Update | ||
fun update(entity: OfflineOperationEntity) | ||
|
||
@Delete | ||
fun delete(entity: OfflineOperationEntity) | ||
|
||
@Query("DELETE FROM offline_operations WHERE offline_operations_path = :path") | ||
fun deleteByPath(path: String) | ||
|
||
@Query("SELECT * FROM offline_operations WHERE offline_operations_path = :path LIMIT 1") | ||
fun getByPath(path: String): OfflineOperationEntity? | ||
|
||
@Query("SELECT * FROM offline_operations WHERE offline_operations_parent_oc_file_id = :parentOCFileId") | ||
fun getSubDirectoriesByParentOCFileId(parentOCFileId: Long): List<OfflineOperationEntity> | ||
} |
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/nextcloud/client/database/entity/OfflineOperationEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Nextcloud - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
package com.nextcloud.client.database.entity | ||
|
||
import androidx.room.ColumnInfo | ||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
import com.nextcloud.model.OfflineOperationType | ||
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta | ||
|
||
@Entity(tableName = ProviderTableMeta.OFFLINE_OPERATION_TABLE_NAME) | ||
data class OfflineOperationEntity( | ||
@PrimaryKey(autoGenerate = true) | ||
@ColumnInfo(name = ProviderTableMeta._ID) | ||
val id: Int? = null, | ||
|
||
@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_PARENT_OC_FILE_ID) | ||
var parentOCFileId: Long? = null, | ||
|
||
@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_PARENT_PATH) | ||
var parentPath: String? = null, | ||
|
||
@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_TYPE) | ||
var type: OfflineOperationType? = null, | ||
|
||
@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_PATH) | ||
var path: String? = null, | ||
|
||
@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_FILE_NAME) | ||
var filename: String? = null, | ||
|
||
@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_CREATED_AT) | ||
var createdAt: Long? = null | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.