Closed Merkost closed 1 year ago
hm, that seems like too much code change for moving import and export buttons in the app settings O.o Why are there so many changes in the helper exporter and importer files too?
Keeping the apps consistent. Rather manually reading json with error-prone while (jsonReader.hasNext()) { try { if (msgType.equals("sms")) { ... } } }
we are using kotlin serialization plugin right now as in other apps like dialer and contacts.
For example, the same code for json reading looks like this now (only one line of code to read whole json) Json.decodeFromString<List<MessagesBackup>>(jsonString)
It will keep the code clean and reduce exposure to errors. Also maintaining the code will be much easier in the future Moreover, ActivityResultContracts were used to open or save file as that onActivityResultMethod is deprecated and pickers could be used only like that now
make sure you test the exporting/importing in release mode with proguard too, if you do anything with jsons or models
make sure you test the exporting/importing in release mode with proguard too, if you do anything with jsons or models
Right. Just made it.
if I click on Import messages, then pick a file and the Import messages dialog with sms/mms options are shown, "Importing..." toast already shows. But it shouldnt show yet, only after confirming the Import messages dialog.
if I click on Import messages, then pick a file and the Import messages dialog with sms/mms options are shown, "Importing..." toast already shows. But it shouldnt show yet, only after confirming the Import messages dialog.
When we are importing xml - the importing toast shows before we start reading the file. Other cases (jsons) - we read the file and show the dialog. Once the user has selected what to import in the dialog box, we show the import toast.
Also, the dialog shows importSms and importMms checkboxes every time, regardless of whether the mms is in the backup or not, for example. Do we need to cover this behaviour or just leave it as it is?
And the import functions are handled differently So, with json it is like that: Read json -> Show dialog -> Restore messages. Xml import is like: Read xml and restore messages (in one separate function).
Do we need to divide this logic for xml too in order to make it as Read xml -> Restore messages?
I think that xml cannot contain mms at all, at least we arent handling that. If importing works well, keep it as it is, will check moved Importing... message.
Also added invalid format toast if some error occurred while reading xml file
ok should be good, thanks
hm, that seems like too much code change for moving import and export buttons in the app settings O.o Why are there so many changes in the helper exporter and importer files too?