From d6f213563be35b183f81e20e95d925dbd65e4694 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 27 Jul 2019 20:14:05 -0700 Subject: Add braces to non assignment if statements --- about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt | 8 ++++++-- about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'about/src/main') diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt index 452d28c..f7eddb9 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt @@ -69,7 +69,9 @@ abstract class AboutActivityBase(val rClass: Class<*>?, private val configBuilde val panels: List by lazy { val defaultPanels = mutableListOf(AboutPanelMain(), AboutPanelLibs()) - if (configs.faqXmlRes != INVALID_ID) defaultPanels.add(AboutPanelFaqs()) + if (configs.faqXmlRes != INVALID_ID) { + defaultPanels.add(AboutPanelFaqs()) + } defaultPanels } @@ -78,7 +80,9 @@ abstract class AboutActivityBase(val rClass: Class<*>?, private val configBuilde setContentView(R.layout.kau_activity_about) pageStatus = IntArray(panels.size) pageStatus[0] = 2 //the first page is instantly visible - if (configs.textColor != null) about_indicator.setColour(configs.textColor!!) + if (configs.textColor != null) { + about_indicator.setColour(configs.textColor!!) + } with(about_pager) { adapter = AboutPagerAdapter() pageMargin = dimenPixelSize(R.dimen.kau_spacing_normal) diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt index 275945b..cd53f55 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt @@ -43,13 +43,14 @@ class LibraryIItem(val lib: Library) : KauIItem( fun bindEvents(fastAdapter: FastAdapter) { fastAdapter.getSelectExtension().isSelectable = true fastAdapter.onClickListener = { v, _, item, _ -> - if (item !is LibraryIItem) + if (item !is LibraryIItem) { false - else + } else { with(item.lib) { v!!.context.startLink(libraryWebsite, repositoryLink, authorWebsite) true } + } } } } -- cgit v1.2.3