diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/HiddenIconsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/HiddenIconsActivity.kt index 8708579..c45dc41 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/HiddenIconsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/HiddenIconsActivity.kt @@ -26,7 +26,12 @@ class HiddenIconsActivity : SimpleActivity(), RefreshRecyclerViewListener { setContentView(binding.root) updateIcons() - updateMaterialActivityViews(binding.manageHiddenIconsCoordinator, binding.manageHiddenIconsList, useTransparentNavigation = true, useTopSearchMenu = false) + updateMaterialActivityViews( + binding.manageHiddenIconsCoordinator, + binding.manageHiddenIconsList, + useTransparentNavigation = true, + useTopSearchMenu = false + ) setupMaterialScrollListener(binding.manageHiddenIconsList, binding.manageHiddenIconsToolbar) val layoutManager = binding.manageHiddenIconsList.layoutManager as MyGridLayoutManager diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/views/MyAppWidgetHostView.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/views/MyAppWidgetHostView.kt index 082cd49..13e7ad6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/MyAppWidgetHostView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/MyAppWidgetHostView.kt @@ -47,10 +47,12 @@ class MyAppWidgetHostView(context: Context) : AppWidgetHostView(context) { currentCoords.y = event.rawY actionDownMS = System.currentTimeMillis() } + MotionEvent.ACTION_MOVE -> { currentCoords.x = event.rawX currentCoords.y = event.rawY } + MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { longPressHandler.removeCallbacksAndMessages(null) } diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/views/MyAppWidgetResizeFrame.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/views/MyAppWidgetResizeFrame.kt index 6bb0ddf..98f2ea4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/MyAppWidgetResizeFrame.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/MyAppWidgetResizeFrame.kt @@ -123,6 +123,7 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In dragDirection = DRAGGING_BOTTOM } } + MotionEvent.ACTION_MOVE -> { val minWidth = minResizeWidthCells * cellWidth val minHeight = minResizeHeightCells * cellHeight @@ -153,6 +154,7 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In frameRect.left = wantedLeft } + DRAGGING_TOP -> { val newHeight = frameRect.bottom - event.rawY.toInt() val wantedTop = if (newHeight >= minHeight) { @@ -179,6 +181,7 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In frameRect.top = wantedTop } + DRAGGING_RIGHT -> { val newWidth = event.rawX.toInt() - frameRect.left val wantedRight = if (newWidth >= minWidth) { @@ -205,6 +208,7 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In frameRect.right = wantedRight } + DRAGGING_BOTTOM -> { val newHeight = event.rawY.toInt() - frameRect.top val wantedBottom = if (newHeight >= minHeight) { @@ -241,6 +245,7 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In redrawFrame() } } + MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { if (dragDirection == DRAGGING_NONE) { onClickListener?.invoke() @@ -269,6 +274,7 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In frameRect.left = cellsRect.left * cellWidth + sideMargins.left } } + DRAGGING_TOP -> { val wantedTop = roundToClosestMultiplyOfNumber(frameRect.top - sideMargins.top, cellHeight) val wantedTopCellY = wantedTop / cellHeight @@ -289,6 +295,7 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In frameRect.top = cellsRect.top * cellHeight + sideMargins.top } } + DRAGGING_RIGHT -> { val wantedRight = roundToClosestMultiplyOfNumber(frameRect.right - sideMargins.left, cellWidth) val wantedRightCellX = wantedRight / cellWidth - 1 @@ -309,6 +316,7 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In frameRect.right = (cellsRect.right + 1) * cellWidth + sideMargins.left } } + DRAGGING_BOTTOM -> { val wantedBottom = roundToClosestMultiplyOfNumber(frameRect.bottom - sideMargins.top, cellHeight) val wantedBottomCellY = wantedBottom / cellHeight - 1