Closed r10s closed 6 years ago
^^ @icke68746 and @g6094199 did not really referenced this issue, it was only tha #10
appeared in a log :)
apart from that: the swiping through images from the gallery works, maybe this is a hint to start with. EDIT: i mean the gallery-preview that is shown in Delta Chat when clicking on the paperclip in the chatview. if you tap in the little image (not on the circle to check) you get the same gallery as for in-chat-images - but swiping works here.
Code that handles the display of the Photo (Gallery and Chat-Direct) is PhotoViewer (:2729 -> openPhoto). In Gallery the photos list is populated with MediaController$PhotoEntry whereas in chat-direct this list is empty.
Going up the callgraph: ChacMessageCell:632 ChatMessageCell:544 ChatMessageCell:830 ChatActivity:2802 <- This is most likely the position where we have access to enough context to build up the list of the pictures in the message history of this chat. (Compare function in ChatActivity:2559)
State when calling the openPhoto (PhotoViewer:2729) from the Gallery: messageObject: null and must be so (:2205 and :2273) fileLocation: null and must be so (:2215) messages: null and must be so (:2222) photos: A list of MediaController$PhotoEntry and must be so (:2234) index: The position of the photo to be displayed in the list "photos" provider: ChatAttachAlert chatActivity: Chatactivity dialogId: 0 and seems required (:2264) check if dialogId == currentDialogId
windowView.attachedToWindow is false to begin with actionBar title contains the current index and the count. velocityTracker is null and thus gets obtained.
isInvisible was false, gets set to true
object is a PhotoViewer$PlaceProviderObject recheck: Line 2778 -> does this if get executed even though messageObject was null?
-> into onPhotoShow:2140 messageObject: null, fileLocation: null, messages: null, photos: unmodified, index, unmodified, object: unmodified
mergeDialogId: 0 object.thumb: Bitmap of thumbnail of image to be shown. photoCropView: null photoFilterView: null radialProgressView[0,1,2]: PhotoViewer$RadialProgressView instances sendPhotoType == 0 -> activates checkImageView.visibility
-> into updateSelectedCount (:2133) <-
currentAnimation: null current
State when calling the openPhoto (PhotoViewer:2729) from Chat View of a single image: messageObject: not null, but should be (:2778, :2205 and :2273) fileLocation: null and must be so (:2215) messages: null and must be so (:2222) photos: A list of MediaController$PhotoEntry and must be so (:2234) index: 0, but should be the index in the list of photos provider: ChatActivity, in Gallery its ChatAttachAlert, maybe needs investigation chatActivity: null, but should maybe need to be a ChatActivity (maybe the one in provider?) dialogId: 10, but maybe needs to be 0 for (:2264) check if dialogId == currentDialogId
windowView.attachedToWindow is false to begin with actionBar title contains the current index and the count. velocityTracker is null and thus gets obtained. isInvisible was false, gets set to true object is a PhotoViewer$PlaceProviderObject
NOTE, line 2779: currentAnimation gets set to null because messageObject != null
-> into onPhotoShow:2140 messageObject: null, fileLocation: null, messages: null, photos: unmodified, index, unmodified, object: unmodified
mergeDialogId: 0 object.thumb: Bitmap of thumbnail of image to be shown. photoCropView: null photoFilterView: null radialProgressView[0,1,2]: PhotoViewer$RadialProgressView instances
In Line 2205, if the messageObject is not null and the messages are null, the wrong branch gets selected. messageObject needs to be null here.
Needing to figure out why all the images (except the first one) only display thumbs. check in 2657 -> setShuldGenerateQualityThumb is set to true compare in 2679 -> setNeedsQualityThumb is set to false in 2689 the image seems to be created. (original name of attachment was "Ac_Necklace02.png" ) fileLocation is: "/data/data/com.b44t.messenger.beta/files/messenger.db-blobs/Ac_Necklace02.png" thumbLocation is: "/data/data/com.b44t.messenger.beta/files/messenger.db-blobs/Ac_Necklace02.png" -> so file and thumb are the same (which is fine as the photo IS small, but the thumb is blurred (thumbFilter: b) which is not fine) Attempting to just disable the blurring
blurring only affects images that are small enough to be never thumbed
For now, you can only open one image at a time in the chat view.
We should add a functionality, where swiping left/right goes to the previous/next image.