Address minor Kotlin compiler warnings

This commit is contained in:
Eugene
2019-12-26 17:48:39 -05:00
parent c349fb0e37
commit c339bd49d0
16 changed files with 29 additions and 30 deletions

View File

@@ -91,7 +91,7 @@ object ChapterRecognition {
* @param chapter chapter object
* @return true if volume is found
*/
fun updateChapter(match: MatchResult?, chapter: SChapter): Boolean {
private fun updateChapter(match: MatchResult?, chapter: SChapter): Boolean {
match?.let {
val initial = it.groups[1]?.value?.toFloat()!!
val subChapterDecimal = it.groups[2]?.value
@@ -109,12 +109,12 @@ object ChapterRecognition {
* @param alpha alpha value of regex
* @return decimal/alpha float value
*/
fun checkForDecimal(decimal: String?, alpha: String?): Float {
private fun checkForDecimal(decimal: String?, alpha: String?): Float {
if (!decimal.isNullOrEmpty())
return decimal?.toFloat()!!
return decimal.toFloat()
if (!alpha.isNullOrEmpty()) {
if (alpha!!.contains("extra"))
if (alpha.contains("extra"))
return .99f
if (alpha.contains("omake"))
@@ -138,7 +138,7 @@ object ChapterRecognition {
* x.a -> x.1, x.b -> x.2, etc
*/
private fun parseAlphaPostFix(alpha: Char): Float {
return ("0." + Integer.toString(alpha.toInt() - 96)).toFloat()
return ("0." + (alpha.toInt() - 96).toString()).toFloat()
}
}

View File

@@ -172,11 +172,11 @@ fun Context.isServiceRunning(serviceClass: Class<*>): Boolean {
*/
fun Context.openInBrowser(url: String) {
try {
val url = Uri.parse(url)
val parsedUrl = Uri.parse(url)
val intent = CustomTabsIntent.Builder()
.setToolbarColor(getResourceColor(R.attr.colorPrimary))
.build()
intent.launchUrl(this, url)
intent.launchUrl(this, parsedUrl)
} catch (e: Exception) {
toast(e.message)
}