From 849d124d534d5efeb85d9e7e7d2fd48c7e15acfa Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Jul 2017 12:13:47 +0200 Subject: [PATCH] some style update at breadcrumbs --- .../commons/views/Breadcrumbs.kt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/views/Breadcrumbs.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/views/Breadcrumbs.kt index 0b371428e..e44d9685b 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/views/Breadcrumbs.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/views/Breadcrumbs.kt @@ -125,17 +125,18 @@ class Breadcrumbs(context: Context, attrs: AttributeSet) : LinearLayout(context, } private fun addBreadcrumb(item: FileDirItem, addPrefix: Boolean) { - val view = mInflater.inflate(R.layout.breadcrumb_item, null, false) - var textToAdd = item.name - if (addPrefix) - textToAdd = " -> " + textToAdd + mInflater.inflate(R.layout.breadcrumb_item, null, false).apply { + var textToAdd = item.name + if (addPrefix) + textToAdd = " -> $textToAdd" - view.breadcrumb_text.text = textToAdd - view.breadcrumb_text.setTextColor(mTextColor) - addView(view) - view.setOnClickListener(this) + breadcrumb_text.text = textToAdd + breadcrumb_text.setTextColor(mTextColor) + addView(this) + setOnClickListener(this@Breadcrumbs) - view.tag = item + tag = item + } } fun removeBreadcrumb() {