mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-04-05 22:01:02 +02:00
allow 2 lines long app titles
This commit is contained in:
parent
d86d35aa96
commit
434d79d46f
@ -3,7 +3,6 @@ package com.simplemobiletools.launcher.adapters
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.ViewTreeObserver
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
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.commons.extensions.realScreenSize
|
||||||
import com.simplemobiletools.launcher.R
|
import com.simplemobiletools.launcher.R
|
||||||
import com.simplemobiletools.launcher.activities.SimpleActivity
|
import com.simplemobiletools.launcher.activities.SimpleActivity
|
||||||
import com.simplemobiletools.launcher.extensions.getColumnCount
|
|
||||||
import com.simplemobiletools.launcher.interfaces.AllAppsListener
|
import com.simplemobiletools.launcher.interfaces.AllAppsListener
|
||||||
import com.simplemobiletools.launcher.models.AppLauncher
|
import com.simplemobiletools.launcher.models.AppLauncher
|
||||||
import kotlinx.android.synthetic.main.item_launcher_label.view.*
|
import kotlinx.android.synthetic.main.item_launcher_label.view.*
|
||||||
@ -31,7 +29,6 @@ class LaunchersAdapter(
|
|||||||
|
|
||||||
private var textColor = activity.getProperTextColor()
|
private var textColor = activity.getProperTextColor()
|
||||||
private var iconPadding = 0
|
private var iconPadding = 0
|
||||||
private var wasManualScrollPositionSet = false
|
|
||||||
private var wereFreshIconsLoaded = false
|
private var wereFreshIconsLoaded = false
|
||||||
|
|
||||||
init {
|
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
|
return itemView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
android:layout_below="@+id/launcher_icon"
|
android:layout_below="@+id/launcher_icon"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center_horizontal|top"
|
android:gravity="center_horizontal|top"
|
||||||
android:maxLines="1"
|
android:maxLines="2"
|
||||||
android:textSize="@dimen/smaller_text_size" />
|
android:textSize="@dimen/smaller_text_size" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user