Merge pull request #135 from esensar/fix/131-folder-widget-overlap
Draw home screen grid over widgets
This commit is contained in:
commit
f5d4949728
|
@ -920,6 +920,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
||||||
post {
|
post {
|
||||||
setWillNotDraw(false)
|
setWillNotDraw(false)
|
||||||
invalidate()
|
invalidate()
|
||||||
|
binding.drawingArea.invalidate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,9 +928,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
||||||
|
|
||||||
private fun getFakeHeight() = height - sideMargins.top - sideMargins.bottom
|
private fun getFakeHeight() = height - sideMargins.top - sideMargins.bottom
|
||||||
|
|
||||||
@SuppressLint("DrawAllocation")
|
fun drawInto(canvas: Canvas) {
|
||||||
override fun onDraw(canvas: Canvas) {
|
|
||||||
super.onDraw(canvas)
|
|
||||||
if (cells.isEmpty()) {
|
if (cells.isEmpty()) {
|
||||||
fillCellSizes()
|
fillCellSizes()
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.simplemobiletools.launcher.views
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Canvas
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
|
||||||
|
class HomeScreenGridDrawingArea @JvmOverloads constructor(
|
||||||
|
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||||
|
) : View(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
|
override fun onDraw(canvas: Canvas) {
|
||||||
|
super.onDraw(canvas)
|
||||||
|
(parent as HomeScreenGrid).drawInto(canvas)
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,6 +4,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!-- Drawing area with Z translation so it is drawn over widgets -->
|
||||||
|
<com.simplemobiletools.launcher.views.HomeScreenGridDrawingArea
|
||||||
|
android:id="@+id/drawing_area"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:translationZ="1dp"/>
|
||||||
|
|
||||||
<com.simplemobiletools.launcher.views.MyAppWidgetResizeFrame
|
<com.simplemobiletools.launcher.views.MyAppWidgetResizeFrame
|
||||||
android:id="@+id/resize_frame"
|
android:id="@+id/resize_frame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue