norkator / paketin-seuranta

Privacy preserving parcel tracking application for Android supporting multiple parcel courier companies. App is targeted in Finnish market. Standalone app, no private backends, tracking or overkill infrastructure. No ads or paid content.
https://play.google.com/store/apps/details?id=com.nitramite.paketinseuranta
MIT License
11 stars 5 forks source link

Improvement: Maybe we should switch from ListView to RecyclerView? #41

Closed developerfromjokela closed 3 years ago

developerfromjokela commented 4 years ago

ListView is now old, Google itself recommends using RecyclerView.

I've seen in the app when I archive something, the courier Icon spacing gets messed up. I suspect that to the ListView.

Also if my list is able to scroll down, when trying to scroll up, swipe-to-refresh always hits me.

norkator commented 4 years ago

ListView is now old, Google itself recommends using RecyclerView.

I've seen in the app when I archive something, the courier Icon spacing gets messed up. I suspect that to the ListView.

Also if my list is able to scroll dowb, when trying to scroll up, swipe-to-refresh always hits me.

That is true and I fully approve changing to recyclerview!

norkator commented 4 years ago

@developerfromjokela you can do this if you have time. I used now Recycler view on new app so have experience too but I will only make this some time in future. I will notify here if I do it but @developerfromjokela feel free to do if you have time before me.

developerfromjokela commented 4 years ago

@norkator in the latest update, swipe refresh no longer works. Is it intended to be like that?

developerfromjokela commented 4 years ago

It works when I launch the app, if I scroll down, and scroll back up to pull it down, it no longer works

norkator commented 4 years ago

It works when I launch the app, if I scroll down, and scroll back up to pull it down, it no longer works

I cannot re produce, works on my devices.

developerfromjokela commented 4 years ago

Hmm interesting, I am using Android 10 on Pixel 4 XL.

You enter the app, immediately after you scroll down, I think the Swipe to refresh gets disabled.

When I scroll back up, it never gets enabled.

norkator commented 4 years ago

Hmm interesting, I am using Android 10 on Pixel 4 XL.

You enter the app, immediately after you scroll down, I think the Swipe to refresh gets disabled.

When I scroll back up, it never gets enabled.

Okay yes Android 10 has problems with it.

norkator commented 4 years ago

Hmm interesting, I am using Android 10 on Pixel 4 XL.

You enter the app, immediately after you scroll down, I think the Swipe to refresh gets disabled.

When I scroll back up, it never gets enabled.

After more testing looks like onScroll with firstVisiblePosition works when looking from logs but swipeRefreshLayout.setEnabled does not set it's state everytime. Something wrong with swipeRefreshLayout

norkator commented 4 years ago

Yep, on api 28 it works first okay and suddenly stops working all together. api 29 it's not working right at all.

norkator commented 4 years ago

image

Found causing problem... it's this method here. Need to add position checking here too.

developerfromjokela commented 4 years ago

@norkator Is the update released to fix the Swipe refresh problem?

norkator commented 4 years ago

@norkator Is the update released to fix the Swipe refresh problem?

Yes.

developerfromjokela commented 4 years ago

@norkator On my device problem still exists

norkator commented 4 years ago

@norkator On my device problem still exists

What device you have? Is it possible that play store cache caused esrlier version as update? What does version code say at about view?

developerfromjokela commented 4 years ago

@norkator Pixel 4 XL, version code 128 version name 2.1.11

norkator commented 4 years ago

@norkator Pixel 4 XL, version code 128 version name 2.1.11

I am using Android 10 phone now too but it works for me. What kind of behavior it does for you?

ristomatti commented 4 years ago

I was able to reproduce it now also. This time it requires first opening package details, scrolling it down, pressing back. After returning to list view pull to refresh doesn't necessarily trigger straight after scrolling up but it triggers before the topmost item is fully visible.

norkator commented 4 years ago

I was able to reproduce it now also. This time it requires first opening package details, scrolling it down, pressing back. After returning to list view pull to refresh doesn't necessarily trigger straight after scrolling up but it triggers before the topmost item is fully visible.

Aaa. Onresume, onpause event or any other has been rogotten maybe for checking.

norkator commented 4 years ago

I was able to reproduce it now also. This time it requires first opening package details, scrolling it down, pressing back. After returning to list view pull to refresh doesn't necessarily trigger straight after scrolling up but it triggers before the topmost item is fully visible.

Update, tried too.. yes topmost item is not fully visible till refresh triggers. This is now tricky because listview position gives 0 already. 👎

developerfromjokela commented 4 years ago

@norkator Just checked out, issue happens while it's refreshing. When refreshing stops, it works like it should.

norkator commented 4 years ago

Okay I found problem.. listview should be inside swipe refresh layout but it was not. All those code change were total "hacks" so removed them.

norkator commented 4 years ago

See https://github.com/norkator/paketin-seuranta/pull/68

norkator commented 3 years ago

I start working on recycler view at least initially for main menu. Targeting to make it more nicer looking.