show folder path at the list view

This commit is contained in:
tibbi 2017-09-29 21:57:24 +02:00
parent 9947d661a3
commit d7eaaa070d
2 changed files with 17 additions and 2 deletions

View File

@ -23,7 +23,7 @@ import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.VIEW_TYPE_LIST
import com.simplemobiletools.gallery.models.AlbumCover
import com.simplemobiletools.gallery.models.Directory
import kotlinx.android.synthetic.main.directory_item_grid.view.*
import kotlinx.android.synthetic.main.directory_item_list.view.*
import java.io.File
import java.util.*
@ -397,6 +397,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
fun bindView(directory: Directory, isPinned: Boolean, scrollVertically: Boolean): View {
itemView.apply {
dir_name.text = directory.name
dir_path?.text = "${directory.path.substringBeforeLast("/")}/"
photo_cnt.text = directory.mediaCnt.toString()
activity.loadImage(directory.tmb, dir_thumbnail, scrollVertically)
dir_pin.beVisibleIf(isPinned)

View File

@ -36,6 +36,20 @@
android:textColor="@android:color/white"
android:textSize="@dimen/bigger_text_size"/>
<TextView
android:id="@+id/dir_path"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/dir_name"
android:layout_below="@+id/dir_name"
android:layout_marginRight="@dimen/activity_margin"
android:alpha="0.4"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="6dp"
android:textColor="@android:color/white"
android:textSize="@dimen/smaller_text_size"/>
<TextView
android:id="@+id/photo_cnt"
android:layout_width="match_parent"
@ -79,8 +93,8 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignBottom="@+id/dir_thumbnail"
android:layout_toRightOf="@+id/dir_thumbnail"
android:layout_marginTop="2dp"
android:layout_toRightOf="@+id/dir_thumbnail"
android:background="@drawable/divider"/>
</RelativeLayout>