Class ViewCompat


  • public class ViewCompat
    extends java.lang.Object
    Compat view methods
    • Constructor Summary

      Constructors 
      Constructor Description
      ViewCompat()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int generateViewId()
      Generate a value suitable for use in View.setId(int).
      static android.graphics.Point getScreenSize​(android.content.Context context)  
      static boolean isTouchExplorationEnabled​(android.content.Context context)
      Returns whether touch exploration is enbaled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ViewCompat

        public ViewCompat()
    • Method Detail

      • generateViewId

        public static int generateViewId()
        Generate a value suitable for use in View.setId(int). This value will not collide with ID values generated at build time by aapt for R.id.
        Returns:
        a generated ID value
      • getScreenSize

        public static android.graphics.Point getScreenSize​(android.content.Context context)
      • isTouchExplorationEnabled

        public static boolean isTouchExplorationEnabled​(android.content.Context context)
        Returns whether touch exploration is enbaled

        That often means that Talkback is enabled, but more importantly it means that the user is using some kind of touch assist. Meaning that they'll be slower to tap things.

        Usually you'll want to use this method to disable things based on timers, like an auto dismiss.