Merge pull request #5531 from nextcloud/fix/AS36

Update to Android Studio 3.6
This commit is contained in:
Tobias Kaminsky 2020-03-05 09:58:46 +01:00 committed by GitHub
commit 2061207e25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 1536 additions and 337 deletions

View File

@ -29,9 +29,6 @@
</option>
<option name="RIGHT_MARGIN" value="120" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<AndroidXmlCodeStyleSettings>
<option name="ARRANGEMENT_SETTINGS_MIGRATED_TO_191" value="true" />
</AndroidXmlCodeStyleSettings>
<JavaCodeStyleSettings>
<option name="IMPORT_LAYOUT_TABLE">
<value>
@ -81,6 +78,9 @@
<option name="FOR_BRACE_FORCE" value="3" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="Markdown">
<option name="RIGHT_MARGIN" value="120" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />

View File

@ -20,7 +20,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:3.6.1'
classpath('com.dicedmelon.gradle:jacoco-android:0.1.4') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
@ -333,9 +333,6 @@ dependencies {
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
compileOnly "org.projectlombok:lombok:1.18.12"
annotationProcessor "org.projectlombok:lombok:1.18.12"
ktlint "com.pinterest:ktlint:0.36.0"
implementation 'org.conscrypt:conscrypt-android:2.2.1'

View File

@ -1 +1 @@
382
381

View File

@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 76 warnings</span>
<span class="mdl-layout-title">Lint Report: 92 warnings</span>

View File

@ -27,14 +27,10 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import lombok.Getter;
public class PlainHeader implements Serializable {
private static final long serialVersionUID = 3284979177401282512L;
@Getter
private String name;
@Getter
private String value;
PlainHeader(String name, String value) {
@ -51,4 +47,12 @@ public class PlainHeader implements Serializable {
name = (String) in.readObject();
value = (String) in.readObject();
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
}

View File

@ -30,10 +30,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
public class Response {
@Getter
private InputStream body;
private Header[] headers;
@ -62,4 +59,8 @@ public class Response {
Gson gson = new Gson();
return gson.toJson(arrayList);
}
public InputStream getBody() {
return this.body;
}
}

View File

@ -19,25 +19,9 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.owncloud.android.datamodel;
import lombok.Getter;
package com.owncloud.android.datamodel
/**
* Data set for {@link ArbitraryDataProvider}
* Data set for [ArbitraryDataProvider]
*/
@Getter
class ArbitraryDataSet {
private int id;
private String cloudId;
private String key;
private String value;
ArbitraryDataSet(int id, String cloudId, String key, String value) {
this.id = id;
this.cloudId = cloudId;
this.key = key;
this.value = value;
}
}
internal class ArbitraryDataSet(val id: Int, val cloudId: String, val key: String, val value: String)

View File

@ -24,16 +24,9 @@ package com.owncloud.android.datamodel;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
/**
* Decrypted class representation of metadata json of folder metadata.
*/
@Getter
@Setter
@AllArgsConstructor
public class DecryptedFolderMetadata {
private Metadata metadata;
private Map<String, DecryptedFile> files;
@ -43,8 +36,27 @@ public class DecryptedFolderMetadata {
this.files = new HashMap<>();
}
@Getter
@Setter
public DecryptedFolderMetadata(Metadata metadata, Map<String, DecryptedFile> files) {
this.metadata = metadata;
this.files = files;
}
public Metadata getMetadata() {
return this.metadata;
}
public Map<String, DecryptedFile> getFiles() {
return this.files;
}
public void setMetadata(Metadata metadata) {
this.metadata = metadata;
}
public void setFiles(Map<String, DecryptedFile> files) {
this.files = files;
}
public static class Metadata {
private Map<Integer, String> metadataKeys; // each keys is encrypted on its own, decrypt on use
private Sharing sharing;
@ -54,36 +66,140 @@ public class DecryptedFolderMetadata {
public String toString() {
return String.valueOf(version);
}
public Map<Integer, String> getMetadataKeys() {
return this.metadataKeys;
}
public Sharing getSharing() {
return this.sharing;
}
public int getVersion() {
return this.version;
}
public void setMetadataKeys(Map<Integer, String> metadataKeys) {
this.metadataKeys = metadataKeys;
}
public void setSharing(Sharing sharing) {
this.sharing = sharing;
}
public void setVersion(int version) {
this.version = version;
}
}
@Getter
@Setter
public static class Encrypted {
private Map<Integer, String> metadataKeys;
public Map<Integer, String> getMetadataKeys() {
return this.metadataKeys;
}
public void setMetadataKeys(Map<Integer, String> metadataKeys) {
this.metadataKeys = metadataKeys;
}
}
@Getter
@Setter
public static class Sharing {
private Map<String, String> recipient;
private String signature;
public Map<String, String> getRecipient() {
return this.recipient;
}
public String getSignature() {
return this.signature;
}
public void setRecipient(Map<String, String> recipient) {
this.recipient = recipient;
}
public void setSignature(String signature) {
this.signature = signature;
}
}
@Getter
@Setter
public static class DecryptedFile {
private Data encrypted;
private String initializationVector;
private String authenticationTag;
private int metadataKey;
public Data getEncrypted() {
return this.encrypted;
}
public String getInitializationVector() {
return this.initializationVector;
}
public String getAuthenticationTag() {
return this.authenticationTag;
}
public int getMetadataKey() {
return this.metadataKey;
}
public void setEncrypted(Data encrypted) {
this.encrypted = encrypted;
}
public void setInitializationVector(String initializationVector) {
this.initializationVector = initializationVector;
}
public void setAuthenticationTag(String authenticationTag) {
this.authenticationTag = authenticationTag;
}
public void setMetadataKey(int metadataKey) {
this.metadataKey = metadataKey;
}
}
@Getter
@Setter
public static class Data {
private String key;
private String filename;
private String mimetype;
private int version;
public String getKey() {
return this.key;
}
public String getFilename() {
return this.filename;
}
public String getMimetype() {
return this.mimetype;
}
public int getVersion() {
return this.version;
}
public void setKey(String key) {
this.key = key;
}
public void setFilename(String filename) {
this.filename = filename;
}
public void setMimetype(String mimetype) {
this.mimetype = mimetype;
}
public void setVersion(int version) {
this.version = version;
}
}
}

View File

@ -24,16 +24,7 @@ import com.google.gson.annotations.SerializedName;
import org.parceler.Parcel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Parcel
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
/*
* Push data from server, https://github.com/nextcloud/notifications/blob/master/docs/push-v2.md#encrypted-subject-data
*/
@ -46,4 +37,73 @@ public class DecryptedPushMessage {
public boolean delete;
@SerializedName("delete-all")
public boolean deleteAll;
public DecryptedPushMessage(String app, String type, String subject, String id, int nid, boolean delete, boolean deleteAll) {
this.app = app;
this.type = type;
this.subject = subject;
this.id = id;
this.nid = nid;
this.delete = delete;
this.deleteAll = deleteAll;
}
public DecryptedPushMessage() {
}
public String getApp() {
return this.app;
}
public String getType() {
return this.type;
}
public String getSubject() {
return this.subject;
}
public String getId() {
return this.id;
}
public int getNid() {
return this.nid;
}
public boolean isDelete() {
return this.delete;
}
public boolean isDeleteAll() {
return this.deleteAll;
}
public void setApp(String app) {
this.app = app;
}
public void setType(String type) {
this.type = type;
}
public void setSubject(String subject) {
this.subject = subject;
}
public void setId(String id) {
this.id = id;
}
public void setNid(int nid) {
this.nid = nid;
}
public void setDelete(boolean delete) {
this.delete = delete;
}
public void setDeleteAll(boolean deleteAll) {
this.deleteAll = deleteAll;
}
}

View File

@ -23,26 +23,70 @@ package com.owncloud.android.datamodel;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
/**
* Encrypted class representation of metadata json of folder metadata
*/
@Getter
@Setter
@AllArgsConstructor
public class EncryptedFolderMetadata {
private DecryptedFolderMetadata.Metadata metadata;
private Map<String, EncryptedFile> files;
@Getter
@Setter
public EncryptedFolderMetadata(DecryptedFolderMetadata.Metadata metadata, Map<String, EncryptedFile> files) {
this.metadata = metadata;
this.files = files;
}
public DecryptedFolderMetadata.Metadata getMetadata() {
return this.metadata;
}
public Map<String, EncryptedFile> getFiles() {
return this.files;
}
public void setMetadata(DecryptedFolderMetadata.Metadata metadata) {
this.metadata = metadata;
}
public void setFiles(Map<String, EncryptedFile> files) {
this.files = files;
}
public static class EncryptedFile {
private String encrypted;
private String initializationVector;
private String authenticationTag;
private int metadataKey;
public String getEncrypted() {
return this.encrypted;
}
public String getInitializationVector() {
return this.initializationVector;
}
public String getAuthenticationTag() {
return this.authenticationTag;
}
public int getMetadataKey() {
return this.metadataKey;
}
public void setEncrypted(String encrypted) {
this.encrypted = encrypted;
}
public void setInitializationVector(String initializationVector) {
this.initializationVector = initializationVector;
}
public void setAuthenticationTag(String authenticationTag) {
this.authenticationTag = authenticationTag;
}
public void setMetadataKey(int metadataKey) {
this.metadataKey = metadataKey;
}
}
}

View File

@ -67,11 +67,8 @@ import java.util.Set;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import lombok.Getter;
import lombok.Setter;
@Getter
public class FileDataStorageManager {
private static final String TAG = FileDataStorageManager.class.getSimpleName();
@ -85,7 +82,7 @@ public class FileDataStorageManager {
private ContentResolver contentResolver;
private ContentProviderClient contentProviderClient;
@Setter private Account account;
private Account account;
public FileDataStorageManager(Account account, ContentResolver cr) {
contentProviderClient = null;
@ -2294,4 +2291,20 @@ public class FileDataStorageManager {
private CapabilityBooleanType getBoolean(Cursor cursor, String columnName) {
return CapabilityBooleanType.fromValue(cursor.getInt(cursor.getColumnIndex(columnName)));
}
public ContentResolver getContentResolver() {
return this.contentResolver;
}
public ContentProviderClient getContentProviderClient() {
return this.contentProviderClient;
}
public Account getAccount() {
return this.account;
}
public void setAccount(Account account) {
this.account = account;
}
}

View File

@ -23,18 +23,10 @@
package com.owncloud.android.datamodel;
import androidx.annotation.Nullable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* Model for filesystem data from the database.
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class FileSystemDataSet {
private int id;
private String localPath;
@ -44,4 +36,83 @@ public class FileSystemDataSet {
private long foundAt;
private long syncedFolderId;
@Nullable private String crc32;
public FileSystemDataSet(int id, String localPath, long modifiedAt, boolean folder, boolean sentForUpload, long foundAt, long syncedFolderId, String crc32) {
this.id = id;
this.localPath = localPath;
this.modifiedAt = modifiedAt;
this.folder = folder;
this.sentForUpload = sentForUpload;
this.foundAt = foundAt;
this.syncedFolderId = syncedFolderId;
this.crc32 = crc32;
}
public FileSystemDataSet() {
}
public int getId() {
return this.id;
}
public String getLocalPath() {
return this.localPath;
}
public long getModifiedAt() {
return this.modifiedAt;
}
public boolean isFolder() {
return this.folder;
}
public boolean isSentForUpload() {
return this.sentForUpload;
}
public long getFoundAt() {
return this.foundAt;
}
public long getSyncedFolderId() {
return this.syncedFolderId;
}
@Nullable
public String getCrc32() {
return this.crc32;
}
public void setId(int id) {
this.id = id;
}
public void setLocalPath(String localPath) {
this.localPath = localPath;
}
public void setModifiedAt(long modifiedAt) {
this.modifiedAt = modifiedAt;
}
public void setFolder(boolean folder) {
this.folder = folder;
}
public void setSentForUpload(boolean sentForUpload) {
this.sentForUpload = sentForUpload;
}
public void setFoundAt(long foundAt) {
this.foundAt = foundAt;
}
public void setSyncedFolderId(long syncedFolderId) {
this.syncedFolderId = syncedFolderId;
}
public void setCrc32(@Nullable String crc32) {
this.crc32 = crc32;
}
}

View File

@ -21,8 +21,6 @@ package com.owncloud.android.datamodel;
import android.util.SparseArray;
import lombok.Getter;
/**
* Types of media folder.
*/
@ -31,7 +29,7 @@ public enum MediaFolderType {
IMAGE(1),
VIDEO(2);
@Getter private Integer id;
private Integer id;
private static SparseArray<MediaFolderType> reverseMap = new SparseArray<>(3);
@ -48,4 +46,8 @@ public enum MediaFolderType {
public static MediaFolderType getById(Integer id) {
return reverseMap.get(id);
}
public Integer getId() {
return this.id;
}
}

View File

@ -24,15 +24,31 @@ package com.owncloud.android.datamodel;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter @Setter
@NoArgsConstructor
@AllArgsConstructor
public class MediaFoldersModel {
private List<String> imageMediaFolders;
private List<String> videoMediaFolders;
public MediaFoldersModel(List<String> imageMediaFolders, List<String> videoMediaFolders) {
this.imageMediaFolders = imageMediaFolders;
this.videoMediaFolders = videoMediaFolders;
}
public MediaFoldersModel() {
}
public List<String> getImageMediaFolders() {
return this.imageMediaFolders;
}
public List<String> getVideoMediaFolders() {
return this.videoMediaFolders;
}
public void setImageMediaFolders(List<String> imageMediaFolders) {
this.imageMediaFolders = imageMediaFolders;
}
public void setVideoMediaFolders(List<String> videoMediaFolders) {
this.videoMediaFolders = videoMediaFolders;
}
}

View File

@ -43,8 +43,6 @@ import java.util.List;
import androidx.annotation.NonNull;
import androidx.core.content.FileProvider;
import lombok.Getter;
import lombok.Setter;
import third_parties.daveKoeller.AlphanumComparator;
public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterface {
@ -57,41 +55,41 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
private static final String TAG = OCFile.class.getSimpleName();
@Getter @Setter private long fileId; // android internal ID of the file
@Getter @Setter private long parentId;
@Getter @Setter private long fileLength;
@Getter @Setter private long creationTimestamp; // UNIX timestamp of the time the file was created
@Getter @Setter private long modificationTimestamp; // UNIX timestamp of the file modification time
private long fileId; // android internal ID of the file
private long parentId;
private long fileLength;
private long creationTimestamp; // UNIX timestamp of the time the file was created
private long modificationTimestamp; // UNIX timestamp of the file modification time
/** UNIX timestamp of the modification time, corresponding to the value returned by the server
* in the last synchronization of THE CONTENTS of this file.
*/
@Getter @Setter private long modificationTimestampAtLastSyncForData;
@Setter private String remotePath;
private long modificationTimestampAtLastSyncForData;
private String remotePath;
private String localPath;
@Getter @Setter private String mimeType;
@Getter private boolean needsUpdatingWhileSaving;
@Getter @Setter private long lastSyncDateForProperties;
@Getter @Setter private long lastSyncDateForData;
@Getter @Setter private boolean previewAvailable;
@Getter private String etag;
@Getter private String etagOnServer;
@Getter @Setter private boolean sharedViaLink;
@Getter @Setter private String publicLink;
@Getter @Setter private String permissions;
@Getter @Setter private String remoteId; // The fileid namespaced by the instance fileId, globally unique
@Getter @Setter private boolean updateThumbnailNeeded;
@Getter @Setter private boolean downloading;
@Getter @Setter private String etagInConflict; // Only saves file etag in the server, when there is a conflict
@Getter @Setter private boolean sharedWithSharee;
@Getter @Setter private boolean favorite;
@Getter @Setter private boolean encrypted;
@Getter @Setter private WebdavEntry.MountType mountType;
@Getter @Setter private int unreadCommentsCount;
@Getter @Setter private String ownerId;
@Getter @Setter private String ownerDisplayName;
@Getter @Setter String note;
@Getter @Setter private List<ShareeUser> sharees;
@Getter @Setter private String richWorkspace;
private String mimeType;
private boolean needsUpdatingWhileSaving;
private long lastSyncDateForProperties;
private long lastSyncDateForData;
private boolean previewAvailable;
private String etag;
private String etagOnServer;
private boolean sharedViaLink;
private String publicLink;
private String permissions;
private String remoteId; // The fileid namespaced by the instance fileId, globally unique
private boolean updateThumbnailNeeded;
private boolean downloading;
private String etagInConflict; // Only saves file etag in the server, when there is a conflict
private boolean sharedWithSharee;
private boolean favorite;
private boolean encrypted;
private WebdavEntry.MountType mountType;
private int unreadCommentsCount;
private String ownerId;
private String ownerDisplayName;
String note;
private List<ShareeUser> sharees;
private String richWorkspace;
/**
* URI to the local path of the file contents, if stored in the device; cached after first call
@ -106,7 +104,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
* Cached after first call, until changed.
*/
private Uri exposedFileUri;
@Getter @Setter private String encryptedFileName;
private String encryptedFileName;
/**
@ -534,4 +532,244 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
return new OCFile[size];
}
};
public long getFileId() {
return this.fileId;
}
public long getParentId() {
return this.parentId;
}
public long getFileLength() {
return this.fileLength;
}
public long getCreationTimestamp() {
return this.creationTimestamp;
}
public long getModificationTimestamp() {
return this.modificationTimestamp;
}
public long getModificationTimestampAtLastSyncForData() {
return this.modificationTimestampAtLastSyncForData;
}
public String getMimeType() {
return this.mimeType;
}
public boolean isNeedsUpdatingWhileSaving() {
return this.needsUpdatingWhileSaving;
}
public long getLastSyncDateForProperties() {
return this.lastSyncDateForProperties;
}
public long getLastSyncDateForData() {
return this.lastSyncDateForData;
}
public boolean isPreviewAvailable() {
return this.previewAvailable;
}
public String getEtag() {
return this.etag;
}
public String getEtagOnServer() {
return this.etagOnServer;
}
public boolean isSharedViaLink() {
return this.sharedViaLink;
}
public String getPublicLink() {
return this.publicLink;
}
public String getPermissions() {
return this.permissions;
}
public String getRemoteId() {
return this.remoteId;
}
public boolean isUpdateThumbnailNeeded() {
return this.updateThumbnailNeeded;
}
public boolean isDownloading() {
return this.downloading;
}
public String getEtagInConflict() {
return this.etagInConflict;
}
public boolean isSharedWithSharee() {
return this.sharedWithSharee;
}
public boolean isFavorite() {
return this.favorite;
}
public boolean isEncrypted() {
return this.encrypted;
}
public WebdavEntry.MountType getMountType() {
return this.mountType;
}
public int getUnreadCommentsCount() {
return this.unreadCommentsCount;
}
public String getOwnerId() {
return this.ownerId;
}
public String getOwnerDisplayName() {
return this.ownerDisplayName;
}
public String getNote() {
return this.note;
}
public List<ShareeUser> getSharees() {
return this.sharees;
}
public String getRichWorkspace() {
return this.richWorkspace;
}
public String getEncryptedFileName() {
return this.encryptedFileName;
}
public void setFileId(long fileId) {
this.fileId = fileId;
}
public void setParentId(long parentId) {
this.parentId = parentId;
}
public void setFileLength(long fileLength) {
this.fileLength = fileLength;
}
public void setCreationTimestamp(long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
}
public void setModificationTimestamp(long modificationTimestamp) {
this.modificationTimestamp = modificationTimestamp;
}
public void setModificationTimestampAtLastSyncForData(long modificationTimestampAtLastSyncForData) {
this.modificationTimestampAtLastSyncForData = modificationTimestampAtLastSyncForData;
}
public void setRemotePath(String remotePath) {
this.remotePath = remotePath;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
public void setLastSyncDateForProperties(long lastSyncDateForProperties) {
this.lastSyncDateForProperties = lastSyncDateForProperties;
}
public void setLastSyncDateForData(long lastSyncDateForData) {
this.lastSyncDateForData = lastSyncDateForData;
}
public void setPreviewAvailable(boolean previewAvailable) {
this.previewAvailable = previewAvailable;
}
public void setSharedViaLink(boolean sharedViaLink) {
this.sharedViaLink = sharedViaLink;
}
public void setPublicLink(String publicLink) {
this.publicLink = publicLink;
}
public void setPermissions(String permissions) {
this.permissions = permissions;
}
public void setRemoteId(String remoteId) {
this.remoteId = remoteId;
}
public void setUpdateThumbnailNeeded(boolean updateThumbnailNeeded) {
this.updateThumbnailNeeded = updateThumbnailNeeded;
}
public void setDownloading(boolean downloading) {
this.downloading = downloading;
}
public void setEtagInConflict(String etagInConflict) {
this.etagInConflict = etagInConflict;
}
public void setSharedWithSharee(boolean sharedWithSharee) {
this.sharedWithSharee = sharedWithSharee;
}
public void setFavorite(boolean favorite) {
this.favorite = favorite;
}
public void setEncrypted(boolean encrypted) {
this.encrypted = encrypted;
}
public void setMountType(WebdavEntry.MountType mountType) {
this.mountType = mountType;
}
public void setUnreadCommentsCount(int unreadCommentsCount) {
this.unreadCommentsCount = unreadCommentsCount;
}
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
public void setOwnerDisplayName(String ownerDisplayName) {
this.ownerDisplayName = ownerDisplayName;
}
public void setNote(String note) {
this.note = note;
}
public void setSharees(List<ShareeUser> sharees) {
this.sharees = sharees;
}
public void setRichWorkspace(String richWorkspace) {
this.richWorkspace = richWorkspace;
}
public void setEncryptedFileName(String encryptedFileName) {
this.encryptedFileName = encryptedFileName;
}
}

View File

@ -22,19 +22,61 @@
package com.owncloud.android.datamodel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class PushConfigurationState {
public String pushToken;
public String deviceIdentifier;
public String deviceIdentifierSignature;
public String userPublicKey;
public boolean shouldBeDeleted;
public PushConfigurationState(String pushToken, String deviceIdentifier, String deviceIdentifierSignature, String userPublicKey, boolean shouldBeDeleted) {
this.pushToken = pushToken;
this.deviceIdentifier = deviceIdentifier;
this.deviceIdentifierSignature = deviceIdentifierSignature;
this.userPublicKey = userPublicKey;
this.shouldBeDeleted = shouldBeDeleted;
}
public PushConfigurationState() {
}
public String getPushToken() {
return this.pushToken;
}
public String getDeviceIdentifier() {
return this.deviceIdentifier;
}
public String getDeviceIdentifierSignature() {
return this.deviceIdentifierSignature;
}
public String getUserPublicKey() {
return this.userPublicKey;
}
public boolean isShouldBeDeleted() {
return this.shouldBeDeleted;
}
public void setPushToken(String pushToken) {
this.pushToken = pushToken;
}
public void setDeviceIdentifier(String deviceIdentifier) {
this.deviceIdentifier = deviceIdentifier;
}
public void setDeviceIdentifierSignature(String deviceIdentifierSignature) {
this.deviceIdentifierSignature = deviceIdentifierSignature;
}
public void setUserPublicKey(String userPublicKey) {
this.userPublicKey = userPublicKey;
}
public void setShouldBeDeleted(boolean shouldBeDeleted) {
this.shouldBeDeleted = shouldBeDeleted;
}
}

View File

@ -23,17 +23,32 @@ import android.accounts.Account;
import org.parceler.Parcel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Parcel
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SignatureVerification {
public boolean signatureValid;
public Account account;
public SignatureVerification(boolean signatureValid, Account account) {
this.signatureValid = signatureValid;
this.account = account;
}
public SignatureVerification() {
}
public boolean isSignatureValid() {
return this.signatureValid;
}
public Account getAccount() {
return this.account;
}
public void setSignatureValid(boolean signatureValid) {
this.signatureValid = signatureValid;
}
public void setAccount(Account account) {
this.account = account;
}
}

View File

@ -23,9 +23,6 @@ package com.owncloud.android.datamodel;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;
/**
* Synced folder entity containing all information per synced folder.
*/
@ -34,19 +31,19 @@ public class SyncedFolder implements Serializable, Cloneable {
public static final long EMPTY_ENABLED_TIMESTAMP_MS = -1;
private static final long serialVersionUID = -793476118299906429L;
@Getter @Setter private long id;
@Getter @Setter private String localPath;
@Getter @Setter private String remotePath;
@Getter @Setter private boolean wifiOnly;
@Getter @Setter private boolean chargingOnly;
@Getter @Setter private boolean existing;
@Getter @Setter private boolean subfolderByDate;
@Getter @Setter private String account;
@Getter @Setter private int uploadAction;
@Getter private boolean enabled;
@Getter private long enabledTimestampMs;
@Getter @Setter private MediaFolderType type;
@Getter @Setter private boolean hidden;
private long id;
private String localPath;
private String remotePath;
private boolean wifiOnly;
private boolean chargingOnly;
private boolean existing;
private boolean subfolderByDate;
private String account;
private int uploadAction;
private boolean enabled;
private long enabledTimestampMs;
private MediaFolderType type;
private boolean hidden;
/**
* constructor for new, to be persisted entity.
@ -127,4 +124,100 @@ public class SyncedFolder implements Serializable, Cloneable {
return null;
}
}
public long getId() {
return this.id;
}
public String getLocalPath() {
return this.localPath;
}
public String getRemotePath() {
return this.remotePath;
}
public boolean isWifiOnly() {
return this.wifiOnly;
}
public boolean isChargingOnly() {
return this.chargingOnly;
}
public boolean isExisting() {
return this.existing;
}
public boolean isSubfolderByDate() {
return this.subfolderByDate;
}
public String getAccount() {
return this.account;
}
public int getUploadAction() {
return this.uploadAction;
}
public boolean isEnabled() {
return this.enabled;
}
public long getEnabledTimestampMs() {
return this.enabledTimestampMs;
}
public MediaFolderType getType() {
return this.type;
}
public boolean isHidden() {
return this.hidden;
}
public void setId(long id) {
this.id = id;
}
public void setLocalPath(String localPath) {
this.localPath = localPath;
}
public void setRemotePath(String remotePath) {
this.remotePath = remotePath;
}
public void setWifiOnly(boolean wifiOnly) {
this.wifiOnly = wifiOnly;
}
public void setChargingOnly(boolean chargingOnly) {
this.chargingOnly = chargingOnly;
}
public void setExisting(boolean existing) {
this.existing = existing;
}
public void setSubfolderByDate(boolean subfolderByDate) {
this.subfolderByDate = subfolderByDate;
}
public void setAccount(String account) {
this.account = account;
}
public void setUploadAction(int uploadAction) {
this.uploadAction = uploadAction;
}
public void setType(MediaFolderType type) {
this.type = type;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
}

View File

@ -23,15 +23,10 @@ package com.owncloud.android.datamodel;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
/**
* Display item specialization for synced folder objects to be displayed in a list/grid view adding further
* information to be displayed in the UI but not part of the persisted underlying {@link SyncedFolder} object.
*/
@Getter
@Setter
public class SyncedFolderDisplayItem extends SyncedFolder {
private List<String> filePaths;
private String folderName;
@ -95,4 +90,28 @@ public class SyncedFolderDisplayItem extends SyncedFolder {
enabled, timestampMs, type, hidden);
this.folderName = folderName;
}
public List<String> getFilePaths() {
return this.filePaths;
}
public String getFolderName() {
return this.folderName;
}
public long getNumberOfFiles() {
return this.numberOfFiles;
}
public void setFilePaths(List<String> filePaths) {
this.filePaths = filePaths;
}
public void setFolderName(String folderName) {
this.folderName = folderName;
}
public void setNumberOfFiles(long numberOfFiles) {
this.numberOfFiles = numberOfFiles;
}
}

View File

@ -24,21 +24,63 @@ import org.parceler.Parcel;
import java.util.Locale;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* Template for creating a file from it via RichDocuments app
*/
@Parcel
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Template {
public Template(int id, String name, String thumbnailLink, Type type, String extension) {
this.id = id;
this.name = name;
this.thumbnailLink = thumbnailLink;
this.type = type;
this.extension = extension;
}
public Template() {
}
public int getId() {
return this.id;
}
public String getName() {
return this.name;
}
public String getThumbnailLink() {
return this.thumbnailLink;
}
public Type getType() {
return this.type;
}
public String getExtension() {
return this.extension;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setThumbnailLink(String thumbnailLink) {
this.thumbnailLink = thumbnailLink;
}
public void setType(Type type) {
this.type = type;
}
public void setExtension(String extension) {
this.extension = extension;
}
public enum Type {
DOCUMENT, SPREADSHEET, PRESENTATION, UNKNOWN
}

View File

@ -21,18 +21,52 @@
package com.owncloud.android.datastorage;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author Bartosz Przybylski
*/
@Getter @Setter
@NoArgsConstructor
@AllArgsConstructor
public class StoragePoint implements Comparable<StoragePoint> {
public StoragePoint(String description, String path, StorageType storageType, PrivacyType privacyType) {
this.description = description;
this.path = path;
this.storageType = storageType;
this.privacyType = privacyType;
}
public StoragePoint() {
}
public String getDescription() {
return this.description;
}
public String getPath() {
return this.path;
}
public StorageType getStorageType() {
return this.storageType;
}
public PrivacyType getPrivacyType() {
return this.privacyType;
}
public void setDescription(String description) {
this.description = description;
}
public void setPath(String path) {
this.path = path;
}
public void setStorageType(StorageType storageType) {
this.storageType = storageType;
}
public void setPrivacyType(PrivacyType privacyType) {
this.privacyType = privacyType;
}
public enum StorageType {
INTERNAL, EXTERNAL
}

View File

@ -38,9 +38,6 @@ import com.owncloud.android.utils.MimeTypeUtil;
import java.io.File;
import lombok.Getter;
import lombok.Setter;
/**
* Stores all information in order to start upload operations. PersistentUploadObject can
* be stored persistently by {@link UploadsStorageManager}.
@ -49,77 +46,77 @@ public class OCUpload implements Parcelable {
private static final String TAG = OCUpload.class.getSimpleName();
@Getter @Setter private long uploadId;
private long uploadId;
/**
* Absolute path in the local file system to the file to be uploaded.
*/
@Getter @Setter private String localPath;
private String localPath;
/**
* Absolute path in the remote account to set to the uploaded file (not for its parent folder!)
*/
@Getter @Setter private String remotePath;
private String remotePath;
/**
* Name of Owncloud account to upload file to.
*/
@Getter private String accountName;
private String accountName;
/**
* File size.
*/
@Getter @Setter private long fileSize;
private long fileSize;
/**
* Local action for upload. (0 - COPY, 1 - MOVE, 2 - FORGET)
*/
@Getter @Setter private int localAction;
private int localAction;
/**
* What to do in case of name collision.
*/
@Getter @Setter private FileUploader.NameCollisionPolicy nameCollisionPolicy;
private FileUploader.NameCollisionPolicy nameCollisionPolicy;
/**
* Create destination folder?
*/
@Getter @Setter private boolean createRemoteFolder;
private boolean createRemoteFolder;
/**
* Status of upload (later, in_progress, ...).
*/
@Getter private UploadStatus uploadStatus;
private UploadStatus uploadStatus;
/**
* Result from last upload operation. Can be null.
*/
@Getter private UploadResult lastResult;
private UploadResult lastResult;
/**
* Defines the origin of the upload; see constants CREATED_ in {@link UploadFileOperation}
*/
@Getter @Setter private int createdBy;
private int createdBy;
/**
* When the upload ended
*/
@Getter @Setter private long uploadEndTimestamp;
private long uploadEndTimestamp;
/**
* Upload only via wifi?
*/
@Getter @Setter private boolean useWifiOnly;
private boolean useWifiOnly;
/**
* Upload only if phone being charged?
*/
@Getter @Setter private boolean whileChargingOnly;
private boolean whileChargingOnly;
/**
* Token to unlock E2E folder
*/
@Getter @Setter private String folderUnlockToken;
private String folderUnlockToken;
/**
* temporary values, used for sorting
@ -323,5 +320,113 @@ public class OCUpload implements Parcelable {
dest.writeString(folderUnlockToken);
}
public long getUploadId() {
return this.uploadId;
}
public String getLocalPath() {
return this.localPath;
}
public String getRemotePath() {
return this.remotePath;
}
public String getAccountName() {
return this.accountName;
}
public long getFileSize() {
return this.fileSize;
}
public int getLocalAction() {
return this.localAction;
}
public FileUploader.NameCollisionPolicy getNameCollisionPolicy() {
return this.nameCollisionPolicy;
}
public boolean isCreateRemoteFolder() {
return this.createRemoteFolder;
}
public UploadStatus getUploadStatus() {
return this.uploadStatus;
}
public UploadResult getLastResult() {
return this.lastResult;
}
public int getCreatedBy() {
return this.createdBy;
}
public long getUploadEndTimestamp() {
return this.uploadEndTimestamp;
}
public boolean isUseWifiOnly() {
return this.useWifiOnly;
}
public boolean isWhileChargingOnly() {
return this.whileChargingOnly;
}
public String getFolderUnlockToken() {
return this.folderUnlockToken;
}
public void setUploadId(long uploadId) {
this.uploadId = uploadId;
}
public void setLocalPath(String localPath) {
this.localPath = localPath;
}
public void setRemotePath(String remotePath) {
this.remotePath = remotePath;
}
public void setFileSize(long fileSize) {
this.fileSize = fileSize;
}
public void setLocalAction(int localAction) {
this.localAction = localAction;
}
public void setNameCollisionPolicy(FileUploader.NameCollisionPolicy nameCollisionPolicy) {
this.nameCollisionPolicy = nameCollisionPolicy;
}
public void setCreateRemoteFolder(boolean createRemoteFolder) {
this.createRemoteFolder = createRemoteFolder;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public void setUploadEndTimestamp(long uploadEndTimestamp) {
this.uploadEndTimestamp = uploadEndTimestamp;
}
public void setUseWifiOnly(boolean useWifiOnly) {
this.useWifiOnly = useWifiOnly;
}
public void setWhileChargingOnly(boolean whileChargingOnly) {
this.whileChargingOnly = whileChargingOnly;
}
public void setFolderUnlockToken(String folderUnlockToken) {
this.folderUnlockToken = folderUnlockToken;
}
enum CanUploadFileNowStatus {NOW, LATER, FILE_GONE, ERROR}
}

View File

@ -27,17 +27,15 @@ import android.os.Parcelable;
import com.owncloud.android.R;
import lombok.Getter;
/**
* @author Bartosz Przybylski
* @author Tobias Kaminsky
*/
public class FeatureItem implements Parcelable {
private static final int DO_NOT_SHOW = -1;
@Getter private int image;
@Getter private int titleText;
@Getter private int contentText;
private int image;
private int titleText;
private int contentText;
private boolean contentCentered;
private boolean bulletList;
@ -102,4 +100,16 @@ public class FeatureItem implements Parcelable {
return new FeatureItem[size];
}
};
public int getImage() {
return this.image;
}
public int getTitleText() {
return this.titleText;
}
public int getContentText() {
return this.contentText;
}
}

View File

@ -34,19 +34,19 @@ import com.owncloud.android.operations.common.SyncOperation;
import java.util.ArrayList;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Creates a new public share for a given file
*/
@AllArgsConstructor
@Getter
public class CreateShareViaLinkOperation extends SyncOperation {
private String path;
private String password;
public CreateShareViaLinkOperation(String path, String password) {
this.path = path;
this.password = password;
}
@Override
protected RemoteOperationResult run(OwnCloudClient client) {
// Check if the share link already exists
@ -117,4 +117,12 @@ public class CreateShareViaLinkOperation extends SyncOperation {
getStorageManager().saveFile(file);
}
}
public String getPath() {
return this.path;
}
public String getPassword() {
return this.password;
}
}

View File

@ -34,14 +34,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import lombok.Getter;
/**
* Creates a new private share for a given file.
*/
public class CreateShareWithShareeOperation extends SyncOperation {
@Getter private String path;
private String path;
private String shareeName;
private ShareType shareType;
private int permissions;
@ -106,4 +104,8 @@ public class CreateShareWithShareeOperation extends SyncOperation {
getStorageManager().saveFile(file);
}
}
public String getPath() {
return this.path;
}
}

View File

@ -46,20 +46,18 @@ import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import lombok.Getter;
/**
* Remote DownloadOperation performing the download of a file to an ownCloud server
*/
public class DownloadFileOperation extends RemoteOperation {
private static final String TAG = DownloadFileOperation.class.getSimpleName();
@Getter private Account account;
@Getter private OCFile file;
@Getter private String behaviour;
@Getter private String etag = "";
@Getter private String activityName;
@Getter private String packageName;
private Account account;
private OCFile file;
private String behaviour;
private String etag = "";
private String activityName;
private String packageName;
private Context context;
private Set<OnDatatransferProgressListener> dataTransferListeners = new HashSet<>();
@ -228,4 +226,28 @@ public class DownloadFileOperation extends RemoteOperation {
dataTransferListeners.remove(listener);
}
}
public Account getAccount() {
return this.account;
}
public OCFile getFile() {
return this.file;
}
public String getBehaviour() {
return this.behaviour;
}
public String getEtag() {
return this.etag;
}
public String getActivityName() {
return this.activityName;
}
public String getPackageName() {
return this.packageName;
}
}

View File

@ -37,8 +37,6 @@ import com.owncloud.android.utils.MimeTypeUtil;
import java.io.File;
import java.io.IOException;
import lombok.Getter;
/**
* Remote operation performing the rename of a remote file (or folder?) in the ownCloud server.
@ -47,7 +45,7 @@ public class RenameFileOperation extends SyncOperation {
private static final String TAG = RenameFileOperation.class.getSimpleName();
@Getter private OCFile file;
private OCFile file;
private String remotePath;
private String newName;
@ -190,4 +188,8 @@ public class RenameFileOperation extends SyncOperation {
return result;
}
public OCFile getFile() {
return this.file;
}
}

View File

@ -32,9 +32,6 @@ import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.UpdateShareRemoteOperation;
import com.owncloud.android.operations.common.SyncOperation;
import lombok.Getter;
import lombok.Setter;
/**
* Updates an existing private share for a given file.
@ -42,10 +39,10 @@ import lombok.Setter;
public class UpdateSharePermissionsOperation extends SyncOperation {
private long shareId;
@Setter private int permissions;
@Setter private long expirationDateInMillis;
@Getter @Setter private String password;
@Getter private String path;
private int permissions;
private long expirationDateInMillis;
private String password;
private String path;
/**
* Constructor
@ -103,5 +100,25 @@ public class UpdateSharePermissionsOperation extends SyncOperation {
share.setPasswordProtected(!TextUtils.isEmpty(password));
getStorageManager().saveShare(share);
}
public String getPassword() {
return this.password;
}
public String getPath() {
return this.path;
}
public void setPermissions(int permissions) {
this.permissions = permissions;
}
public void setExpirationDateInMillis(long expirationDateInMillis) {
this.expirationDateInMillis = expirationDateInMillis;
}
public void setPassword(String password) {
this.password = password;
}
}

View File

@ -31,22 +31,19 @@ import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.resources.shares.UpdateShareRemoteOperation;
import com.owncloud.android.operations.common.SyncOperation;
import lombok.Getter;
import lombok.Setter;
/**
* Updates an existing public share for a given file
*/
public class UpdateShareViaLinkOperation extends SyncOperation {
@Getter private String path;
@Getter @Setter private String password;
private String path;
private String password;
/** Enable upload permissions to update in Share resource. */
@Setter private Boolean publicUploadOnFolder;
@Setter private Boolean publicUploadOnFile;
@Setter private Boolean hideFileDownload;
@Setter private long expirationDateInMillis;
private Boolean publicUploadOnFolder;
private Boolean publicUploadOnFile;
private Boolean hideFileDownload;
private long expirationDateInMillis;
/**
* Constructor
@ -108,4 +105,32 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
getStorageManager().saveFile(file);
}
}
public String getPath() {
return this.path;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public void setPublicUploadOnFolder(Boolean publicUploadOnFolder) {
this.publicUploadOnFolder = publicUploadOnFolder;
}
public void setPublicUploadOnFile(Boolean publicUploadOnFile) {
this.publicUploadOnFile = publicUploadOnFile;
}
public void setHideFileDownload(Boolean hideFileDownload) {
this.hideFileDownload = hideFileDownload;
}
public void setExpirationDateInMillis(long expirationDateInMillis) {
this.expirationDateInMillis = expirationDateInMillis;
}
}

View File

@ -29,8 +29,6 @@ import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import lombok.Getter;
/**
* Operation which execution involves both interactions with an ownCloud server and
@ -39,7 +37,7 @@ import lombok.Getter;
* Provides methods to execute the operation both synchronously or asynchronously.
*/
public abstract class SyncOperation extends RemoteOperation {
@Getter private FileDataStorageManager storageManager;
private FileDataStorageManager storageManager;
/**
* Synchronously executes the operation on the received ownCloud account.
@ -139,4 +137,8 @@ public abstract class SyncOperation extends RemoteOperation {
this.storageManager = storageManager;
return super.execute(client, listener, listenerHandler);
}
public FileDataStorageManager getStorageManager() {
return this.storageManager;
}
}

View File

@ -39,25 +39,21 @@ import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundExce
import java.io.IOException;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
/**
* Base synchronization adapter for ownCloud designed to be subclassed for different
* resource types, like FileSync, ConcatsSync, CalendarSync, etc..
*
*
* Implements the standard {@link AbstractThreadedSyncAdapter}.
*/
abstract class AbstractOwnCloudSyncAdapter extends
AbstractThreadedSyncAdapter {
@Getter @Setter private AccountManager accountManager;
@Getter @Setter private Account account;
@Getter @Setter private ContentProviderClient contentProviderClient;
@Getter @Setter private FileDataStorageManager storageManager;
private AccountManager accountManager;
private Account account;
private ContentProviderClient contentProviderClient;
private FileDataStorageManager storageManager;
@Getter(AccessLevel.PROTECTED) private OwnCloudClient client;
private OwnCloudClient client;
AbstractOwnCloudSyncAdapter(Context context, boolean autoInitialize) {
super(context, autoInitialize);
@ -76,4 +72,40 @@ abstract class AbstractOwnCloudSyncAdapter extends
client = OwnCloudClientManagerFactory.getDefaultSingleton().
getClientFor(ocAccount, getContext());
}
public AccountManager getAccountManager() {
return this.accountManager;
}
public Account getAccount() {
return this.account;
}
public ContentProviderClient getContentProviderClient() {
return this.contentProviderClient;
}
public FileDataStorageManager getStorageManager() {
return this.storageManager;
}
protected OwnCloudClient getClient() {
return this.client;
}
public void setAccountManager(AccountManager accountManager) {
this.accountManager = accountManager;
}
public void setAccount(Account account) {
this.account = account;
}
public void setContentProviderClient(ContentProviderClient contentProviderClient) {
this.contentProviderClient = contentProviderClient;
}
public void setStorageManager(FileDataStorageManager storageManager) {
this.storageManager = storageManager;
}
}

View File

@ -27,7 +27,6 @@
package com.owncloud.android.ui.activity;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;

View File

@ -48,11 +48,9 @@ import com.owncloud.android.utils.ThemeUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import lombok.Getter;
import lombok.Setter;
public abstract class EditorWebView extends ExternalSiteWebView {
@Getter @Setter protected Snackbar loadingSnackbar;
protected Snackbar loadingSnackbar;
protected String fileName;
protected String mimeType;
@ -210,6 +208,14 @@ public abstract class EditorWebView extends ExternalSiteWebView {
downloadmanager.enqueue(request);
}
public Snackbar getLoadingSnackbar() {
return this.loadingSnackbar;
}
public void setLoadingSnackbar(Snackbar loadingSnackbar) {
this.loadingSnackbar = loadingSnackbar;
}
public class MobileInterface {
@JavascriptInterface
public void close() {

View File

@ -46,7 +46,6 @@ import java.io.InputStream;
import androidx.appcompat.app.ActionBar;
import androidx.drawerlayout.widget.DrawerLayout;
import lombok.Getter;
/**
* This activity shows an URL as a web view
@ -64,7 +63,7 @@ public class ExternalSiteWebView extends FileActivity {
protected boolean showToolbar = true;
protected int webViewLayout = R.layout.externalsite_webview;
private int menuItemId;
@Getter protected WebView webview;
protected WebView webview;
private boolean showSidebar;
String url;
@ -235,4 +234,8 @@ public class ExternalSiteWebView extends FileActivity {
setDrawerMenuItemChecked(menuItemId);
}
public WebView getWebview() {
return this.webview;
}
}

View File

@ -99,7 +99,6 @@ import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import lombok.Setter;
/**
* This Adapter populates a RecyclerView with all files and folders in a Nextcloud instance.
@ -137,7 +136,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
private List<ThumbnailsCacheManager.ThumbnailGenerationTask> asyncTasks = new ArrayList<>();
private boolean onlyOnDevice;
private boolean showShareAvatar = false;
@Setter private OCFile highlightedItem;
private OCFile highlightedItem;
public OCFileListAdapter(
Activity activity,
@ -1052,6 +1051,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
return ((ImageView) callContext).getTag().equals(tag);
}
public void setHighlightedItem(OCFile highlightedItem) {
this.highlightedItem = highlightedItem;
}
private class FilesFilter extends Filter {
@Override
protected FilterResults performFiltering(CharSequence constraint) {

View File

@ -36,13 +36,7 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.PopupMenu;
import android.widget.TextView;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatCheckBox;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
@ -60,6 +54,14 @@ import com.owncloud.android.utils.ThemeUtils;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatCheckBox;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Adapter to show a user/group/email/remote in Sharing list in file details view.
*/

View File

@ -32,7 +32,6 @@ import java.util.List;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

View File

@ -20,18 +20,41 @@
package com.owncloud.android.ui.adapter;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
/**
* UI POJO for the storage path list.
*/
@Getter
@Setter
@AllArgsConstructor
public class StoragePathItem {
private int icon;
private String name;
private String path;
public StoragePathItem(int icon, String name, String path) {
this.icon = icon;
this.name = name;
this.path = path;
}
public int getIcon() {
return this.icon;
}
public String getName() {
return this.name;
}
public String getPath() {
return this.path;
}
public void setIcon(int icon) {
this.icon = icon;
}
public void setName(String name) {
this.name = name;
}
public void setPath(String path) {
this.path = path;
}
}

View File

@ -22,8 +22,7 @@ package com.owncloud.android.ui.dialog;
import android.app.Dialog;
import android.os.Bundle;
import android.view.ActionMode;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.ui.activity.ComponentsGetter;
@ -33,6 +32,9 @@ import com.owncloud.android.utils.ThemeUtils;
import java.util.ArrayList;
import java.util.Collection;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
/**
* Dialog requiring confirmation before removing a collection of given OCFiles.
*

View File

@ -27,29 +27,24 @@ import com.owncloud.android.datamodel.MediaFolderType;
import com.owncloud.android.datamodel.SyncedFolderDisplayItem;
import com.owncloud.android.files.services.FileUploader;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* Parcelable for {@link SyncedFolderDisplayItem} objects to transport them from/to dialog fragments.
*/
@NoArgsConstructor
public class SyncedFolderParcelable implements Parcelable {
@Getter @Setter private String folderName;
@Getter @Setter private String localPath;
@Getter @Setter private String remotePath;
@Getter @Setter private boolean wifiOnly = false;
@Getter @Setter private boolean chargingOnly = false;
@Getter @Setter private boolean existing = true;
@Getter @Setter private boolean enabled = false;
@Getter @Setter private boolean subfolderByDate = false;
@Getter private Integer uploadAction;
@Getter @Setter private MediaFolderType type;
@Getter @Setter private boolean hidden = false;
@Getter @Setter private long id;
@Getter @Setter private String account;
@Getter @Setter private int section;
private String folderName;
private String localPath;
private String remotePath;
private boolean wifiOnly = false;
private boolean chargingOnly = false;
private boolean existing = true;
private boolean enabled = false;
private boolean subfolderByDate = false;
private Integer uploadAction;
private MediaFolderType type;
private boolean hidden = false;
private long id;
private String account;
private int section;
public SyncedFolderParcelable(SyncedFolderDisplayItem syncedFolderDisplayItem, int section) {
id = syncedFolderDisplayItem.getId();
@ -85,6 +80,9 @@ public class SyncedFolderParcelable implements Parcelable {
hidden = read.readInt() != 0;
}
public SyncedFolderParcelable() {
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(id);
@ -147,4 +145,112 @@ public class SyncedFolderParcelable implements Parcelable {
break;
}
}
public String getFolderName() {
return this.folderName;
}
public String getLocalPath() {
return this.localPath;
}
public String getRemotePath() {
return this.remotePath;
}
public boolean isWifiOnly() {
return this.wifiOnly;
}
public boolean isChargingOnly() {
return this.chargingOnly;
}
public boolean isExisting() {
return this.existing;
}
public boolean isEnabled() {
return this.enabled;
}
public boolean isSubfolderByDate() {
return this.subfolderByDate;
}
public Integer getUploadAction() {
return this.uploadAction;
}
public MediaFolderType getType() {
return this.type;
}
public boolean isHidden() {
return this.hidden;
}
public long getId() {
return this.id;
}
public String getAccount() {
return this.account;
}
public int getSection() {
return this.section;
}
public void setFolderName(String folderName) {
this.folderName = folderName;
}
public void setLocalPath(String localPath) {
this.localPath = localPath;
}
public void setRemotePath(String remotePath) {
this.remotePath = remotePath;
}
public void setWifiOnly(boolean wifiOnly) {
this.wifiOnly = wifiOnly;
}
public void setChargingOnly(boolean chargingOnly) {
this.chargingOnly = chargingOnly;
}
public void setExisting(boolean existing) {
this.existing = existing;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public void setSubfolderByDate(boolean subfolderByDate) {
this.subfolderByDate = subfolderByDate;
}
public void setType(MediaFolderType type) {
this.type = type;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
public void setId(long id) {
this.id = id;
}
public void setAccount(String account) {
this.account = account;
}
public void setSection(int section) {
this.section = section;
}
}

View File

@ -23,20 +23,35 @@ import com.owncloud.android.lib.resources.files.SearchRemoteOperation;
import org.parceler.Parcel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* Search event
*/
@Parcel
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SearchEvent {
public String searchQuery;
public SearchRemoteOperation.SearchType searchType;
public SearchEvent(String searchQuery, SearchRemoteOperation.SearchType searchType) {
this.searchQuery = searchQuery;
this.searchType = searchType;
}
public SearchEvent() {
}
public String getSearchQuery() {
return this.searchQuery;
}
public SearchRemoteOperation.SearchType getSearchType() {
return this.searchType;
}
public void setSearchQuery(String searchQuery) {
this.searchQuery = searchQuery;
}
public void setSearchType(SearchRemoteOperation.SearchType searchType) {
this.searchType = searchType;
}
}

View File

@ -23,15 +23,17 @@ import android.content.Intent;
import org.parceler.Parcel;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
@Parcel
@NoArgsConstructor
@AllArgsConstructor
public class SyncEventFinished {
public Intent intent;
public SyncEventFinished(Intent intent) {
this.intent = intent;
}
public SyncEventFinished() {
}
public Intent getIntent() {
return intent;
}

View File

@ -22,7 +22,6 @@
*/
package com.owncloud.android.ui.preview;
import android.accounts.Account;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@ -37,7 +36,6 @@ import android.view.MenuItem;
import android.view.View;
import com.google.android.material.snackbar.Snackbar;
import com.nextcloud.client.account.User;
import com.nextcloud.client.di.Injectable;
import com.nextcloud.client.preferences.AppPreferences;
import com.owncloud.android.MainApp;

View File

@ -19,16 +19,37 @@
*/
package com.owncloud.android.utils;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
/**
* Represents a session to an ownCloud instance
*/
@AllArgsConstructor
class OwnCloudSession {
@Getter @Setter private String sessionName;
@Getter @Setter private String sessionUrl;
@Getter private int entryId;
private String sessionName;
private String sessionUrl;
private int entryId;
public OwnCloudSession(String sessionName, String sessionUrl, int entryId) {
this.sessionName = sessionName;
this.sessionUrl = sessionUrl;
this.entryId = entryId;
}
public String getSessionName() {
return this.sessionName;
}
public String getSessionUrl() {
return this.sessionUrl;
}
public int getEntryId() {
return this.entryId;
}
public void setSessionName(String sessionName) {
this.sessionName = sessionName;
}
public void setSessionUrl(String sessionUrl) {
this.sessionUrl = sessionUrl;
}
}

View File

@ -21,18 +21,21 @@ import com.caverock.androidsvg.SVGParseException;
import java.io.IOException;
import java.io.InputStream;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/**
* Decodes an SVG internal representation from an {@link InputStream}.
*/
@NoArgsConstructor
@AllArgsConstructor
public class SvgDecoder implements ResourceDecoder<InputStream, SVG> {
private int height = -1;
private int width = -1;
public SvgDecoder(int height, int width) {
this.height = height;
this.width = width;
}
public SvgDecoder() {
}
public Resource<SVG> decode(InputStream source, int w, int h) throws IOException {
try {
SVG svg = SVG.getFromInputStream(source);

View File

@ -17,11 +17,12 @@
License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/bg_default">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="@color/bg_default">
<TextView
android:id="@+id/add_to_cloud"
@ -49,7 +50,7 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_action_upload"
android:tint="@color/primary"/>
app:tint="@color/primary"/>
<TextView
android:layout_width="wrap_content"
@ -80,7 +81,7 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_import"
android:tint="@color/primary"/>
app:tint="@color/primary"/>
<TextView
android:layout_width="wrap_content"
@ -111,7 +112,7 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_camera"
android:tint="@color/primary" />
app:tint="@color/primary" />
<TextView
android:layout_width="wrap_content"
@ -152,7 +153,7 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_action_create_dir"
android:tint="@color/primary"/>
app:tint="@color/primary"/>
<TextView
android:layout_width="wrap_content"
@ -321,7 +322,7 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_post_add"
android:tint="@color/primary" />
app:tint="@color/primary" />
<TextView
android:layout_width="wrap_content"