show a folder icon at search results folder too

This commit is contained in:
tibbi 2021-01-16 11:33:31 +01:00
parent e8f30a2bbf
commit cbd092862f
2 changed files with 36 additions and 8 deletions

View file

@ -704,6 +704,8 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
val isSelected = selectedKeys.contains(listItem.path.hashCode())
view.apply {
if (listItem.isSectionTitle) {
item_icon.setImageDrawable(folderDrawable)
item_section.text = listItem.mName
item_section.setTextColor(textColor)
item_section.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize)

View file

@ -1,13 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_section"
android:id="@+id/item_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin"
android:textSize="@dimen/bigger_text_size"
tools:text="/storage/emulated/0" />
android:clickable="true"
android:focusable="true"
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/tiny_margin">
<RelativeLayout
android:id="@+id/item_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/activity_margin">
<ImageView
android:id="@+id/item_icon"
android:layout_width="@dimen/file_picker_icon_size"
android:layout_height="@dimen/file_picker_icon_size"
android:layout_centerVertical="true"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_folder_vector" />
<TextView
android:id="@+id/item_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/item_icon"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin"
android:textSize="@dimen/bigger_text_size"
tools:text="/storage/emulated/0" />
</RelativeLayout>
</FrameLayout>