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
dab5dea1
Commit
dab5dea1
authored
Oct 28, 2021
by
Amit Kumar
💻
Browse files
Add Uninstall button to dragged icon after drag drop done
parent
6984f861
Pipeline
#143144
passed with stage
in 1 minute and 53 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/blisslauncher/core/customviews/LauncherPagedView.java
View file @
dab5dea1
...
...
@@ -80,7 +80,6 @@ import foundation.e.blisslauncher.features.test.dragndrop.SpringLoadedDragContro
import
foundation.e.blisslauncher.features.test.graphics.DragPreviewProvider
;
import
foundation.e.blisslauncher.features.test.uninstall.UninstallHelper
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashMap
;
...
...
@@ -1012,6 +1011,24 @@ public class LauncherPagedView extends PagedView<PageIndicatorDots> implements V
child
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
getContext
(),
R
.
anim
.
wobble_reverse
));
}
LauncherItem
info
=
(
LauncherItem
)
child
.
getTag
();
if
(
child
instanceof
IconTextView
&&
(
info
instanceof
ApplicationItem
||
info
instanceof
ShortcutItem
)
&&
!
UninstallHelper
.
INSTANCE
.
isUninstallDisabled
(
info
.
user
.
getRealHandle
(),
getContext
()))
{
// Return early if this app is system app
if
(
info
instanceof
ApplicationItem
)
{
ApplicationItem
applicationItem
=
(
ApplicationItem
)
info
;
if
(
applicationItem
.
isSystemApp
!=
ApplicationItem
.
FLAG_SYSTEM_UNKNOWN
)
{
if
((
applicationItem
.
isSystemApp
&
ApplicationItem
.
FLAG_SYSTEM_NO
)
!=
0
)
{
((
IconTextView
)
child
).
applyUninstallIconState
(
true
);
}
}
else
{
((
IconTextView
)
child
).
applyUninstallIconState
(
true
);
}
}
else
if
(
info
instanceof
ShortcutItem
)
{
((
IconTextView
)
child
).
applyUninstallIconState
(
true
);
}
}
}
});
}
...
...
@@ -1867,6 +1884,7 @@ public class LauncherPagedView extends PagedView<PageIndicatorDots> implements V
folderView
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
getContext
(),
R
.
anim
.
wobble_reverse
));
}
folderView
.
applyUninstallIconState
(
false
);
});
return
true
;
}
...
...
@@ -2796,12 +2814,13 @@ public class LauncherPagedView extends PagedView<PageIndicatorDots> implements V
lastFolderItem
.
screenId
=
folder
.
screenId
;
bindItems
(
Collections
.
singletonList
(
lastFolderItem
),
true
);
}
else
{
folder
.
icon
=
new
GraphicsUtil
(
getContext
()).
generateFolderIcon
(
getContext
(),
folder
);
folder
.
icon
=
new
GraphicsUtil
(
getContext
())
.
generateFolderIcon
(
getContext
(),
folder
);
layout
.
removeViewInLayout
(
parent
);
if
(
parent
instanceof
DropTarget
)
{
mDragController
.
removeDropTarget
((
DropTarget
)
parent
);
}
bindItems
(
Arrays
.
as
List
(
folder
),
true
);
bindItems
(
Collections
.
singleton
List
(
folder
),
true
);
}
}
}
...
...
app/src/main/java/foundation/e/blisslauncher/features/test/CellLayout.kt
View file @
dab5dea1
...
...
@@ -22,12 +22,15 @@ import android.widget.GridLayout
import
androidx.annotation.IntDef
import
foundation.e.blisslauncher.R
import
foundation.e.blisslauncher.core.Utilities
import
foundation.e.blisslauncher.core.database.model.ApplicationItem
import
foundation.e.blisslauncher.core.database.model.LauncherItem
import
foundation.e.blisslauncher.core.database.model.ShortcutItem
import
foundation.e.blisslauncher.core.utils.Constants
import
foundation.e.blisslauncher.features.launcher.Hotseat
import
foundation.e.blisslauncher.features.test.anim.Interpolators
import
foundation.e.blisslauncher.features.test.dragndrop.DropTarget
import
foundation.e.blisslauncher.features.test.graphics.DragPreviewProvider
import
foundation.e.blisslauncher.features.test.uninstall.UninstallHelper.isUninstallDisabled
import
java.lang.Double.MAX_VALUE
import
java.util.ArrayList
import
java.util.Arrays
...
...
@@ -867,6 +870,26 @@ open class CellLayout @JvmOverloads constructor(
)
)
}
val
info
:
LauncherItem
=
dragView
.
getTag
()
as
LauncherItem
if
((
info
is
ApplicationItem
||
info
is
ShortcutItem
)
&&
!
isUninstallDisabled
(
info
.
user
.
realHandle
,
context
)
)
{
// Return early if this app is system app
if
(
info
is
ApplicationItem
)
{
if
(
info
.
isSystemApp
!=
ApplicationItem
.
FLAG_SYSTEM_UNKNOWN
)
{
if
(
info
.
isSystemApp
and
ApplicationItem
.
FLAG_SYSTEM_NO
!=
0
)
{
dragView
.
applyUninstallIconState
(
true
)
}
}
else
{
dragView
.
applyUninstallIconState
(
true
)
}
}
else
if
(
info
is
ShortcutItem
)
{
dragView
.
applyUninstallIconState
(
true
)
}
}
}
}
}
...
...
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