mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Enabling accessible drag and drop
-> Using the context menu, and a new two stage system, this allows users to curate icons and widgets on the workspace -> Move icons / widgets to any empty cell on any existing screen, or create a new screen (appended to the right, as with regular drag and drop) -> Move icons into existing folders -> Create folders by moving an icon onto another icon -> Also added confirmations for these and some existing accessibility actions Limitations: -> Currently, no support for drag and drop in folders -> Considering moving the drag view so it doesn't occlude any content (in particular, when user changes pages) -> In this mode, accessibility framework seems to have problems with the next / prev operations Bug: 18482913 Change-Id: I19b0be9dc8bfa766d430408c8ad9303c716b89b2
This commit is contained in:
@@ -197,6 +197,10 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
|
||||
*/
|
||||
@Override
|
||||
public void onDragStart(DragSource source, Object info, int dragAction) {
|
||||
showDeleteTarget();
|
||||
}
|
||||
|
||||
public void showDeleteTarget() {
|
||||
// Animate out the QSB search bar, and animate in the drop target bar
|
||||
prepareStartAnimation(mDropTargetBar);
|
||||
mDropTargetBarAnim.start();
|
||||
@@ -206,6 +210,16 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
|
||||
}
|
||||
}
|
||||
|
||||
public void hideDeleteTarget() {
|
||||
// Restore the QSB search bar, and animate out the drop target bar
|
||||
prepareStartAnimation(mDropTargetBar);
|
||||
mDropTargetBarAnim.reverse();
|
||||
if (!mIsSearchBarHidden) {
|
||||
prepareStartAnimation(mQSBSearchBar);
|
||||
mQSBSearchBarAnim.reverse();
|
||||
}
|
||||
}
|
||||
|
||||
public void deferOnDragEnd() {
|
||||
mDeferOnDragEnd = true;
|
||||
}
|
||||
@@ -213,13 +227,7 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
|
||||
@Override
|
||||
public void onDragEnd() {
|
||||
if (!mDeferOnDragEnd) {
|
||||
// Restore the QSB search bar, and animate out the drop target bar
|
||||
prepareStartAnimation(mDropTargetBar);
|
||||
mDropTargetBarAnim.reverse();
|
||||
if (!mIsSearchBarHidden) {
|
||||
prepareStartAnimation(mQSBSearchBar);
|
||||
mQSBSearchBarAnim.reverse();
|
||||
}
|
||||
hideDeleteTarget();
|
||||
} else {
|
||||
mDeferOnDragEnd = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user