Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
BlissLauncher
Commits
0e70d218
Commit
0e70d218
authored
Jan 09, 2022
by
Amit Kumar
💻
Browse files
Fix widget page lag and add touch listener to grid layout
parent
c57957cb
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/blisslauncher/core/customviews/LauncherPagedView.java
View file @
0e70d218
...
...
@@ -285,7 +285,7 @@ public class LauncherPagedView extends PagedView<PageIndicatorDots> implements V
}
public
void
bindAndInitFirstScreen
(
View
view
)
{
// Do nothing here.
}
public
void
removeAllWorkspaceScreens
()
{
...
...
app/src/main/java/foundation/e/blisslauncher/features/test/CellLayout.kt
View file @
0e70d218
...
...
@@ -174,6 +174,10 @@ open class CellLayout @JvmOverloads constructor(
})
mDragOutlineAnims
[
i
]
=
anim
}
setOnClickListener
{
launcher
.
getLauncherPagedView
().
setWobbleExpirationAlarm
(
0
)
// Stop wobbling immediately if empty space is touched.
}
}
override
fun
onMeasure
(
widthSpec
:
Int
,
heightSpec
:
Int
)
{
...
...
app/src/main/java/foundation/e/blisslauncher/features/widgets/WidgetsRootView.java
View file @
0e70d218
...
...
@@ -19,6 +19,10 @@ public class WidgetsRootView extends HorizontalScrollView {
private
boolean
shouldScrollWorkspace
=
true
;
// The following constants need to be scaled based on density. The scaled versions will be
// assigned to the corresponding member variables below.
private
static
final
int
FLING_THRESHOLD_VELOCITY
=
500
;
public
WidgetsRootView
(
Context
context
)
{
super
(
context
);
init
();
...
...
@@ -55,6 +59,16 @@ public class WidgetsRootView extends HorizontalScrollView {
}
}
@Override
public
void
fling
(
int
velocityX
)
{
super
.
fling
(
velocityX
);
float
density
=
getResources
().
getDisplayMetrics
().
density
;
if
(
Math
.
abs
(
velocityX
)
>
FLING_THRESHOLD_VELOCITY
*
density
)
{
shouldScrollWorkspace
=
!
shouldScrollWorkspace
;
overlay
.
onScrollInteractionEnd
();
}
}
@Override
protected
boolean
overScrollBy
(
int
deltaX
,
...
...
app/src/quickstep/recents_ui_overrides/src/foundation/e/blisslauncher/uioverrides/OverlayCallbackImpl.java
View file @
0e70d218
...
...
@@ -15,6 +15,9 @@ public class OverlayCallbackImpl implements TestActivity.LauncherOverlay {
private
TestActivity
.
LauncherOverlayCallbacks
mLauncherOverlayCallbacks
;
// The page is moved more than halfway, automatically move to the next page on touch up.
private
static
final
float
SIGNIFICANT_MOVE_THRESHOLD
=
0.4f
;
public
OverlayCallbackImpl
(
TestActivity
launcher
)
{
this
.
mLauncher
=
launcher
;
}
...
...
@@ -27,10 +30,10 @@ public class OverlayCallbackImpl implements TestActivity.LauncherOverlay {
@Override
public
void
onScrollInteractionEnd
()
{
if
(
scrollFromWorkspace
)
{
if
(
mProgress
>=
0.5f
)
mLauncherOverlayCallbacks
.
onScrollEnd
(
1
f
,
true
);
if
(
mProgress
>=
SIGNIFICANT_MOVE_THRESHOLD
)
mLauncherOverlayCallbacks
.
onScrollEnd
(
1
f
,
true
);
else
mLauncherOverlayCallbacks
.
onScrollEnd
(
0
f
,
true
);
}
else
{
if
(
mProgress
<
0.5f
)
mLauncherOverlayCallbacks
.
onScrollEnd
(
0
f
,
false
);
if
(
mProgress
<
SIGNIFICANT_MOVE_THRESHOLD
)
mLauncherOverlayCallbacks
.
onScrollEnd
(
0
f
,
false
);
else
mLauncherOverlayCallbacks
.
onScrollEnd
(
1
f
,
false
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment