mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 02:38:20 +00:00
Merge "Fixing workspace state issue with option menu." into ub-launcher3-burnaby-polish
This commit is contained in:
@@ -33,7 +33,8 @@
|
||||
android:text="@string/wallpaper_button_text"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
android:focusable="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/widget_button"
|
||||
@@ -47,7 +48,8 @@
|
||||
android:text="@string/widget_button_text"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
android:focusable="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_button"
|
||||
@@ -61,6 +63,7 @@
|
||||
android:text="@string/settings_button_text"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
android:focusable="true" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1282,6 +1282,29 @@ public class Launcher extends Activity
|
||||
return handled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_MENU) {
|
||||
// Ignore the menu key if we are currently dragging or are on the custom content screen
|
||||
if (!isOnCustomContent() && !mDragController.isDragging()) {
|
||||
// Close any open folders
|
||||
closeFolder();
|
||||
|
||||
// Stop resizing any widgets
|
||||
mWorkspace.exitWidgetResizeMode();
|
||||
|
||||
// Show the overview mode if we are on the workspace
|
||||
if (mState == State.WORKSPACE && !mWorkspace.isInOverviewMode() &&
|
||||
!mWorkspace.isSwitchingState()) {
|
||||
mOverviewPanel.requestFocus();
|
||||
showOverviewMode(true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(keyCode, event);
|
||||
}
|
||||
|
||||
private String getTypedText() {
|
||||
return mDefaultKeySsb.toString();
|
||||
}
|
||||
@@ -2181,22 +2204,9 @@ public class Launcher extends Activity
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
if (!isOnCustomContent()) {
|
||||
// Close any open folders
|
||||
closeFolder();
|
||||
// Stop resizing any widgets
|
||||
mWorkspace.exitWidgetResizeMode();
|
||||
if (!mWorkspace.isInOverviewMode()) {
|
||||
// Show the overview mode
|
||||
showOverviewMode(true);
|
||||
} else {
|
||||
showWorkspace(true);
|
||||
}
|
||||
}
|
||||
if (mLauncherCallbacks != null) {
|
||||
return mLauncherCallbacks.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user