allow 2 lines long app titles

This commit is contained in:
tibbi 2022-09-25 18:48:50 +02:00
parent d86d35aa96
commit 434d79d46f
2 changed files with 1 additions and 17 deletions

View File

@ -3,7 +3,6 @@ package com.simplemobiletools.launcher.adapters
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.ViewTreeObserver
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
@ -16,7 +15,6 @@ import com.simplemobiletools.commons.extensions.portrait
import com.simplemobiletools.commons.extensions.realScreenSize
import com.simplemobiletools.launcher.R
import com.simplemobiletools.launcher.activities.SimpleActivity
import com.simplemobiletools.launcher.extensions.getColumnCount
import com.simplemobiletools.launcher.interfaces.AllAppsListener
import com.simplemobiletools.launcher.models.AppLauncher
import kotlinx.android.synthetic.main.item_launcher_label.view.*
@ -31,7 +29,6 @@ class LaunchersAdapter(
private var textColor = activity.getProperTextColor()
private var iconPadding = 0
private var wasManualScrollPositionSet = false
private var wereFreshIconsLoaded = false
init {
@ -96,19 +93,6 @@ class LaunchersAdapter(
}
}
if (!wasManualScrollPositionSet) {
itemView.launcher_holder.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
itemView.launcher_holder.viewTreeObserver.removeOnGlobalLayoutListener(this)
if (!wasManualScrollPositionSet) {
val rowCount = Math.ceil(launchers.size / activity.getColumnCount().toDouble()).toInt()
fastScroller.fullContentHeight = rowCount * itemView.height
fastScroller.calculateScrollPositionManually = true
}
}
})
}
return itemView
}
}

View File

@ -24,7 +24,7 @@
android:layout_below="@+id/launcher_icon"
android:ellipsize="end"
android:gravity="center_horizontal|top"
android:maxLines="1"
android:maxLines="2"
android:textSize="@dimen/smaller_text_size" />
</RelativeLayout>