aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/enums
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-12-29 15:50:22 -0800
committerGitHub <noreply@github.com>2019-12-29 15:50:22 -0800
commit0828e8fceec86333f81d5b8cf204184ecc58f0ef (patch)
tree52c2bef109a430aac85c03494a5fd4515e4455e5 /app/src/main/kotlin/com/pitchedapps/frost/enums
parentee68ef07ca0f0afd00bfe32f7e7dbba8ef6a6ae2 (diff)
parent597c884d88b8716d49e0abb00674ce44699df08b (diff)
downloadfrost-0828e8fceec86333f81d5b8cf204184ecc58f0ef.tar.gz
frost-0828e8fceec86333f81d5b8cf204184ecc58f0ef.tar.bz2
frost-0828e8fceec86333f81d5b8cf204184ecc58f0ef.zip
Merge pull request #1601 from AllanWang/nav-rewrite
Nav rewrite
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/enums')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/enums/MainActivityLayout.kt5
1 files changed, 1 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/enums/MainActivityLayout.kt b/app/src/main/kotlin/com/pitchedapps/frost/enums/MainActivityLayout.kt
index a3a4c1a4..92aa93ab 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/enums/MainActivityLayout.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/enums/MainActivityLayout.kt
@@ -24,23 +24,20 @@ import com.pitchedapps.frost.utils.Prefs
*/
enum class MainActivityLayout(
val titleRes: Int,
- val layoutRes: Int,
val backgroundColor: () -> Int,
val iconColor: () -> Int
) {
TOP_BAR(R.string.top_bar,
- R.layout.activity_main,
{ Prefs.headerColor },
{ Prefs.iconColor }),
BOTTOM_BAR(R.string.bottom_bar,
- R.layout.activity_main_bottom_tabs,
{ Prefs.bgColor },
{ Prefs.textColor });
companion object {
val values = values() // save one instance
- operator fun invoke(index: Int) = values[index]
+ operator fun invoke(index: Int) = values.getOrElse(index) { TOP_BAR }
}
}