api-impl: misc stubs and fixes

This commit is contained in:
Mis012
2025-03-26 21:01:57 +01:00
parent fd2e9f43b6
commit f3332b7201
25 changed files with 234 additions and 37 deletions

View File

@@ -398,6 +398,23 @@ public class TypedValue {
return res;
}
public int getComplexUnit() {
return (data >> COMPLEX_UNIT_SHIFT) & COMPLEX_UNIT_MASK;
}
/**
* Return the complex unit type for the given complex dimension. For example, a dimen type
* with value 12sp will return {@link #COMPLEX_UNIT_SP}. Use with values created with {@link
* #createComplexDimension(int, int)} etc.
*
* @return The complex unit type.
*
* @hide
*/
public static int getUnitFromComplexDimension(int complexDimension) {
return COMPLEX_UNIT_MASK & (complexDimension >> TypedValue.COMPLEX_UNIT_SHIFT);
}
/**
* Converts an unpacked complex data value holding a dimension to its final floating
* point value. The two parameters <var>unit</var> and <var>value</var>
@@ -572,8 +589,4 @@ public class TypedValue {
sb.append("}");
return sb.toString();
}
public int getComplexUnit() {
return (data >> COMPLEX_UNIT_SHIFT) & COMPLEX_UNIT_MASK;
}
};