domoticz / domoticz-android

Domoticz Client Application for Android Devices
104 stars 71 forks source link

Sorting dashboard keeps getting reset #606

Closed sammyke007 closed 3 years ago

sammyke007 commented 3 years ago

Describe the bug Everytime I change the order in the Domoticz app of the dashboard and open the app a again later on, the order gets reset to what it was before.

To Reproduce Steps to reproduce the behavior: Open Domoticz app, change order of devices on dashboard by drag&drop. Open app again 30 minutes later or so New sorted order gets lost

Expected behavior Save changed order by drag&drop. (Locking drag&drop after changing the order of devices doesn't help, already tried)

Smartphone (please complete the following information):

galadril commented 3 years ago

Thats weird, i actual have all my screens custom sorted.... its actually stored in the shared preferencse (the settings that you also export/import for example)

sammyke007 commented 3 years ago

This morning I had reset the app from within the settings (clearing all settings). I reconfigured from scratch and sorted my devices to my liking. After 1 hour, everything was still the same. I tought, well that got fixed finally, it was probably a bad setting somewhere.

Later today I installed the new update from today and BOOM, all my devices order got messed up again.

I tried clearing all settings again, reconfigure, ... but my order always gets messed up again. I start the app in dark theme, list mode, geofencing enabled and start sorting, that's all...

sammyke007 commented 3 years ago

Installed from scratch before update and kept working like this until updated: Screenshot_20201105-175933 After updating from Play store today: (sorting messed up) Screenshot_20201105-191055 Manualy sorted again after update today: Screenshot_20201105-193029 Couple of minutes later: Screenshot_20201105-193049

galadril commented 3 years ago

it looks like updating the app also put back some kind of old version of the sharepreference.... that would also explain why all widgets are f*cked after an update (those info is also stored in sharedpreferences)

sammyke007 commented 3 years ago

Correct, I have to remove my widgets and readd them every time

galadril commented 3 years ago

For the sorting, if you export your settings, update the app, and import your settings back.. it would probably be correct https://developer.android.com/guide/topics/data/autobackup

Ill try to disable the Android backup of the sharedpreferences

galadril commented 3 years ago

Ill try to set backup to false on the beta version of the play store ok ? i though you had beta on the premium verion right?

New version with backup disabled is uploaded to play store as Beta.. please let me know when you can test it.

sammyke007 commented 3 years ago

Yes, correct!

galadril commented 3 years ago

woops.. ive changed to

    android:allowBackup="true"

which should be

    android:allowBackup="false"

ofcourse....

sammyke007 commented 3 years ago

Yah, saw that and already tought it was a strange logic 👍 ;-)

galadril commented 3 years ago

558 (0.2.260 (8181))

sammyke007 commented 3 years ago

Updated to 260, cleared cache and data, clean config, everything sorted, exported settings to make sure it wouldn't mess up using menu option, 5 second freeze, dashboard reloads with messed up order... v260 Before: Screenshot_20201106-192921 10 seconds later: Screenshot_20201106-192947

When I disable sorting and let it sort as it's sorted on the server it's also a totally different order...

sammyke007 commented 3 years ago

If you would like to see for yourself or test yourself, I can make a temp user account for you and mail it to domoticz@hn**.nl?

galadril commented 3 years ago

Sorting is done locally on your phone, not on your server.. So it's not really needed.. Thanks

Op za 7 nov. 2020 06:23 schreef sammyke007 notifications@github.com:

If you would like to see for yourself or test yourself, I can make a temp user account for you and mail it to domoticz@hn**.nl?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/domoticz/domoticz-android/issues/606#issuecomment-723394298, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPDC2FHW5D33DZXTTHCXNDSOTKTLANCNFSM4TLDACXQ .

sammyke007 commented 3 years ago

I know, but maybe you can try and see it yourself on your phone. I don't think I'm doing anything wrong. Don't have to make a big deal of it, but I can't get sorting to work correctly here...

galadril commented 3 years ago

I found some bugs in the sorting logic. The beta has sorting better implemented!

It now only saves on destroy (page close) or refresh data.. so makes it way quicker

galadril commented 3 years ago

New beta is coming, let me know if it works better for you

sammyke007 commented 3 years ago

Sorting order seems te stay OK for now. Will report back tomorrow! Tnx for looking in to it.

sammyke007 commented 3 years ago

Screenshot_20201109-154021 Screenshot_20201109-191637

Sorry... Was ok for 2 hours or so, but upon opening just right now, sorting is messed up again...

sammyke007 commented 3 years ago

Always in the same messed up order. Don't understand... It's not the order of the server neither.

galadril commented 3 years ago

its really weird.. im actually sorting/dragging all the time and i have no issues at all with the latest version..

galadril commented 3 years ago

Can you maybe check the other screens then dashboard?.. Maybe you have some kind of double device id. (i store the sorting based on device id)

sammyke007 commented 3 years ago

Alright, sorted switches (schakelaars) and will report later.

After sorting I tried closing the app normally, changing settings, ... and my preferred sorting order kept intact. After opening the app after an hour or 2 it got messed up. Really strange behavior.

