guardianproject / haven

Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors
https://guardianproject.github.io/haven/
GNU General Public License v3.0
6.63k stars 728 forks source link

Bug Fix and Recycler View optimisation #379

Closed archie94 closed 5 years ago

archie94 commented 5 years ago

Well I started this to eliminate the flicker first time an audio item is inflated. Turns it it is due to the view used to display the Wave form.

Anyways for multiple view type in a recyclerview we should use different layouts. This removes the burden of changing the visibility of items in onBind. This multiple view type maps well with the multiple type of EventTrigger we have.

This also removes a bug: clicking on any image in Event we always start the ImageViewer with startPosition = 0. This should be the index of image clicked.

archie94 commented 5 years ago

Added index numbers to Logs and Event Triggers. Should resolve #337

archie94 commented 5 years ago

Well I started this to eliminate the flicker first time an audio item is inflated. Turns it it is due to the view used to display the Wave form.

Regarding this the audio-waveform library documentation says not to call mWaveformView.setAudioFile(soundFile); from the main thread but that method calls invalidate() on a view which should only be called on UI thread. :/

Also the library seems un-maintained which brings me to the question should we look for an alternative?

archie94 commented 5 years ago

Well I started this to eliminate the flicker first time an audio item is inflated. Turns it it is due to the view used to display the Wave form.

Regarding this the audio-waveform library documentation says not to call mWaveformView.setAudioFile(soundFile); from the main thread but that method calls invalidate() on a view which should only be called on UI thread. :/

Hmm in order to do this asynchronously it appears we should use WaveformView instead of SimpleWaveformView but getting frequent crashes on that.

lukeswitz commented 5 years ago

I realize this is a WIP but here's a few notes I get when testing, will supply logs if needed:

All branches: ListView doesn't show the latest session until after the mp4 muxer is finished, which is never for legacy devices

archie94 commented 5 years ago
  • Adding a line for # 1, # 2, etc, labeling is confusing/unnecessary, in my personal opinion. If the timestamps are readable & ordered, these remove needed real-estate on smaller devices

Well I feel we should keep some form of indexing given that triggers can occur in fraction of a second or even a few second(s) apart. Add to it if there are more than 100 triggers (say) in one session readability is hindered.

Having said that I understand where you are coming from and yes, adding one line for index does not help legacy / small screen devices. Let's explore better UI/UX options for this.

Thanks a lot for testing and these feedbacks. Much appreciated :D

archie94 commented 5 years ago

Have changed the position of index number for trigger items. @lukeswitz please check if this makes sense.

lukeswitz commented 5 years ago

Makes sense, nice addition!

n8fr8 commented 5 years ago

Thanks all, jumping back in here soon!