mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Change breadcrumb UI
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,9 @@
|
||||
android:layout_below="@+id/special_mode_view"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="?attr/toolbarAppearance"
|
||||
android:elevation="4dp"
|
||||
tools:targetApi="lollipop">
|
||||
tools:targetApi="lollipop" >
|
||||
<TextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:id="@+id/database_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/KeepassDXStyle.TextAppearance.Title.TextOnPrimary" />
|
||||
@@ -61,7 +60,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:layout_above="@+id/toolbar_action"
|
||||
android:elevation="4dp"
|
||||
tools:targetApi="lollipop">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="144dp"
|
||||
android:layout_marginTop="?attr/actionBarSize">
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary">
|
||||
<ImageView
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="96dp"
|
||||
|
||||
@@ -22,18 +22,18 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/breadcrumb_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:baselineAligned="false">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/group_icon"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:scaleType="fitXY" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -55,5 +55,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/"
|
||||
style="@style/KeepassDXStyle.TextAppearance.SubTitle.TextOnPrimary"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -22,17 +22,15 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/breadcrumb_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:baselineAligned="false">
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:gravity="center_vertical">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/group_icon"
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
</style>
|
||||
<style name="KeepassDXStyle.TextAppearance.SubTitle.TextOnPrimary" parent="KeepassDXStyle.TextAppearance.Default.TextOnPrimary">
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textStyle">normal</item>
|
||||
</style>
|
||||
<style name="KeepassDXStyle.TextAppearance.Meta.TextOnPrimary" parent="KeepassDXStyle.TextAppearance.Default.TextOnPrimary">
|
||||
<item name="android:textSize">11sp</item>
|
||||
|
||||
Reference in New Issue
Block a user