Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Photo #12139

Merged
merged 118 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
50567dd
Add indicator word and icon
alperozturk96 Nov 6, 2023
3f0a049
Add indicator in list_item
alperozturk96 Nov 6, 2023
3abb630
Add live photo indicator for grid view
alperozturk96 Nov 6, 2023
cc03aa9
Update ViewHolders for live photo indicator
alperozturk96 Nov 6, 2023
e925ce9
Update OCFile for live photo ability
alperozturk96 Nov 6, 2023
eb0aa90
Add missing live photo indicator for grid
alperozturk96 Nov 6, 2023
0ff650d
Update oc file adapter for live photo indicator
alperozturk96 Nov 6, 2023
c45e786
Fix alignment in grid mode
alperozturk96 Nov 6, 2023
cf71e59
Add long click listener for live photo
alperozturk96 Nov 6, 2023
eae0947
Change icon with sf symbol
alperozturk96 Nov 6, 2023
4807c17
Fix hitboxes for accesibilty
alperozturk96 Nov 6, 2023
c1c9d94
Add playLivePhoto functionality to image fragment
alperozturk96 Nov 6, 2023
2c499ef
Add new property
alperozturk96 Nov 6, 2023
c350d4f
Check LivePhotoIndicatorSeparator
alperozturk96 Nov 7, 2023
38b9548
Add live photo field usage
alperozturk96 Nov 7, 2023
b4d9ab0
Add live photo field to OCFile
alperozturk96 Nov 7, 2023
bef81ea
Fix live photo field usage
alperozturk96 Nov 7, 2023
0c2eaf4
Merge remote-tracking branch 'origin/feature/live-photo' into feature…
alperozturk96 Nov 7, 2023
9765324
Fix live photo indicator visibility for gridview
alperozturk96 Nov 7, 2023
904c931
Add live photo playback to Preview Fragment
alperozturk96 Nov 7, 2023
2fac132
Remove unnecessary todo comment
alperozturk96 Nov 7, 2023
2566c5b
Update live indicator icon
alperozturk96 Nov 7, 2023
8cbd178
Increase performance for addVideoOCFileOfLivePhoto
alperozturk96 Nov 7, 2023
eddbc78
Add auto play functionality
alperozturk96 Nov 7, 2023
8de87ca
Add fixme comment
alperozturk96 Nov 7, 2023
225cca0
Prevent unnecessary calls for addVideoOCFileOfLivePhoto
alperozturk96 Nov 8, 2023
0eaeccb
Fix live photo indicator background ratio
alperozturk96 Nov 8, 2023
dfbd790
Add toggle functionality for action bar
alperozturk96 Nov 8, 2023
2a37bd8
draft commit
alperozturk96 Nov 8, 2023
d381bbd
Improve UX, toggle actionbar, disable auto play
alperozturk96 Nov 8, 2023
b41c200
Add tooltip to live photo indicator
alperozturk96 Nov 8, 2023
e577ddd
Deduct live photo count from list
alperozturk96 Nov 8, 2023
cb9dd8e
Remove long press action trigger live photo preview via tap
alperozturk96 Nov 8, 2023
8efa8f9
Replace live photo image
alperozturk96 Nov 8, 2023
5376561
Fix scroll problem with huge list with different file types
alperozturk96 Nov 8, 2023
5847afe
Change interface for different needs
alperozturk96 Nov 8, 2023
46d2e42
Fix live photo visibility for grid mode
alperozturk96 Nov 8, 2023
75169fb
Add background tint for indicators
alperozturk96 Nov 8, 2023
18c7a4a
Include local android lib (It will then be disabled as a comment.)
alperozturk96 Nov 8, 2023
0ad0d9b
Remove unnecassary hiding logic and merge ocfiles for live photo
alperozturk96 Nov 13, 2023
0cb4d3b
move merge live photos up, so that mFilesAll is same as mFiles
tobiasKaminsky Nov 14, 2023
93afd5a
Add hidden field
alperozturk96 Nov 14, 2023
6c71a29
Merge master
alperozturk96 Nov 14, 2023
cdda5fb
Fix db version number
alperozturk96 Nov 14, 2023
8f83da0
Update fields
alperozturk96 Nov 16, 2023
56a93e1
Merge master
alperozturk96 Nov 16, 2023
f16509d
Add indicator word and icon
alperozturk96 Nov 6, 2023
ff3ad76
Add indicator in list_item
alperozturk96 Nov 6, 2023
75ddb32
Add live photo indicator for grid view
alperozturk96 Nov 6, 2023
28ce0e0
Update ViewHolders for live photo indicator
alperozturk96 Nov 6, 2023
ad4b3cb
Update OCFile for live photo ability
alperozturk96 Nov 6, 2023
01c39ec
Add missing live photo indicator for grid
alperozturk96 Nov 6, 2023
87a420f
Update oc file adapter for live photo indicator
alperozturk96 Nov 6, 2023
5256b62
Fix alignment in grid mode
alperozturk96 Nov 6, 2023
0ce03a3
Add long click listener for live photo
alperozturk96 Nov 6, 2023
fd4096f
Change icon with sf symbol
alperozturk96 Nov 6, 2023
56945a8
Fix hitboxes for accesibilty
alperozturk96 Nov 6, 2023
cab9abe
Add playLivePhoto functionality to image fragment
alperozturk96 Nov 6, 2023
6a34f81
Add new property
alperozturk96 Nov 6, 2023
7ca84b6
Check LivePhotoIndicatorSeparator
alperozturk96 Nov 7, 2023
a923d57
Add live photo field usage
alperozturk96 Nov 7, 2023
56a8653
Fix live photo field usage
alperozturk96 Nov 7, 2023
43bce94
Fix live photo indicator visibility for gridview
alperozturk96 Nov 7, 2023
df4c531
Add live photo playback to Preview Fragment
alperozturk96 Nov 7, 2023
47a4fbb
Remove unnecessary todo comment
alperozturk96 Nov 7, 2023
429c892
Update live indicator icon
alperozturk96 Nov 7, 2023
fdd10c2
Increase performance for addVideoOCFileOfLivePhoto
alperozturk96 Nov 7, 2023
ef60fce
Add auto play functionality
alperozturk96 Nov 7, 2023
7fd6224
Add fixme comment
alperozturk96 Nov 7, 2023
7030329
Prevent unnecessary calls for addVideoOCFileOfLivePhoto
alperozturk96 Nov 8, 2023
4930d6c
Fix live photo indicator background ratio
alperozturk96 Nov 8, 2023
7959a1d
Add toggle functionality for action bar
alperozturk96 Nov 8, 2023
d2a8005
draft commit
alperozturk96 Nov 8, 2023
7617658
Improve UX, toggle actionbar, disable auto play
alperozturk96 Nov 8, 2023
d2d7865
Add tooltip to live photo indicator
alperozturk96 Nov 8, 2023
5f18c86
Deduct live photo count from list
alperozturk96 Nov 8, 2023
85504a6
Remove long press action trigger live photo preview via tap
alperozturk96 Nov 8, 2023
8211109
Replace live photo image
alperozturk96 Nov 8, 2023
03715a9
Fix scroll problem with huge list with different file types
alperozturk96 Nov 8, 2023
af5ede7
Change interface for different needs
alperozturk96 Nov 8, 2023
8a7f482
Fix live photo visibility for grid mode
alperozturk96 Nov 8, 2023
6f8624f
Add background tint for indicators
alperozturk96 Nov 8, 2023
8b8314e
Include local android lib (It will then be disabled as a comment.)
alperozturk96 Nov 8, 2023
bed3c8d
Remove unnecassary hiding logic and merge ocfiles for live photo
alperozturk96 Nov 13, 2023
c14754f
move merge live photos up, so that mFilesAll is same as mFiles
tobiasKaminsky Nov 14, 2023
739a6cc
Add hidden field
alperozturk96 Nov 14, 2023
20c6fbb
Fix db version number
alperozturk96 Nov 14, 2023
3538e8b
Update fields
alperozturk96 Nov 16, 2023
a82ec04
Merge master
alperozturk96 Nov 16, 2023
400ed06
Merge remote-tracking branch 'origin/feature/live-photo' into feature…
alperozturk96 Nov 16, 2023
488462b
Rebase master
alperozturk96 Nov 16, 2023
8ae13ea
Update lib
alperozturk96 Nov 16, 2023
4cf339e
Fix hidden flag
alperozturk96 Nov 16, 2023
0106ba3
Hide hidden files in search
alperozturk96 Nov 16, 2023
82526e0
Code cleanup
alperozturk96 Nov 17, 2023
cecbaef
Update plugin version
alperozturk96 Dec 1, 2023
f642926
Merge master
alperozturk96 Dec 1, 2023
fc022c5
Change db version
alperozturk96 Dec 4, 2023
291b914
Add auto migration
alperozturk96 Dec 4, 2023
66e244e
Add correct 73 version json
alperozturk96 Dec 4, 2023
d18cf20
Merge master
alperozturk96 Dec 4, 2023
f6ee552
Code analytic fixes
alperozturk96 Dec 4, 2023
314a28f
Reduce spotbugs
alperozturk96 Dec 4, 2023
689ddea
Analysis: update lint results to reflect reduced error/warning count
invalid-email-address Dec 4, 2023
fd9d807
Trigger pipeline
alperozturk96 Dec 4, 2023
04bce45
fix tests
tobiasKaminsky Dec 6, 2023
a47ed56
add test
tobiasKaminsky Dec 6, 2023
2f1e3ea
Fix merge conflict
alperozturk96 Dec 6, 2023
2eb8245
Analysis: update lint results to reflect reduced error/warning count
invalid-email-address Dec 6, 2023
b493c67
Fix crashes
alperozturk96 Dec 6, 2023
d6657c9
Merge remote-tracking branch 'origin/feature/live-photo' into feature…
alperozturk96 Dec 6, 2023
2077bf9
Fix text color for live photo indicator
alperozturk96 Dec 6, 2023
0028d8e
Merge master
alperozturk96 Dec 7, 2023
7f70b1c
Solve git conflicts
alperozturk96 Dec 7, 2023
6f1b62f
Analysis: update lint results to reflect reduced error/warning count
invalid-email-address Dec 7, 2023
b48c027
Use file id for merging live photos
alperozturk96 Dec 8, 2023
7719b2e
Use file id for merging live photos
alperozturk96 Dec 8, 2023
633f458
Fix tests
alperozturk96 Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,173 changes: 1,173 additions & 0 deletions app/schemas/com.nextcloud.client.database.NextcloudDatabase/75.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
sut.storageManager.saveFile(this)
}

