diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/fileManager/ManageFiles.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/fileManager/ManageFiles.kt index d165e52a..1b296be8 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/fileManager/ManageFiles.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/fileManager/ManageFiles.kt @@ -4,15 +4,15 @@ import android.content.Context import it.unitn.disi.lpsmt.g03.mangacheck.utils.xml.LibraryEntry import java.io.File -class ManageFiles(private val context: Context){ +class ManageFiles(private val context: Context) { /** * Create library folder to contains chapter associated with that library * @param [library] LibraryEntry to associate with a directory */ - fun createLibraryFolder(library: LibraryEntry){ + fun createLibraryFolder(library: LibraryEntry) { val libraryDir = File(context.filesDir, library.id.toString()) - if(!libraryDir.isDirectory){ + if (!libraryDir.isDirectory) { libraryDir.mkdir() } } @@ -21,9 +21,9 @@ class ManageFiles(private val context: Context){ * Delete the files associated ith a library * @param [library] entry associated with folder to delete */ - fun deleteLibraryFolder(library: LibraryEntry){ + fun deleteLibraryFolder(library: LibraryEntry) { val libraryDir = File(context.filesDir, library.id.toString()) - if (libraryDir.isDirectory){ + if (libraryDir.isDirectory) { libraryDir.deleteRecursively() } } @@ -31,9 +31,9 @@ class ManageFiles(private val context: Context){ /** * Create cache folder for cover images */ - fun createImageCacheFolder(){ + fun createImageCacheFolder() { val imageCache = File(context.cacheDir, "image") - if(!imageCache.isDirectory){ + if (!imageCache.isDirectory) { imageCache.mkdir() } } diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/formatterQuery/QueryResult.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/formatterQuery/QueryResult.kt index e1948873..c081baeb 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/formatterQuery/QueryResult.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/formatterQuery/QueryResult.kt @@ -21,11 +21,9 @@ class QueryResult { } var indexOfFormattedResponse = 0 for (index in listOfValues.indices step 2) { - formattedResponse[indexOfFormattedResponse][0] = - listOfValues[index] //id + formattedResponse[indexOfFormattedResponse][0] = listOfValues[index] //id formattedResponse[indexOfFormattedResponse][1] = - listOfValues[index + 1].removePrefix(" ").removeSurrounding("\'") - .removeSurrounding("\"") //name + listOfValues[index + 1].removePrefix(" ").removeSurrounding("\'").removeSurrounding("\"") //name indexOfFormattedResponse += 1 } return formattedResponse diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/http/ServerRequest.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/http/ServerRequest.kt index 197b1015..72818e3b 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/http/ServerRequest.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/http/ServerRequest.kt @@ -112,7 +112,7 @@ class ServerRequest(private val context: Context, private val mangaID: Int?) { return descriptionToReturn } - // Prepare a delicious Toast for you + /**Prepare a delicious Toast for you*/ private fun toaster(msg: String) { Toast.makeText(context, msg, Toast.LENGTH_SHORT).show() } diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/image/ImageManager.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/image/ImageManager.kt index a3f2c6bb..98a21092 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/image/ImageManager.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/image/ImageManager.kt @@ -13,7 +13,7 @@ import java.io.File class ImageManager { /** - * Verify the cache hit ot miss, if is a miss make the image request + * Verify the cache hit or miss, where there is a miss make the image request */ fun retrieveImage(context: Context, id: Int): Bitmap? { val imageFile = File(context.cacheDir, "image/$id") diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/ChapterEntry.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/ChapterEntry.kt index b48d9458..f2d9d513 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/ChapterEntry.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/ChapterEntry.kt @@ -2,6 +2,7 @@ package it.unitn.disi.lpsmt.g03.mangacheck.utils.xml /** * The basic XML entry. + * * It contains all the data that can be useful to manipulate a chapter. */ data class ChapterEntry(val num: Int, val title: String) diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/LibraryEntry.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/LibraryEntry.kt index 64b1a827..bd8f0ead 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/LibraryEntry.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/LibraryEntry.kt @@ -2,6 +2,7 @@ package it.unitn.disi.lpsmt.g03.mangacheck.utils.xml /** * The basic XML entry. + * * It contains all the data that can be useful to manipulate a library. */ data class LibraryEntry(val title: String?, val id: Int) \ No newline at end of file diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/MangaEntry.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/MangaEntry.kt index 390a8c1c..93ae0c82 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/MangaEntry.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/MangaEntry.kt @@ -2,7 +2,7 @@ package it.unitn.disi.lpsmt.g03.mangacheck.utils.xml /** * The basic XML entry. + * * It contains all the data that can be useful to manipulate a comic. */ - -data class MangaEntry(var list: String, val title: String?, val id: Int, val description : String?) \ No newline at end of file +data class MangaEntry(var list: String, val title: String?, val id: Int, val description: String?) \ No newline at end of file diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/XMLEncoder.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/XMLEncoder.kt index 5d744b5b..7bb28030 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/XMLEncoder.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/XMLEncoder.kt @@ -3,11 +3,20 @@ package it.unitn.disi.lpsmt.g03.mangacheck.utils.xml /** * Interface for the various implementation of the Encoder */ -interface XMLEncoder{ +interface XMLEncoder { - fun addEntry(entry : T) + /** + * Add an entry to the class dependent xml file + */ + fun addEntry(entry: T) - fun removeEntry(entry : T) + /** + * Remove an entry to the class dependent xml file + */ + fun removeEntry(entry: T) - fun modifyEntry(entry : T, fieldName : String, newValue: String) + /** + * Modify an entry to the class dependent xml file + */ + fun modifyEntry(entry: T, fieldName: String, newValue: String) } \ No newline at end of file diff --git a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/XMLParser.kt b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/XMLParser.kt index 0984be4d..1888701c 100644 --- a/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/XMLParser.kt +++ b/implementation/mangaCheck/app/src/main/java/it/unitn/disi/lpsmt/g03/mangacheck/utils/xml/XMLParser.kt @@ -4,7 +4,13 @@ package it.unitn.disi.lpsmt.g03.mangacheck.utils.xml * Interface for the various implementation of the Parser */ interface XMLParser { + /** + * Parse the class dependent xml file + */ fun parse(): MutableList + /** + * Check if [entry] is already in the xml + */ fun alreadyInList(entry: T): Boolean } \ No newline at end of file