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 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import android.os.RemoteException;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.util.Log;

import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
Expand Down Expand Up @@ -510,7 +511,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, gson.toJson(file.isLivePhoto()));
cv.put(ProviderTableMeta.FILE_METADATA_LIVE_PHOTO, gson.toJson(file.getLivePhoto()));

return cv;
}
Expand Down Expand Up @@ -932,6 +933,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 @@ -940,7 +942,7 @@ private OCFile createFileInstance(FileEntity fileEntity) {
ocFile.setLockTimestamp(nullToZero(fileEntity.getLockTimestamp()));
ocFile.setLockTimeout(nullToZero(fileEntity.getLockTimeout()));
ocFile.setLockToken(fileEntity.getLockToken());
ocFile.setLivePhotoAvailable(fileEntity.getMetadataLivePhoto() == "TODO");
ocFile.setLivePhoto(fileEntity.getMetadataLivePhoto());

String sharees = fileEntity.getSharees();
// Surprisingly JSON deserialization causes significant overhead.
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/java/com/owncloud/android/datamodel/OCFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;

import com.owncloud.android.R;
import com.owncloud.android.lib.common.network.WebdavEntry;
Expand Down Expand Up @@ -83,7 +84,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
private long lastSyncDateForProperties;
private long lastSyncDateForData;
private boolean previewAvailable;
private boolean livePhotoAvailable;
private String livePhoto;
private String etag;
private String etagOnServer;
private boolean sharedViaLink;
Expand Down Expand Up @@ -197,6 +198,7 @@ private OCFile(Parcel source) {
lockTimestamp = source.readLong();
lockTimeout = source.readLong();
lockToken = source.readString();
livePhoto = source.readString();
}

@Override
Expand Down Expand Up @@ -240,11 +242,11 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(lockTimestamp);
dest.writeLong(lockTimeout);
dest.writeString(lockToken);
// TODO add live photo availability
dest.writeString(livePhoto);
}

public Boolean isLivePhoto() {
return livePhotoAvailable;
public String getLivePhoto() {
return livePhoto;
}

public void setDecryptedRemotePath(String path) {
Expand Down Expand Up @@ -527,7 +529,7 @@ private void resetData() {
lockTimestamp = 0;
lockTimeout = 0;
lockToken = null;

livePhoto = null;
imageDimension = null;
}

Expand Down Expand Up @@ -918,8 +920,8 @@ public void setNote(String note) {
this.note = note;
}

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

public void setSharees(List<ShareeUser> sharees) {
Expand Down
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 = 73;
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
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,12 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
}

private void checkLivePhotoAvailability(ListGridImageViewHolder holder, OCFile file) {
holder.getLivePhotoIndicator().setVisibility((file.isLivePhoto()) ? (View.VISIBLE) : (View.GONE));
boolean isLivePhoto = file.getLivePhoto() != null;
holder.getLivePhotoIndicator().setVisibility(isLivePhoto ? (View.VISIBLE) : (View.GONE));

// FIXME Interface segregation principle violation
// Not needed for Grid mode unfortunately ListGridImageViewHolder interface used for List and Grid mode
holder.getLivePhotoIndicatorSeparator().setVisibility((file.isLivePhoto()) ? (View.VISIBLE) : (View.GONE));
holder.getLivePhotoIndicatorSeparator().setVisibility(isLivePhoto ? (View.VISIBLE) : (View.GONE));
}

private void bindListItemViewHolder(ListItemViewHolder holder, OCFile file) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,

binding.image.setOnClickListener(v -> togglePreviewImageFullScreen());

if (getFile().isLivePhoto()) {
if (getFile().getLivePhoto() != null) {
binding.image.setOnLongClickListener(v -> {
playLivePhoto();
return true;
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext {
androidPluginVersion = '8.1.1'
androidPluginVersion = '8.1.2'
appCompatVersion = '1.6.1'
jacoco_version = '0.8.10'
kotlin_version = '1.8.22'
Expand Down