Added add to library dialog when downloading from catalogue (#618)

* Now show snackbar when adding from catalogue

* Code cleanup + added manga favorite event to update favorite drawable when added via snack

* Update SettingsAdvancedFragment.kt

Forgot to check optimize import. I think(hope) I got them all ;).

* Now uses PublishRelay. Manga favorite is now handled in info presenter

* Update MangaInfoFragment.kt
This commit is contained in:
Bram van de Kerkhof
2017-01-08 20:07:19 +01:00
committed by inorichi
parent 07cae4d684
commit 72f8c4d5e2
14 changed files with 134 additions and 49 deletions

View File

@@ -23,7 +23,7 @@ object ChapterRecognition {
* Regex used when manga title removed
* Example: Solanin 028 Vol. 2 -> 028 Vol.2 -> 028Vol.2 -R> 028
*/
private val withoutMange = Regex("""^([0-9]+)(\.[0-9]+)?(\.?[a-z]+)?""")
private val withoutManga = Regex("""^([0-9]+)(\.[0-9]+)?(\.?[a-z]+)?""")
/**
* Regex used to remove unwanted tags
@@ -77,7 +77,7 @@ object ChapterRecognition {
val nameWithoutManga = name.replace(manga.title.toLowerCase(), "").trim()
// Check if first value is number after title remove.
if (updateChapter(withoutMange.find(nameWithoutManga), chapter))
if (updateChapter(withoutManga.find(nameWithoutManga), chapter))
return
// Take the first number encountered.
@@ -123,7 +123,7 @@ object ChapterRecognition {
if (alpha.contains("special"))
return .97f
if (alpha[0].equals('.') ) {
if (alpha[0] == '.') {
// Take value after (.)
return parseAlphaPostFix(alpha[1])
} else {