ViewConfiguration.java revision 243657993c0280771e07a3367d1a7ed45dbfe15f
1/* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.view; 18 19import android.app.AppGlobals; 20import android.content.Context; 21import android.content.res.Configuration; 22import android.content.res.Resources; 23import android.os.RemoteException; 24import android.provider.Settings; 25import android.util.DisplayMetrics; 26import android.util.SparseArray; 27 28/** 29 * Contains methods to standard constants used in the UI for timeouts, sizes, and distances. 30 */ 31public class ViewConfiguration { 32 /** 33 * Expected bit depth of the display panel. 34 * 35 * @hide 36 */ 37 public static final float PANEL_BIT_DEPTH = 24; 38 39 /** 40 * Minimum alpha required for a view to draw. 41 * 42 * @hide 43 */ 44 public static final float ALPHA_THRESHOLD = 0.5f / PANEL_BIT_DEPTH; 45 /** 46 * @hide 47 */ 48 public static final float ALPHA_THRESHOLD_INT = 0x7f / PANEL_BIT_DEPTH; 49 50 /** 51 * Defines the width of the horizontal scrollbar and the height of the vertical scrollbar in 52 * dips 53 */ 54 private static final int SCROLL_BAR_SIZE = 10; 55 56 /** 57 * Duration of the fade when scrollbars fade away in milliseconds 58 */ 59 private static final int SCROLL_BAR_FADE_DURATION = 250; 60 61 /** 62 * Default delay before the scrollbars fade in milliseconds 63 */ 64 private static final int SCROLL_BAR_DEFAULT_DELAY = 300; 65 66 /** 67 * Defines the length of the fading edges in dips 68 */ 69 private static final int FADING_EDGE_LENGTH = 12; 70 71 /** 72 * Defines the duration in milliseconds of the pressed state in child 73 * components. 74 */ 75 private static final int PRESSED_STATE_DURATION = 125; 76 77 /** 78 * Defines the default duration in milliseconds before a press turns into 79 * a long press 80 */ 81 private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500; 82 83 /** 84 * Defines the time between successive key repeats in milliseconds. 85 */ 86 private static final int KEY_REPEAT_DELAY = 50; 87 88 /** 89 * Defines the duration in milliseconds a user needs to hold down the 90 * appropriate button to bring up the global actions dialog (power off, 91 * lock screen, etc). 92 */ 93 private static final int GLOBAL_ACTIONS_KEY_TIMEOUT = 500; 94 95 /** 96 * Defines the duration in milliseconds we will wait to see if a touch event 97 * is a tap or a scroll. If the user does not move within this interval, it is 98 * considered to be a tap. 99 */ 100 private static final int TAP_TIMEOUT = 180; 101 102 /** 103 * Defines the duration in milliseconds we will wait to see if a touch event 104 * is a jump tap. If the user does not complete the jump tap within this interval, it is 105 * considered to be a tap. 106 */ 107 private static final int JUMP_TAP_TIMEOUT = 500; 108 109 /** 110 * Defines the duration in milliseconds between the first tap's up event and 111 * the second tap's down event for an interaction to be considered a 112 * double-tap. 113 */ 114 private static final int DOUBLE_TAP_TIMEOUT = 300; 115 116 /** 117 * Defines the maximum duration in milliseconds between a touch pad 118 * touch and release for a given touch to be considered a tap (click) as 119 * opposed to a hover movement gesture. 120 */ 121 private static final int HOVER_TAP_TIMEOUT = 150; 122 123 /** 124 * Defines the maximum distance in pixels that a touch pad touch can move 125 * before being released for it to be considered a tap (click) as opposed 126 * to a hover movement gesture. 127 */ 128 private static final int HOVER_TAP_SLOP = 20; 129 130 /** 131 * Defines the duration in milliseconds we want to display zoom controls in response 132 * to a user panning within an application. 133 */ 134 private static final int ZOOM_CONTROLS_TIMEOUT = 3000; 135 136 /** 137 * Inset in dips to look for touchable content when the user touches the edge of the screen 138 */ 139 private static final int EDGE_SLOP = 12; 140 141 /** 142 * Distance a touch can wander before we think the user is scrolling in dips. 143 * Note that this value defined here is only used as a fallback by legacy/misbehaving 144 * applications that do not provide a Context for determining density/configuration-dependent 145 * values. 146 * 147 * To alter this value, see the configuration resource config_viewConfigurationTouchSlop 148 * in frameworks/base/core/res/res/values/config.xml or the appropriate device resource overlay. 149 * It may be appropriate to tweak this on a device-specific basis in an overlay based on 150 * the characteristics of the touch panel and firmware. 151 */ 152 private static final int TOUCH_SLOP = 8; 153 154 /** 155 * Distance the first touch can wander before we stop considering this event a double tap 156 * (in dips) 157 */ 158 private static final int DOUBLE_TAP_TOUCH_SLOP = TOUCH_SLOP; 159 160 /** 161 * Distance a touch can wander before we think the user is attempting a paged scroll 162 * (in dips) 163 * 164 * Note that this value defined here is only used as a fallback by legacy/misbehaving 165 * applications that do not provide a Context for determining density/configuration-dependent 166 * values. 167 * 168 * See the note above on {@link #TOUCH_SLOP} regarding the dimen resource 169 * config_viewConfigurationTouchSlop. ViewConfiguration will report a paging touch slop of 170 * config_viewConfigurationTouchSlop * 2 when provided with a Context. 171 */ 172 private static final int PAGING_TOUCH_SLOP = TOUCH_SLOP * 2; 173 174 /** 175 * Distance in dips between the first touch and second touch to still be considered a double tap 176 */ 177 private static final int DOUBLE_TAP_SLOP = 100; 178 179 /** 180 * Distance in dips a touch needs to be outside of a window's bounds for it to 181 * count as outside for purposes of dismissing the window. 182 */ 183 private static final int WINDOW_TOUCH_SLOP = 16; 184 185 /** 186 * Minimum velocity to initiate a fling, as measured in dips per second 187 */ 188 private static final int MINIMUM_FLING_VELOCITY = 50; 189 190 /** 191 * Maximum velocity to initiate a fling, as measured in dips per second 192 */ 193 private static final int MAXIMUM_FLING_VELOCITY = 8000; 194 195 /** 196 * Distance in dips between a touch up event denoting the end of a touch exploration 197 * gesture and the touch up event of a subsequent tap for the latter tap to be 198 * considered as a tap i.e. to perform a click. 199 */ 200 private static final int TOUCH_EXPLORATION_TAP_SLOP = 80; 201 202 /** 203 * Delay before dispatching a recurring accessibility event in milliseconds. 204 * This delay guarantees that a recurring event will be send at most once 205 * during the {@link #SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS} time 206 * frame. 207 */ 208 private static final long SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS = 400; 209 210 /** 211 * The maximum size of View's drawing cache, expressed in bytes. This size 212 * should be at least equal to the size of the screen in ARGB888 format. 213 */ 214 @Deprecated 215 private static final int MAXIMUM_DRAWING_CACHE_SIZE = 480 * 800 * 4; // ARGB8888 216 217 /** 218 * The coefficient of friction applied to flings/scrolls. 219 */ 220 private static final float SCROLL_FRICTION = 0.015f; 221 222 /** 223 * Max distance in dips to overscroll for edge effects 224 */ 225 private static final int OVERSCROLL_DISTANCE = 0; 226 227 /** 228 * Max distance in dips to overfling for edge effects 229 */ 230 private static final int OVERFLING_DISTANCE = 6; 231 232 private final int mEdgeSlop; 233 private final int mFadingEdgeLength; 234 private final int mMinimumFlingVelocity; 235 private final int mMaximumFlingVelocity; 236 private final int mScrollbarSize; 237 private final int mTouchSlop; 238 private final int mDoubleTapTouchSlop; 239 private final int mPagingTouchSlop; 240 private final int mDoubleTapSlop; 241 private final int mScaledTouchExplorationTapSlop; 242 private final int mWindowTouchSlop; 243 private final int mMaximumDrawingCacheSize; 244 private final int mOverscrollDistance; 245 private final int mOverflingDistance; 246 private final boolean mFadingMarqueeEnabled; 247 248 private boolean sHasPermanentMenuKey; 249 private boolean sHasPermanentMenuKeySet; 250 251 static final SparseArray<ViewConfiguration> sConfigurations = 252 new SparseArray<ViewConfiguration>(2); 253 254 /** 255 * @deprecated Use {@link android.view.ViewConfiguration#get(android.content.Context)} instead. 256 */ 257 @Deprecated 258 public ViewConfiguration() { 259 mEdgeSlop = EDGE_SLOP; 260 mFadingEdgeLength = FADING_EDGE_LENGTH; 261 mMinimumFlingVelocity = MINIMUM_FLING_VELOCITY; 262 mMaximumFlingVelocity = MAXIMUM_FLING_VELOCITY; 263 mScrollbarSize = SCROLL_BAR_SIZE; 264 mTouchSlop = TOUCH_SLOP; 265 mDoubleTapTouchSlop = DOUBLE_TAP_TOUCH_SLOP; 266 mPagingTouchSlop = PAGING_TOUCH_SLOP; 267 mDoubleTapSlop = DOUBLE_TAP_SLOP; 268 mScaledTouchExplorationTapSlop = TOUCH_EXPLORATION_TAP_SLOP; 269 mWindowTouchSlop = WINDOW_TOUCH_SLOP; 270 //noinspection deprecation 271 mMaximumDrawingCacheSize = MAXIMUM_DRAWING_CACHE_SIZE; 272 mOverscrollDistance = OVERSCROLL_DISTANCE; 273 mOverflingDistance = OVERFLING_DISTANCE; 274 mFadingMarqueeEnabled = true; 275 } 276 277 /** 278 * Creates a new configuration for the specified context. The configuration depends on 279 * various parameters of the context, like the dimension of the display or the density 280 * of the display. 281 * 282 * @param context The application context used to initialize this view configuration. 283 * 284 * @see #get(android.content.Context) 285 * @see android.util.DisplayMetrics 286 */ 287 private ViewConfiguration(Context context) { 288 final Resources res = context.getResources(); 289 final DisplayMetrics metrics = res.getDisplayMetrics(); 290 final Configuration config = res.getConfiguration(); 291 final float density = metrics.density; 292 final float sizeAndDensity; 293 if (config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_XLARGE)) { 294 sizeAndDensity = density * 1.5f; 295 } else { 296 sizeAndDensity = density; 297 } 298 299 mEdgeSlop = (int) (sizeAndDensity * EDGE_SLOP + 0.5f); 300 mFadingEdgeLength = (int) (sizeAndDensity * FADING_EDGE_LENGTH + 0.5f); 301 mMinimumFlingVelocity = (int) (density * MINIMUM_FLING_VELOCITY + 0.5f); 302 mMaximumFlingVelocity = (int) (density * MAXIMUM_FLING_VELOCITY + 0.5f); 303 mScrollbarSize = (int) (density * SCROLL_BAR_SIZE + 0.5f); 304 mDoubleTapSlop = (int) (sizeAndDensity * DOUBLE_TAP_SLOP + 0.5f); 305 mScaledTouchExplorationTapSlop = (int) (density * TOUCH_EXPLORATION_TAP_SLOP + 0.5f); 306 mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f); 307 308 // Size of the screen in bytes, in ARGB_8888 format 309 mMaximumDrawingCacheSize = 4 * metrics.widthPixels * metrics.heightPixels; 310 311 mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f); 312 mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f); 313 314 if (!sHasPermanentMenuKeySet) { 315 IWindowManager wm = Display.getWindowManager(); 316 try { 317 sHasPermanentMenuKey = wm.canStatusBarHide() && !wm.hasNavigationBar(); 318 sHasPermanentMenuKeySet = true; 319 } catch (RemoteException ex) { 320 sHasPermanentMenuKey = false; 321 } 322 } 323 324 mFadingMarqueeEnabled = res.getBoolean( 325 com.android.internal.R.bool.config_ui_enableFadingMarquee); 326 mTouchSlop = res.getDimensionPixelSize( 327 com.android.internal.R.dimen.config_viewConfigurationTouchSlop); 328 mPagingTouchSlop = mTouchSlop * 2; 329 330 mDoubleTapTouchSlop = mTouchSlop; 331 } 332 333 /** 334 * Returns a configuration for the specified context. The configuration depends on 335 * various parameters of the context, like the dimension of the display or the 336 * density of the display. 337 * 338 * @param context The application context used to initialize the view configuration. 339 */ 340 public static ViewConfiguration get(Context context) { 341 final DisplayMetrics metrics = context.getResources().getDisplayMetrics(); 342 final int density = (int) (100.0f * metrics.density); 343 344 ViewConfiguration configuration = sConfigurations.get(density); 345 if (configuration == null) { 346 configuration = new ViewConfiguration(context); 347 sConfigurations.put(density, configuration); 348 } 349 350 return configuration; 351 } 352 353 /** 354 * @return The width of the horizontal scrollbar and the height of the vertical 355 * scrollbar in dips 356 * 357 * @deprecated Use {@link #getScaledScrollBarSize()} instead. 358 */ 359 @Deprecated 360 public static int getScrollBarSize() { 361 return SCROLL_BAR_SIZE; 362 } 363 364 /** 365 * @return The width of the horizontal scrollbar and the height of the vertical 366 * scrollbar in pixels 367 */ 368 public int getScaledScrollBarSize() { 369 return mScrollbarSize; 370 } 371 372 /** 373 * @return Duration of the fade when scrollbars fade away in milliseconds 374 */ 375 public static int getScrollBarFadeDuration() { 376 return SCROLL_BAR_FADE_DURATION; 377 } 378 379 /** 380 * @return Default delay before the scrollbars fade in milliseconds 381 */ 382 public static int getScrollDefaultDelay() { 383 return SCROLL_BAR_DEFAULT_DELAY; 384 } 385 386 /** 387 * @return the length of the fading edges in dips 388 * 389 * @deprecated Use {@link #getScaledFadingEdgeLength()} instead. 390 */ 391 @Deprecated 392 public static int getFadingEdgeLength() { 393 return FADING_EDGE_LENGTH; 394 } 395 396 /** 397 * @return the length of the fading edges in pixels 398 */ 399 public int getScaledFadingEdgeLength() { 400 return mFadingEdgeLength; 401 } 402 403 /** 404 * @return the duration in milliseconds of the pressed state in child 405 * components. 406 */ 407 public static int getPressedStateDuration() { 408 return PRESSED_STATE_DURATION; 409 } 410 411 /** 412 * @return the duration in milliseconds before a press turns into 413 * a long press 414 */ 415 public static int getLongPressTimeout() { 416 return AppGlobals.getIntCoreSetting(Settings.Secure.LONG_PRESS_TIMEOUT, 417 DEFAULT_LONG_PRESS_TIMEOUT); 418 } 419 420 /** 421 * @return the time before the first key repeat in milliseconds. 422 */ 423 public static int getKeyRepeatTimeout() { 424 return getLongPressTimeout(); 425 } 426 427 /** 428 * @return the time between successive key repeats in milliseconds. 429 */ 430 public static int getKeyRepeatDelay() { 431 return KEY_REPEAT_DELAY; 432 } 433 434 /** 435 * @return the duration in milliseconds we will wait to see if a touch event 436 * is a tap or a scroll. If the user does not move within this interval, it is 437 * considered to be a tap. 438 */ 439 public static int getTapTimeout() { 440 return TAP_TIMEOUT; 441 } 442 443 /** 444 * @return the duration in milliseconds we will wait to see if a touch event 445 * is a jump tap. If the user does not move within this interval, it is 446 * considered to be a tap. 447 */ 448 public static int getJumpTapTimeout() { 449 return JUMP_TAP_TIMEOUT; 450 } 451 452 /** 453 * @return the duration in milliseconds between the first tap's up event and 454 * the second tap's down event for an interaction to be considered a 455 * double-tap. 456 */ 457 public static int getDoubleTapTimeout() { 458 return DOUBLE_TAP_TIMEOUT; 459 } 460 461 /** 462 * @return the maximum duration in milliseconds between a touch pad 463 * touch and release for a given touch to be considered a tap (click) as 464 * opposed to a hover movement gesture. 465 * @hide 466 */ 467 public static int getHoverTapTimeout() { 468 return HOVER_TAP_TIMEOUT; 469 } 470 471 /** 472 * @return the maximum distance in pixels that a touch pad touch can move 473 * before being released for it to be considered a tap (click) as opposed 474 * to a hover movement gesture. 475 * @hide 476 */ 477 public static int getHoverTapSlop() { 478 return HOVER_TAP_SLOP; 479 } 480 481 /** 482 * @return Inset in dips to look for touchable content when the user touches the edge of the 483 * screen 484 * 485 * @deprecated Use {@link #getScaledEdgeSlop()} instead. 486 */ 487 @Deprecated 488 public static int getEdgeSlop() { 489 return EDGE_SLOP; 490 } 491 492 /** 493 * @return Inset in pixels to look for touchable content when the user touches the edge of the 494 * screen 495 */ 496 public int getScaledEdgeSlop() { 497 return mEdgeSlop; 498 } 499 500 /** 501 * @return Distance in dips a touch can wander before we think the user is scrolling 502 * 503 * @deprecated Use {@link #getScaledTouchSlop()} instead. 504 */ 505 @Deprecated 506 public static int getTouchSlop() { 507 return TOUCH_SLOP; 508 } 509 510 /** 511 * @return Distance in pixels a touch can wander before we think the user is scrolling 512 */ 513 public int getScaledTouchSlop() { 514 return mTouchSlop; 515 } 516 517 /** 518 * @return Distance in pixels the first touch can wander before we do not consider this a 519 * potential double tap event 520 * @hide 521 */ 522 public int getScaledDoubleTapTouchSlop() { 523 return mDoubleTapTouchSlop; 524 } 525 526 /** 527 * @return Distance in pixels a touch can wander before we think the user is scrolling a full 528 * page 529 */ 530 public int getScaledPagingTouchSlop() { 531 return mPagingTouchSlop; 532 } 533 534 /** 535 * @return Distance in dips between the first touch and second touch to still be 536 * considered a double tap 537 * @deprecated Use {@link #getScaledDoubleTapSlop()} instead. 538 * @hide The only client of this should be GestureDetector, which needs this 539 * for clients that still use its deprecated constructor. 540 */ 541 @Deprecated 542 public static int getDoubleTapSlop() { 543 return DOUBLE_TAP_SLOP; 544 } 545 546 /** 547 * @return Distance in pixels between the first touch and second touch to still be 548 * considered a double tap 549 */ 550 public int getScaledDoubleTapSlop() { 551 return mDoubleTapSlop; 552 } 553 554 /** 555 * @return Distance in pixels between a touch up event denoting the end of a touch exploration 556 * gesture and the touch up event of a subsequent tap for the latter tap to be 557 * considered as a tap i.e. to perform a click. 558 * 559 * @hide 560 */ 561 public int getScaledTouchExplorationTapSlop() { 562 return mScaledTouchExplorationTapSlop; 563 } 564 565 /** 566 * Interval for dispatching a recurring accessibility event in milliseconds. 567 * This interval guarantees that a recurring event will be send at most once 568 * during the {@link #getSendRecurringAccessibilityEventsInterval()} time frame. 569 * 570 * @return The delay in milliseconds. 571 * 572 * @hide 573 */ 574 public static long getSendRecurringAccessibilityEventsInterval() { 575 return SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS; 576 } 577 578 /** 579 * @return Distance in dips a touch must be outside the bounds of a window for it 580 * to be counted as outside the window for purposes of dismissing that 581 * window. 582 * 583 * @deprecated Use {@link #getScaledWindowTouchSlop()} instead. 584 */ 585 @Deprecated 586 public static int getWindowTouchSlop() { 587 return WINDOW_TOUCH_SLOP; 588 } 589 590 /** 591 * @return Distance in pixels a touch must be outside the bounds of a window for it 592 * to be counted as outside the window for purposes of dismissing that window. 593 */ 594 public int getScaledWindowTouchSlop() { 595 return mWindowTouchSlop; 596 } 597 598 /** 599 * @return Minimum velocity to initiate a fling, as measured in dips per second. 600 * 601 * @deprecated Use {@link #getScaledMinimumFlingVelocity()} instead. 602 */ 603 @Deprecated 604 public static int getMinimumFlingVelocity() { 605 return MINIMUM_FLING_VELOCITY; 606 } 607 608 /** 609 * @return Minimum velocity to initiate a fling, as measured in pixels per second. 610 */ 611 public int getScaledMinimumFlingVelocity() { 612 return mMinimumFlingVelocity; 613 } 614 615 /** 616 * @return Maximum velocity to initiate a fling, as measured in dips per second. 617 * 618 * @deprecated Use {@link #getScaledMaximumFlingVelocity()} instead. 619 */ 620 @Deprecated 621 public static int getMaximumFlingVelocity() { 622 return MAXIMUM_FLING_VELOCITY; 623 } 624 625 /** 626 * @return Maximum velocity to initiate a fling, as measured in pixels per second. 627 */ 628 public int getScaledMaximumFlingVelocity() { 629 return mMaximumFlingVelocity; 630 } 631 632 /** 633 * The maximum drawing cache size expressed in bytes. 634 * 635 * @return the maximum size of View's drawing cache expressed in bytes 636 * 637 * @deprecated Use {@link #getScaledMaximumDrawingCacheSize()} instead. 638 */ 639 @Deprecated 640 public static int getMaximumDrawingCacheSize() { 641 //noinspection deprecation 642 return MAXIMUM_DRAWING_CACHE_SIZE; 643 } 644 645 /** 646 * The maximum drawing cache size expressed in bytes. 647 * 648 * @return the maximum size of View's drawing cache expressed in bytes 649 */ 650 public int getScaledMaximumDrawingCacheSize() { 651 return mMaximumDrawingCacheSize; 652 } 653 654 /** 655 * @return The maximum distance a View should overscroll by when showing edge effects (in 656 * pixels). 657 */ 658 public int getScaledOverscrollDistance() { 659 return mOverscrollDistance; 660 } 661 662 /** 663 * @return The maximum distance a View should overfling by when showing edge effects (in 664 * pixels). 665 */ 666 public int getScaledOverflingDistance() { 667 return mOverflingDistance; 668 } 669 670 /** 671 * The amount of time that the zoom controls should be 672 * displayed on the screen expressed in milliseconds. 673 * 674 * @return the time the zoom controls should be visible expressed 675 * in milliseconds. 676 */ 677 public static long getZoomControlsTimeout() { 678 return ZOOM_CONTROLS_TIMEOUT; 679 } 680 681 /** 682 * The amount of time a user needs to press the relevant key to bring up 683 * the global actions dialog. 684 * 685 * @return how long a user needs to press the relevant key to bring up 686 * the global actions dialog. 687 */ 688 public static long getGlobalActionKeyTimeout() { 689 return GLOBAL_ACTIONS_KEY_TIMEOUT; 690 } 691 692 /** 693 * The amount of friction applied to scrolls and flings. 694 * 695 * @return A scalar dimensionless value representing the coefficient of 696 * friction. 697 */ 698 public static float getScrollFriction() { 699 return SCROLL_FRICTION; 700 } 701 702 /** 703 * Report if the device has a permanent menu key available to the user. 704 * 705 * <p>As of Android 3.0, devices may not have a permanent menu key available. 706 * Apps should use the action bar to present menu options to users. 707 * However, there are some apps where the action bar is inappropriate 708 * or undesirable. This method may be used to detect if a menu key is present. 709 * If not, applications should provide another on-screen affordance to access 710 * functionality. 711 * 712 * @return true if a permanent menu key is present, false otherwise. 713 */ 714 public boolean hasPermanentMenuKey() { 715 return sHasPermanentMenuKey; 716 } 717 718 /** 719 * @hide 720 * @return Whether or not marquee should use fading edges. 721 */ 722 public boolean isFadingMarqueeEnabled() { 723 return mFadingMarqueeEnabled; 724 } 725} 726