add handling for limiting long folder titles to 1 line

This commit is contained in:
tibbi 2020-11-08 21:10:37 +01:00
parent 5573a4eb18
commit e37fe3ab37
3 changed files with 6 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import android.content.pm.ShortcutInfo
import android.content.pm.ShortcutManager import android.content.pm.ShortcutManager
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Icon import android.graphics.drawable.Icon
import android.text.TextUtils
import android.view.Menu import android.view.Menu
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -720,6 +721,11 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
photo_cnt.text = directory.subfoldersMediaCount.toString() photo_cnt.text = directory.subfoldersMediaCount.toString()
photo_cnt.beVisibleIf(showMediaCount == FOLDER_MEDIA_CNT_LINE) photo_cnt.beVisibleIf(showMediaCount == FOLDER_MEDIA_CNT_LINE)
if (config.limitFolderTitle) {
dir_name.setSingleLine()
dir_name.ellipsize = TextUtils.TruncateAt.MIDDLE
}
var nameCount = directory.name var nameCount = directory.name
if (showMediaCount == FOLDER_MEDIA_CNT_BRACKETS) { if (showMediaCount == FOLDER_MEDIA_CNT_BRACKETS) {
nameCount += " (${directory.subfoldersMediaCount})" nameCount += " (${directory.subfoldersMediaCount})"

View File

@ -62,9 +62,7 @@
android:layout_below="@+id/dir_thumbnail" android:layout_below="@+id/dir_thumbnail"
android:layout_alignStart="@+id/dir_thumbnail" android:layout_alignStart="@+id/dir_thumbnail"
android:layout_toStartOf="@+id/dir_location" android:layout_toStartOf="@+id/dir_location"
android:ellipsize="middle"
android:paddingTop="@dimen/medium_margin" android:paddingTop="@dimen/medium_margin"
android:singleLine="true"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/normal_text_size" android:textSize="@dimen/normal_text_size"
tools:text="Camera" /> tools:text="Camera" />

View File

@ -83,8 +83,6 @@
android:id="@+id/dir_name" android:id="@+id/dir_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:paddingBottom="@dimen/small_margin" android:paddingBottom="@dimen/small_margin"
android:shadowColor="@color/default_background_color" android:shadowColor="@color/default_background_color"
android:shadowRadius="4" android:shadowRadius="4"