Before, Launcher relied on a callback to a SearchManager.OnCancelListener to clear the search widget
animation. However, that doesn't get called if some other app opens the search dialog
before the Launcher is reopened. This change clears the animation in onResume().
Should fix http://b/issue?id=2246760
Activity#showDialog on CreateShortcut
I'm not sure how this can happen, but I think it's okay to just
drop the exception. It's all just trying to clean up anyway.
Now:
- When you're on the workspace and you press home, it animates back to the middle
- When you're in all apps and you press home, all apps animates out and the workspace
doesn't animate to the middle (it just jumps there)
- When you're in an app and you press home, it doesn't animate to the middle
- When you're in an app and you press back, it still goes to the page you were on.
Don't look at the evil hack to make it move without animating.
still work
I knew it was a problem with mWaitingForResult, which I'm still not convinced we need, but
Jeff Sharkey was able to find repro steps, so he's my new hero. The steps were:
1. Open add menu (long pressing or menu > add)
2. Turn off the screen
3. Turn back on & unlock
4. Poof.
The problem was that when we get ACTION_CLOSE_SYSTEM_DIALOGS intents, we're dismissing the dialogs,
not canceling them. I think we actually want to cancel them, but there's no easy way to do that
with the Activity class, so just clear mWaitingForResult by hand in closeSystemDialogs().
at the bottom of app drawer
This includes some contortions to get it not to perform the vibrate
haptic feedback then.
(By the way, it appears that we're vibrating on the add context menu
long press, so also do it when when we show the previews.
Now, home always goes to the center worksapce screen and back from an
app goes to all apps if it was open.
Getting that animations smooth took a little bit of work.
Also cherry-picks this from launcher 1
Fix issue #2133206: dialogs/menus should auto-dismiss when screen turns off
Close things out in various ways. This should be done for Launcher2 as well.
Change-Id: Id4f1c78e35180b437144c54ddcbf10069cc09071
Conflicts:
AndroidManifest.xml
src/com/android/launcher2/Launcher.java
Smaller thumbnail (removed unnecessary padding), more opaque background.
Uses a white background because the dark background interferes with the
new dark widgets.
Change-Id: I7654741d845609200569fce34b6cde891d2b5d29
After the LauncherProvider resets the database and wipes
out the host info, the Launcher must tell the AppWidgetHost
to listen again.
Originally 87e688d8... in packages/apps/Launcher.
Fixes http://b/2238470
The more I think about it, the more I think AllApps should just be a separate
activity. It's not a drawer anymore and you open it by pressing a button.
Also, it will want to derive from RenderScriptActivity or something, and
have all that stuff dealt with automatically too. It's to late to make a
change like this now, but if we do choose to do it someday, I think we'll want
to reconsider the menu that's shown.
For now, just close all apps when they add a shortcut or change the wallpaper.
THe problem was that the code was relying on mWaitingForResult being
cleared in onActivityResult. This was not being called because the
wallpaper choosing activity was not being invoked with a result code.
We may want to rethink blocking touch events when isWorkspaceLocked().
There may be other places where we can get stuck like this.
AllApps view is always visible (in the View sense), which was causing it
to take focus when it should not have. Changed Launcher to manually
turn on/off the focusability of AllApps as it appears/disappears.