I still have a user account set up for you if you would like to try to connect to my server yourself.

FYI, I'm running 2020.2 stable not the latest beta of 2020.2

sammyke007 commented 3 years ago

Sorted by preference: Screenshot_20201109-192804 Screenshot_20201109-193719 After forceclosing: Screenshot_20201109-193819 Screenshot_20201109-193807

So it seems that totally killing it (force closing) messes up?

EDIT: Killing the app from within the recent app drawer (by swiping Domoticz up) also messes up all sorting. Not only in Dashboard, but also in switches and in temperature.

EDIT2: Clicking export settings (advanced settings) also messes up order again...

galadril commented 3 years ago

new beta is coming again with a small fix on sorting (probably not your main issue). Can you also check from the previous beta if widgets still get corrupted?

galadril commented 3 years ago

btw the new beta version also contains some big changes to get ready for targetting Android 11 https://github.com/domoticz/domoticz-android/pull/611

(rewrite the file handling, sharing camera snapshots, and import/export settings)

galadril commented 3 years ago

As far as i can see, the only sorting issue that remains, is when you sort.. and force close after that, it doesnt save.. because i dont get the force close events in the app.. so doing that isn't a best practise as well ;)

Thinks its already way better then it was !

sammyke007 commented 3 years ago

I'll check it. I am already running on Android 11, is that maybe why exporting settings and sorting doesn't get remembered?

galadril commented 3 years ago

could be.. 561 (0.2.263 (8250)) is already on beta btw

galadril commented 3 years ago

did you try it yesterday?

sammyke007 commented 3 years ago

Yes. Widgets needed to be readded, but not so big problem. BUT... my sorting seems te stay ok for almost a day! Let's see if it stays this way.

galadril commented 3 years ago

and the import/export feature of settings also works now without crashing right

Op wo 11 nov. 2020 om 09:24 schreef sammyke007 notifications@github.com:

Yes. Widgets needed to be readded, but not so big problem. BUT... my sorting seems te stay ok for almost a day! Let's see if it stays this way.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/domoticz/domoticz-android/issues/606#issuecomment-725279481, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPDC2BPTSOP4K5JBEFTPQTSPJC23ANCNFSM4TLDACXQ .

sammyke007 commented 3 years ago

I was afraid to test it, but I got a dialog asking where to save settings.txt and... it saved correctly! Most important, order is still ok! I guess you found it!

galadril commented 3 years ago

That would be cool..

Op wo 11 nov. 2020 om 11:07 schreef sammyke007 notifications@github.com:

I was afraid to test it, but I got a dialog asking where to save settings.txt and... it saved correctly! Most important, order is still ok! I guess you found it!

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/domoticz/domoticz-android/issues/606#issuecomment-725331158, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPDC2BTQGQGZGTIPKAAPHLSPJO7TANCNFSM4TLDACXQ .

galadril commented 3 years ago

I need an Android 11 device... my device didn't received the update yet... I would love to implement this new Android 11 feature https://github.com/domoticz/domoticz-android/issues/599

But this feature isn't available in an Emulator......

sammyke007 commented 3 years ago

Looks nice... What device do you have. I'm a huge Oneplus fan.

galadril commented 3 years ago

I have a Poco F2 Pro currently, and a Mi A2 / Mi 8 to test/use

Op wo 11 nov. 2020 om 11:37 schreef sammyke007 notifications@github.com:

Looks nice... What device do you have. I'm a huge Oneplus fan.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/domoticz/domoticz-android/issues/606#issuecomment-725346036, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPDC2BBRVOJCB6Q5J5ZQKLSPJSPRANCNFSM4TLDACXQ .

sammyke007 commented 3 years ago

Since latest beta, sorting keeps OK/saved and exporting settings works fine without crashing. Don't know what the last thing was that you changed, but I guess that did it (for me). Tnx!

galadril commented 3 years ago

cool. Ill make a new prod release then ;)

Op do 12 nov. 2020 om 12:59 schreef sammyke007 notifications@github.com:

Since latest beta, sorting keeps OK/saved and exporting settings works fine without crashing. Don't know what the last thing was that you changed, but I guess that did it (for me). Tnx!

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/domoticz/domoticz-android/issues/606#issuecomment-726034561, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPDC2AU7XX2EPTPR7RKVADSPPE23ANCNFSM4TLDACXQ .

sammyke007 commented 3 years ago

Fine! You can always contact me for testing on Android 11 (or other things).

galadril commented 3 years ago

Cool tx

Op do 12 nov. 2020 om 13:12 schreef sammyke007 notifications@github.com:

Fine! You can always contact me for testing on Android 11 (or other things).

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/domoticz/domoticz-android/issues/606#issuecomment-726040215, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPDC2AEKDCO5IHOAE5XYPLSPPGJ3ANCNFSM4TLDACXQ .

galadril commented 3 years ago

Hi @sammyke007,

Im working on the External Controls feature of Android 11. Would you like to try something out on your device?

can you send me an email?

sammyke007 commented 3 years ago

Offcourse! Where to?

galadril commented 3 years ago

domoticz@hnogames.nl