mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-01-30 15:35:07 +01:00
Fix anchor positioning on all apps fragment and home screen
This commit is contained in:
parent
73b7638a93
commit
7f787cef08
@ -523,11 +523,11 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||||||
home_screen_grid.hideResizeLines()
|
home_screen_grid.hideResizeLines()
|
||||||
mLongPressedIcon = gridItem
|
mLongPressedIcon = gridItem
|
||||||
val anchorY = if (isOnAllAppsFragment || gridItem.type == ITEM_TYPE_WIDGET) {
|
val anchorY = if (isOnAllAppsFragment || gridItem.type == ITEM_TYPE_WIDGET) {
|
||||||
y
|
val iconSize = realScreenSize.x / config.drawerColumnCount
|
||||||
} else if (gridItem.top == config.homeRowCount - 1) {
|
y - iconSize / 2f
|
||||||
home_screen_grid.sideMargins.top + (gridItem.top * home_screen_grid.cellHeight.toFloat())
|
|
||||||
} else {
|
} else {
|
||||||
(gridItem.top * home_screen_grid.cellHeight.toFloat())
|
val clickableRect = home_screen_grid.getClickableRect(gridItem)
|
||||||
|
clickableRect.top.toFloat() - home_screen_grid.iconSize / 2f
|
||||||
}
|
}
|
||||||
|
|
||||||
home_screen_popup_menu_anchor.x = x
|
home_screen_popup_menu_anchor.x = x
|
||||||
|
@ -120,7 +120,9 @@ class LaunchersAdapter(
|
|||||||
|
|
||||||
setOnClickListener { itemClick(launcher) }
|
setOnClickListener { itemClick(launcher) }
|
||||||
setOnLongClickListener { view ->
|
setOnLongClickListener { view ->
|
||||||
allAppsListener.onAppLauncherLongPressed(view.x + width / 2, view.y, launcher)
|
val location = IntArray(2)
|
||||||
|
getLocationOnScreen(location)
|
||||||
|
allAppsListener.onAppLauncherLongPressed((location[0] + width / 2).toFloat(), location[1].toFloat(), launcher)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,8 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||||||
private var resizedWidget: HomeScreenGridItem? = null
|
private var resizedWidget: HomeScreenGridItem? = null
|
||||||
private var isFirstDraw = true
|
private var isFirstDraw = true
|
||||||
private var redrawWidgets = false
|
private var redrawWidgets = false
|
||||||
private var iconSize = 0
|
var iconSize = 0
|
||||||
|
private set
|
||||||
|
|
||||||
private var lastPage = 0
|
private var lastPage = 0
|
||||||
private var currentPage = 0
|
private var currentPage = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user