use of android.view.ViewManager in project android_frameworks_base by ResurrectionRemix.
the class PhoneWindow method closePanel.
/**
* Closes the given panel.
*
* @param st The panel to be closed.
* @param doCallback Whether to notify the callback that the panel was
* closed. If the panel is in the process of re-opening or
* opening another panel (e.g., menu opening a sub menu), the
* callback should not happen and this variable should be false.
* In addition, this method internally will only perform the
* callback if the panel is open.
*/
public final void closePanel(PanelFeatureState st, boolean doCallback) {
// System.out.println("Close panel: isOpen=" + st.isOpen);
if (doCallback && st.featureId == FEATURE_OPTIONS_PANEL && mDecorContentParent != null && mDecorContentParent.isOverflowMenuShowing()) {
checkCloseActionMenu(st.menu);
return;
}
final ViewManager wm = getWindowManager();
if ((wm != null) && st.isOpen) {
if (st.decorView != null) {
wm.removeView(st.decorView);
// Log.v(TAG, "Removing main menu from window manager.");
if (st.isCompact) {
sRotationWatcher.removeWindow(this);
}
}
if (doCallback) {
callOnPanelClosed(st.featureId, st, null);
}
}
st.isPrepared = false;
st.isHandled = false;
st.isOpen = false;
// This view is no longer shown, so null it out
st.shownPanelView = null;
if (st.isInExpandedMode) {
// Next time the menu opens, it should not be in expanded mode, so
// force a refresh of the decor
st.refreshDecorView = true;
st.isInExpandedMode = false;
}
if (mPreparedPanel == st) {
mPreparedPanel = null;
mPanelChordingKey = 0;
}
}
use of android.view.ViewManager in project android_frameworks_base by ResurrectionRemix.
the class PhoneWindow method closeAllPanels.
@Override
public final void closeAllPanels() {
final ViewManager wm = getWindowManager();
if (wm == null) {
return;
}
final PanelFeatureState[] panels = mPanels;
final int N = panels != null ? panels.length : 0;
for (int i = 0; i < N; i++) {
final PanelFeatureState panel = panels[i];
if (panel != null) {
closePanel(panel, true);
}
}
closeContextMenu();
}
use of android.view.ViewManager in project android_frameworks_base by DirtyUnicorns.
the class PhoneWindow method onOptionsPanelRotationChanged.
void onOptionsPanelRotationChanged() {
final PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, false);
if (st == null)
return;
final WindowManager.LayoutParams lp = st.decorView != null ? (WindowManager.LayoutParams) st.decorView.getLayoutParams() : null;
if (lp != null) {
lp.gravity = getOptionsPanelGravity();
final ViewManager wm = getWindowManager();
if (wm != null) {
wm.updateViewLayout(st.decorView, lp);
}
}
}
use of android.view.ViewManager in project android_frameworks_base by DirtyUnicorns.
the class PhoneWindow method closePanel.
/**
* Closes the given panel.
*
* @param st The panel to be closed.
* @param doCallback Whether to notify the callback that the panel was
* closed. If the panel is in the process of re-opening or
* opening another panel (e.g., menu opening a sub menu), the
* callback should not happen and this variable should be false.
* In addition, this method internally will only perform the
* callback if the panel is open.
*/
public final void closePanel(PanelFeatureState st, boolean doCallback) {
// System.out.println("Close panel: isOpen=" + st.isOpen);
if (doCallback && st.featureId == FEATURE_OPTIONS_PANEL && mDecorContentParent != null && mDecorContentParent.isOverflowMenuShowing()) {
checkCloseActionMenu(st.menu);
return;
}
final ViewManager wm = getWindowManager();
if ((wm != null) && st.isOpen) {
if (st.decorView != null) {
wm.removeView(st.decorView);
// Log.v(TAG, "Removing main menu from window manager.");
if (st.isCompact) {
sRotationWatcher.removeWindow(this);
}
}
if (doCallback) {
callOnPanelClosed(st.featureId, st, null);
}
}
st.isPrepared = false;
st.isHandled = false;
st.isOpen = false;
// This view is no longer shown, so null it out
st.shownPanelView = null;
if (st.isInExpandedMode) {
// Next time the menu opens, it should not be in expanded mode, so
// force a refresh of the decor
st.refreshDecorView = true;
st.isInExpandedMode = false;
}
if (mPreparedPanel == st) {
mPreparedPanel = null;
mPanelChordingKey = 0;
}
}
use of android.view.ViewManager in project android_frameworks_base by DirtyUnicorns.
the class PhoneWindow method closeAllPanels.
@Override
public final void closeAllPanels() {
final ViewManager wm = getWindowManager();
if (wm == null) {
return;
}
final PanelFeatureState[] panels = mPanels;
final int N = panels != null ? panels.length : 0;
for (int i = 0; i < N; i++) {
final PanelFeatureState panel = panels[i];
if (panel != null) {
closePanel(panel, true);
}
}
closeContextMenu();
}
Aggregations