2 * Copyright (C) 2006 The Android Open Source Project
3 * Copyright (C) 2011 Jake Wharton
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package com
.actionbarsherlock
.view
;
20 import android
.content
.Context
;
23 * <p>Abstract base class for a top-level window look and behavior policy. An
24 * instance of this class should be used as the top-level view added to the
25 * window manager. It provides standard UI policies such as a background, title
26 * area, default key processing, etc.</p>
28 * <p>The only existing implementation of this abstract class is
29 * android.policy.PhoneWindow, which you should instantiate when needing a
30 * Window. Eventually that class will be refactored and a factory method added
31 * for creating Window instances without knowing about a particular
34 public abstract class Window
extends android
.view
.Window
{
35 public static final long FEATURE_ACTION_BAR
= android
.view
.Window
.FEATURE_ACTION_BAR
;
36 public static final long FEATURE_ACTION_BAR_OVERLAY
= android
.view
.Window
.FEATURE_ACTION_BAR_OVERLAY
;
37 public static final long FEATURE_ACTION_MODE_OVERLAY
= android
.view
.Window
.FEATURE_ACTION_MODE_OVERLAY
;
38 public static final long FEATURE_NO_TITLE
= android
.view
.Window
.FEATURE_NO_TITLE
;
39 public static final long FEATURE_PROGRESS
= android
.view
.Window
.FEATURE_PROGRESS
;
40 public static final long FEATURE_INDETERMINATE_PROGRESS
= android
.view
.Window
.FEATURE_INDETERMINATE_PROGRESS
;
43 * Create a new instance for a context.
45 * @param context Context.
47 private Window(Context context
) {
52 public interface Callback
{
54 * Called when a panel's menu item has been selected by the user.
56 * @param featureId The panel that the menu is in.
57 * @param item The menu item that was selected.
59 * @return boolean Return true to finish processing of selection, or
60 * false to perform the normal menu handling (calling its
61 * Runnable or sending a Message to its target Handler).
63 public boolean onMenuItemSelected(int featureId
, MenuItem item
);