Home | History | Annotate | Download | only in app

Lines Matching refs:display

25 import android.hardware.display.DisplayManager;
26 import android.hardware.display.DisplayManager.DisplayListener;
30 import android.view.Display;
45 * content on a secondary display. A {@link Presentation} is associated with
46 * the target {@link Display} at creation time and configures its context and
47 * resource configuration according to the display's metrics.
52 * to ensure that assets of the correct size and density for the target display
56 * the display to which it is attached is removed. An activity should take
61 * <h3>Choosing a presentation display</h3>
63 * Before showing a {@link Presentation} it's important to choose the {@link Display}
64 * on which it will appear. Choosing a presentation display is sometimes difficult
66 * which display is best, an application should let the system choose a suitable
67 * presentation display.
69 * There are two main ways to choose a {@link Display}.
72 * <h4>Using the media router to choose a presentation display</h4>
74 * The easiest way to choose a presentation display is to use the
78 * or when the preferred presentation display of a route changes.
80 * a presentation on the preferred presentation display automatically.
82 * The preferred presentation display is the display that the media router recommends
83 * that the application should use if it wants to show content on the secondary display.
84 * Sometimes there may not be a preferred presentation display in which
88 * presentation display using {@link android.media.MediaRouter.RouteInfo#getPresentationDisplay()}.
94 * Display presentationDisplay = route.getPresentationDisplay();
103 * the content in a presentation when a presentation display is available.
108 * <h4>Using the display manager to choose a presentation display</h4>
110 * Another way to choose a presentation display is to use the {@link DisplayManager} API
111 * directly. The display manager service provides functions to enumerate and describe all
115 * The display manager keeps track of all displays in the system. However, not all
117 * attempted to show a presentation on the main display it might obscure its own content
126 * Display[] presentationDisplays = displayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION);
128 * // If there is more than one suitable presentation display, then we could consider
129 * // giving the user a choice. For this example, we simply choose the first display
130 * // which is the one the system recommends as the preferred presentation display.
131 * Display display = presentationDisplays[0];
136 * The following sample code from <code>ApiDemos</code> demonstrates how to use the display
144 * video routes and how to obtain the preferred presentation display for the
154 private final Display mDisplay;
159 * Creates a new presentation that is attached to the specified display
164 * on this context and information about the associated display.
165 * @param display The display to which the presentation should be attached.
167 public Presentation(Context outerContext, Display display) {
168 this(outerContext, display, 0);
172 * Creates a new presentation that is attached to the specified display
177 * on this context and information about the associated display.
178 * @param display The display to which the presentation should be attached.
185 public Presentation(Context outerContext, Display display, int theme) {
186 super(createPresentationContext(outerContext, display, theme), theme, false);
188 mDisplay = display;
201 * Gets the {@link Display} that this presentation appears on.
203 * @return The display.
205 public Display getDisplay() {
212 * display that the presentation appears on.
225 // Since we were not watching for display changes until just now, there is a
226 // chance that the display metrics have changed. If so, we will need to
231 + "display metrics have changed since it was created.");
245 * {@link Display} can't be found.
253 * Called by the system when the {@link Display} to which the presentation
265 * Called by the system when the properties of the {@link Display} to which
268 * If the display metrics have changed (for example, if the display has been
287 // If the display metrics have changed in any way then the current configuration
292 + "display metrics have changed since it was created.");
304 Context outerContext, Display display, int theme) {
308 if (display == null) {
309 throw new IllegalArgumentException("display must not be null");
312 Context displayContext = outerContext.createDisplayContext(display);
320 // Derive the display's window manager from the outer window manager.