OCFile("/live photo.png").apply {
mimeType = "image/png"
isPreviewAvailable = false
fileLength = 3072000
modificationTimestamp = 746443755000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
setLivePhoto("/video.mov")
sut.storageManager.saveFile(this)
}

OCFile("/video.mp4").apply {
mimeType = "video/mp4"
isPreviewAvailable = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class UnifiedSearchFragmentIT : AbstractIT() {
@Test
fun showSearchResult() {
val activity = testActivityRule.launchActivity(null)
val sut = UnifiedSearchFragment.newInstance(null)
val sut = UnifiedSearchFragment.newInstance(null, null)

activity.addFragment(sut)

Expand Down Expand Up @@ -72,7 +72,7 @@ class UnifiedSearchFragmentIT : AbstractIT() {
@Test
fun search() {
val activity = testActivityRule.launchActivity(null) as TestActivity
val sut = UnifiedSearchFragment.newInstance(null)
val sut = UnifiedSearchFragment.newInstance(null, null)
val testViewModel = UnifiedSearchViewModel(activity.application)
testViewModel.setConnectivityService(activity.connectivityServiceMock)
val localRepository = UnifiedSearchFakeRepository()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ import com.owncloud.android.db.ProviderMeta
AutoMigration(from = 70, to = 71, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
AutoMigration(from = 71, to = 72),
AutoMigration(from = 72, to = 73),
AutoMigration(from = 73, to = 74, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class)
AutoMigration(from = 73, to = 74, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
AutoMigration(from = 74, to = 75)
],
exportSchema = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ data class FileEntity(
val isDownloading: Int?,
@ColumnInfo(name = ProviderTableMeta.FILE_FAVORITE)
val favorite: Int?,

@ColumnInfo(name = ProviderTableMeta.FILE_HIDDEN)
val hidden: Int?,

@ColumnInfo(name = ProviderTableMeta.FILE_IS_ENCRYPTED)
val isEncrypted: Int?,

@ColumnInfo(name = ProviderTableMeta.FILE_ETAG_IN_CONFLICT)
val etagInConflict: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_SHARED_WITH_SHAREE)
Expand All @@ -102,6 +107,8 @@ data class FileEntity(
val richWorkspace: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_METADATA_SIZE)
val metadataSize: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_METADATA_LIVE_PHOTO)
val metadataLivePhoto: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_LOCKED)
val locked: Int?,
@ColumnInfo(name = ProviderTableMeta.FILE_LOCK_TYPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.owncloud.android.R
import com.owncloud.android.lib.common.utils.Log_OC

class ExoplayerListener(private val context: Context, private val playerView: View, private val exoPlayer: ExoPlayer) :
class ExoplayerListener(
private val context: Context,
private val playerView: View,
private val exoPlayer: ExoPlayer,
private val onCompleted: () -> Unit = { }
) :
Player.Listener {

override fun onPlaybackStateChanged(playbackState: Int) {
super.onPlaybackStateChanged(playbackState)
if (playbackState == Player.STATE_ENDED) {
onCompletion()
onCompleted()
}
}

Expand Down
17 changes: 17 additions & 0 deletions app/src/main/java/com/nextcloud/utils/extensions/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package com.nextcloud.utils.extensions

import android.os.SystemClock
import android.text.Selection
import android.text.Spannable
import android.text.SpannableString
Expand All @@ -35,6 +36,22 @@ import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale

fun clickWithDebounce(view: View, debounceTime: Long = 600L, action: () -> Unit) {
view.setOnClickListener(object : View.OnClickListener {
private var lastClickTime: Long = 0

override fun onClick(v: View) {
if (SystemClock.elapsedRealtime() - lastClickTime < debounceTime) {
return
} else {
action()
}

lastClickTime = SystemClock.elapsedRealtime()
}
})
}

fun TextView.makeLinks(vararg links: Pair<String, View.OnClickListener>) {
val spannableString = SpannableString(this.text)
var startIndexOfLink = -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ private ContentValues createContentValuesBase(OCFile fileOrFolder) {
cv.put(ProviderTableMeta.FILE_REMOTE_ID, fileOrFolder.getRemoteId());
cv.put(ProviderTableMeta.FILE_LOCAL_ID, fileOrFolder.getLocalId());
cv.put(ProviderTableMeta.FILE_FAVORITE, fileOrFolder.isFavorite());
cv.put(ProviderTableMeta.FILE_HIDDEN, fileOrFolder.shouldHide());
cv.put(ProviderTableMeta.FILE_UNREAD_COMMENTS_COUNT, fileOrFolder.getUnreadCommentsCount());
cv.put(ProviderTableMeta.FILE_OWNER_ID, fileOrFolder.getOwnerId());
cv.put(ProviderTableMeta.FILE_OWNER_DISPLAY_NAME, fileOrFolder.getOwnerDisplayName());
Expand Down Expand Up @@ -501,6 +502,7 @@ private ContentValues createContentValuesForFile(OCFile file) {
cv.put(ProviderTableMeta.FILE_LOCKED, file.isLocked());
final FileLockType lockType = file.getLockType();
cv.put(ProviderTableMeta.FILE_LOCK_TYPE, lockType != null ? lockType.getValue() : -1);
cv.put(ProviderTableMeta.FILE_HIDDEN, file.shouldHide());
cv.put(ProviderTableMeta.FILE_LOCK_OWNER, file.getLockOwnerId());
cv.put(ProviderTableMeta.FILE_LOCK_OWNER_DISPLAY_NAME, file.getLockOwnerDisplayName());
cv.put(ProviderTableMeta.FILE_LOCK_OWNER_EDITOR, file.getLockOwnerEditor());
Expand All @@ -510,6 +512,7 @@ private ContentValues createContentValuesForFile(OCFile file) {
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
cv.put(ProviderTableMeta.FILE_METADATA_SIZE, gson.toJson(file.getImageDimension()));
cv.put(ProviderTableMeta.FILE_METADATA_GPS, gson.toJson(file.getGeoLocation()));
cv.put(ProviderTableMeta.FILE_METADATA_LIVE_PHOTO, file.getLinkedFileIdForLivePhoto());

return cv;
}
Expand Down Expand Up @@ -931,6 +934,7 @@ private OCFile createFileInstance(FileEntity fileEntity) {
ocFile.setNote(fileEntity.getNote());
ocFile.setRichWorkspace(fileEntity.getRichWorkspace());
ocFile.setLocked(nullToZero(fileEntity.getLocked()) == 1);

final int lockTypeInt = nullToZero(fileEntity.getLockType()); // TODO - what value should be used for NULL???
ocFile.setLockType(lockTypeInt != -1 ? FileLockType.fromValue(lockTypeInt) : null);
ocFile.setLockOwnerId(fileEntity.getLockOwner());
Expand All @@ -939,6 +943,8 @@ private OCFile createFileInstance(FileEntity fileEntity) {
ocFile.setLockTimestamp(nullToZero(fileEntity.getLockTimestamp()));
ocFile.setLockTimeout(nullToZero(fileEntity.getLockTimeout()));
ocFile.setLockToken(fileEntity.getLockToken());
ocFile.setLivePhoto(fileEntity.getMetadataLivePhoto());
ocFile.setHidden(nullToZero(fileEntity.getHidden()) == 1);

String sharees = fileEntity.getSharees();
// Surprisingly JSON deserialization causes significant overhead.
Expand Down Expand Up @@ -1752,7 +1758,7 @@ public void saveConflict(OCFile ocFile, String etagInConflict) {
ProviderTableMeta.CONTENT_URI_FILE,
projection,
whereForDescencentsInConflict,
new String[]{user.getAccountName(), parentPath + "%"},
new String[]{user.getAccountName(), parentPath + '%'},
null
);
} else {
Expand Down
57 changes: 45 additions & 12 deletions app/src/main/java/com/owncloud/android/datamodel/OCFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import third_parties.daveKoeller.AlphanumComparator;

public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterface {

private final static String PERMISSION_SHARED_WITH_ME = "S";
@VisibleForTesting
public final static String PERMISSION_CAN_RESHARE = "R";
Expand Down Expand Up @@ -83,6 +84,8 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
private long lastSyncDateForProperties;
private long lastSyncDateForData;
private boolean previewAvailable;
private String livePhoto;
public OCFile livePhotoVideo;
private String etag;
private String etagOnServer;
private boolean sharedViaLink;
Expand All @@ -94,6 +97,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
private String etagInConflict; // Only saves file etag in the server, when there is a conflict
private boolean sharedWithSharee;
private boolean favorite;
private boolean hidden;
private boolean encrypted;
private WebdavEntry.MountType mountType;
private int unreadCommentsCount;
Expand Down Expand Up @@ -181,6 +185,7 @@ private OCFile(Parcel source) {
etagInConflict = source.readString();
sharedWithSharee = source.readInt() == 1;
favorite = source.readInt() == 1;
hidden = source.readInt() == 1;
encrypted = source.readInt() == 1;
ownerId = source.readString();
ownerDisplayName = source.readString();
Expand All @@ -196,6 +201,7 @@ private OCFile(Parcel source) {
lockTimestamp = source.readLong();
lockTimeout = source.readLong();
lockToken = source.readString();
livePhoto = source.readString();
}

@Override
Expand Down Expand Up @@ -224,6 +230,7 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeString(etagInConflict);
dest.writeInt(sharedWithSharee ? 1 : 0);
dest.writeInt(favorite ? 1 : 0);
dest.writeInt(hidden ? 1 : 0);
dest.writeInt(encrypted ? 1 : 0);
dest.writeString(ownerId);
dest.writeString(ownerDisplayName);
Expand All @@ -239,6 +246,15 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(lockTimestamp);
dest.writeLong(lockTimeout);
dest.writeString(lockToken);
dest.writeString(livePhoto);
}

public String getLinkedFileIdForLivePhoto() {
return livePhoto;
}

public void setLivePhoto(String livePhoto) {
this.livePhoto = livePhoto;
}

public void setDecryptedRemotePath(String path) {
Expand Down Expand Up @@ -344,11 +360,13 @@ public boolean existsOnDevice() {
return false;
}

public String getFileNameWithExtension(int fileNameLength) {
String fileName = getFileName();
String shortFileName = fileName.substring(0, Math.min(fileName.length(), fileNameLength));
String extension = "." + fileName.substring(fileName.lastIndexOf('.') + 1);
return shortFileName + extension;
public String getFileNameWithoutExtension(String fileName) {
int dotIndex = fileName.lastIndexOf('.');
if (dotIndex > 0) {
return fileName.substring(0, dotIndex);
} else {
return fileName;
}
}

/**
Expand Down Expand Up @@ -472,12 +490,14 @@ public void setFileName(String name) {
Log_OC.d(TAG, "OCFile name changing from " + remotePath);
if (!TextUtils.isEmpty(name) && !name.contains(PATH_SEPARATOR) && !ROOT_PATH.equals(remotePath)) {
String parent = new File(this.getRemotePath()).getParent();
parent = parent.endsWith(PATH_SEPARATOR) ? parent : parent + PATH_SEPARATOR;
remotePath = parent + name;
if (isFolder()) {
remotePath += PATH_SEPARATOR;
if (parent != null) {
parent = parent.endsWith(PATH_SEPARATOR) ? parent : parent + PATH_SEPARATOR;
remotePath = parent + name;
if (isFolder()) {
remotePath += PATH_SEPARATOR;
}
Log_OC.d(TAG, "OCFile name changed to " + remotePath);
}
Log_OC.d(TAG, "OCFile name changed to " + remotePath);
}
}

Expand Down Expand Up @@ -509,6 +529,7 @@ private void resetData() {
etagInConflict = null;
sharedWithSharee = false;
favorite = false;
hidden = false;
encrypted = false;
mountType = WebdavEntry.MountType.INTERNAL;
richWorkspace = "";
Expand All @@ -521,7 +542,7 @@ private void resetData() {
lockTimestamp = 0;
lockTimeout = 0;
lockToken = null;

livePhoto = null;
imageDimension = null;
}

Expand All @@ -532,7 +553,11 @@ private void resetData() {
*/
public String getParentRemotePath() {
String parentPath = new File(this.getRemotePath()).getParent();
return parentPath.endsWith(PATH_SEPARATOR) ? parentPath : parentPath + PATH_SEPARATOR;
if (parentPath != null) {
return parentPath.endsWith(PATH_SEPARATOR) ? parentPath : parentPath + PATH_SEPARATOR;
} else {
return null;
}
}

@Override
Expand Down Expand Up @@ -776,6 +801,10 @@ public boolean isFavorite() {
return this.favorite;
}

public boolean shouldHide() {
return this.hidden;
}

public boolean isEncrypted() {
return this.encrypted;
}
Expand Down Expand Up @@ -888,6 +917,10 @@ public void setFavorite(boolean favorite) {
this.favorite = favorite;
}

public void setHidden(boolean hidden) {
this.hidden = hidden;
}

public void setEncrypted(boolean encrypted) {
this.encrypted = encrypted;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private int updateUploadInternal(Cursor c, UploadStatus status, UploadResult res
TAG,
"Updating " + path + " with status:" + status + " and result:"
+ (result == null ? "null" : result.toString()) + " (old:"
+ upload.toFormattedString() + ")");
+ upload.toFormattedString() + ')');

upload.setUploadStatus(status);
upload.setLastResult(result);
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/com/owncloud/android/db/ProviderMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
public class ProviderMeta {
public static final String DB_NAME = "filelist";
public static final int DB_VERSION = 74;
public static final int DB_VERSION = 75;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DB version bump by 2? Also where is the new json schema for DB?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was testing. Multiple times I came across with conflict and I was increasing one by one whenever I got that issue. I remember first one was 74 then I put 75 nevertheless after complete all implementation I am going to check all changes. Thanks for the early notice.


private ProviderMeta() {
// No instance
Expand Down Expand Up @@ -107,6 +107,7 @@ static public class ProviderTableMeta implements BaseColumns {
public static final String FILE_IS_DOWNLOADING = "is_downloading";
public static final String FILE_ETAG_IN_CONFLICT = "etag_in_conflict";
public static final String FILE_FAVORITE = "favorite";
public static final String FILE_HIDDEN = "hidden";
public static final String FILE_IS_ENCRYPTED = "is_encrypted";
public static final String FILE_MOUNT_TYPE = "mount_type";
public static final String FILE_HAS_PREVIEW = "has_preview";
Expand All @@ -118,6 +119,7 @@ static public class ProviderTableMeta implements BaseColumns {
public static final String FILE_RICH_WORKSPACE = "rich_workspace";
public static final String FILE_METADATA_SIZE = "metadata_size";
public static final String FILE_METADATA_GPS = "metadata_gps";
public static final String FILE_METADATA_LIVE_PHOTO = "metadata_live_photo";
public static final String FILE_LOCKED = "locked";
public static final String FILE_LOCK_TYPE = "lock_type";
public static final String FILE_LOCK_OWNER = "lock_owner";
Expand Down Expand Up @@ -156,6 +158,7 @@ static public class ProviderTableMeta implements BaseColumns {
FILE_IS_DOWNLOADING,
FILE_ETAG_IN_CONFLICT,
FILE_FAVORITE,
FILE_HIDDEN,
FILE_IS_ENCRYPTED,
FILE_MOUNT_TYPE,
FILE_HAS_PREVIEW,
Expand All @@ -174,6 +177,7 @@ static public class ProviderTableMeta implements BaseColumns {
FILE_LOCK_TIMEOUT,
FILE_LOCK_TOKEN,
FILE_METADATA_SIZE,
FILE_METADATA_LIVE_PHOTO,
FILE_TAGS,
FILE_METADATA_GPS));
public static final String FILE_DEFAULT_SORT_ORDER = FILE_NAME + " collate nocase asc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.content.Context;
import android.media.MediaPlayer;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.AttributeSet;
import android.view.KeyEvent;
Expand Down Expand Up @@ -140,7 +141,7 @@ private void disableUnsupportedButtons() {
}
}

private final Handler handler = new Handler() {
private final Handler handler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
if (msg.what == SHOW_PROGRESS) {
Expand Down
Loading
Loading