code: private static int generateCompatViewId() {
          for (; ; ) {
              final int result = sNextGeneratedId.get();
              int newValue = result + 1;
              /**
               * ID number larger than 0x00FFFFFF is reserved for static views defined in the /res xml files.
               * Android doesn't want you to use 0 as a view's id, and it needs to be flipped before 0x01000000 to avoid
               * the conflicts with static resource IDs
               */
              if (newValue > 0x00FFFFFF) {
                  newValue = 1; // Roll over to 1, not 0.
              }
              if (sNextGeneratedId.compareAndSet(result, newValue)) {
                  return result;
              }
          }
      }
docs: Generate a value suitable for use in {@link View#setId(int)}
  This value will not collide with ID values generated at build time by aapt for R.id.
  
  @return a generated ID value