mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-30 13:52:58 -08:00
Change breadcrumb UI
This commit is contained in:
1 parent
66db2e7d16
commit
39927b06e3
7 files changed
+27
-26
No files matched your search
@@ -25,7 +25,6 @@ import android.app.TimePickerDialog
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.*
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
@@ -86,7 +85,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
private var coordinatorLayout: CoordinatorLayout? = null
|
||||
private var lockView: View? = null
|
||||
private var toolbar: Toolbar? = null
|
||||
private var toolbarTitleView: TextView? = null
|
||||
private var databaseNameView: TextView? = null
|
||||
private var breadcrumbToolbar: Toolbar? = null
|
||||
private var searchTitleView: View? = null
|
||||
private var toolbarAction: ToolbarAction? = null
|
||||
@@ -141,7 +140,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
numberChildrenView = findViewById(R.id.group_numbers)
|
||||
addNodeButtonView = findViewById(R.id.add_node_button)
|
||||
toolbar = findViewById(R.id.toolbar)
|
||||
toolbarTitleView = findViewById(R.id.toolbar_title)
|
||||
databaseNameView = findViewById(R.id.database_name)
|
||||
breadcrumbToolbar = findViewById(R.id.toolbar_breadcrumb)
|
||||
searchTitleView = findViewById(R.id.search_title)
|
||||
breadcrumbListView = findViewById(R.id.breadcrumb_list)
|
||||
@@ -389,7 +388,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
|
||||
// Search suggestion
|
||||
database?.let {
|
||||
toolbarTitleView?.text = it.name
|
||||
databaseNameView?.text = it.name
|
||||
mSearchSuggestionAdapter = SearchEntryCursorAdapter(this, it)
|
||||
mBreadcrumbAdapter?.iconDrawableFactory = it.iconDrawableFactory
|
||||
mOnSuggestionListener = object : SearchView.OnSuggestionListener {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.kunzisoft.keepass.adapters
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
@@ -20,6 +21,7 @@ class BreadcrumbAdapter(val context: Context)
|
||||
|
||||
private val inflater: LayoutInflater = LayoutInflater.from(context)
|
||||
var iconDrawableFactory: IconDrawableFactory? = null
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
set(value) {
|
||||
field = value
|
||||
notifyDataSetChanged()
|
||||
@@ -41,6 +43,7 @@ class BreadcrumbAdapter(val context: Context)
|
||||
taTextColor.recycle()
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun setNode(node: Node) {
|
||||
mNodeBreadcrumb.clear()
|
||||
var currentNode = node
|
||||
@@ -79,10 +82,11 @@ class BreadcrumbAdapter(val context: Context)
|
||||
node.title.isEmpty() -> context.getString(R.string.root)
|
||||
else -> node.title
|
||||
}
|
||||
setOnClickListener {
|
||||
node?.let {
|
||||
onItemClickListener?.invoke(it, position)
|
||||
}
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener {
|
||||
node?.let {
|
||||
onItemClickListener?.invoke(it, position)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user