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

View file

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

View file

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