code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 844
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public boolean neverSandboxDisplayApis(ConstrainDisplayApisConfig constrainDisplayApisConfig) {
return isChangeEnabled(NEVER_SANDBOX_DISPLAY_APIS)
|| constrainDisplayApisConfig.getNeverConstrainDisplayApis(applicationInfo);
} |
Returns if the activity should never be sandboxed to the activity window bounds.
@hide
| ActivityInfo::neverSandboxDisplayApis | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public boolean alwaysSandboxDisplayApis(ConstrainDisplayApisConfig constrainDisplayApisConfig) {
return isChangeEnabled(ALWAYS_SANDBOX_DISPLAY_APIS)
|| constrainDisplayApisConfig.getAlwaysConstrainDisplayApis(applicationInfo);
} |
Returns if the activity should always be sandboxed to the activity window bounds.
@hide
| ActivityInfo::alwaysSandboxDisplayApis | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public void setMaxAspectRatio(@FloatRange(from = 0f) float maxAspectRatio) {
this.mMaxAspectRatio = maxAspectRatio >= 0f ? maxAspectRatio : 0f;
} |
Returns if the activity should always be sandboxed to the activity window bounds.
@hide
public boolean alwaysSandboxDisplayApis(ConstrainDisplayApisConfig constrainDisplayApisConfig) {
return isChangeEnabled(ALWAYS_SANDBOX_DISPLAY_APIS)
|| constrainDisplayApisConfig.getAlwaysConstrainDisplayApis(applicationInfo);
}
/** @hide | ActivityInfo::setMaxAspectRatio | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public float getMaxAspectRatio() {
return mMaxAspectRatio;
} |
Returns if the activity should always be sandboxed to the activity window bounds.
@hide
public boolean alwaysSandboxDisplayApis(ConstrainDisplayApisConfig constrainDisplayApisConfig) {
return isChangeEnabled(ALWAYS_SANDBOX_DISPLAY_APIS)
|| constrainDisplayApisConfig.getAlwaysConstrainDisplayApis(applicationInfo);
}
/** @hide
public void setMaxAspectRatio(@FloatRange(from = 0f) float maxAspectRatio) {
this.mMaxAspectRatio = maxAspectRatio >= 0f ? maxAspectRatio : 0f;
}
/** @hide | ActivityInfo::getMaxAspectRatio | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public void setMinAspectRatio(@FloatRange(from = 0f) float minAspectRatio) {
this.mMinAspectRatio = minAspectRatio >= 0f ? minAspectRatio : 0f;
} |
Returns if the activity should always be sandboxed to the activity window bounds.
@hide
public boolean alwaysSandboxDisplayApis(ConstrainDisplayApisConfig constrainDisplayApisConfig) {
return isChangeEnabled(ALWAYS_SANDBOX_DISPLAY_APIS)
|| constrainDisplayApisConfig.getAlwaysConstrainDisplayApis(applicationInfo);
}
/** @hide
public void setMaxAspectRatio(@FloatRange(from = 0f) float maxAspectRatio) {
this.mMaxAspectRatio = maxAspectRatio >= 0f ? maxAspectRatio : 0f;
}
/** @hide
public float getMaxAspectRatio() {
return mMaxAspectRatio;
}
/** @hide | ActivityInfo::setMinAspectRatio | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public float getMinAspectRatio(@ScreenOrientation int orientation) {
if (applicationInfo == null || !isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO) || (
isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_PORTRAIT_ONLY)
&& !isFixedOrientationPortrait(orientation))) {
return mMinAspectRatio;
}
if (isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_LARGE)) {
return Math.max(OVERRIDE_MIN_ASPECT_RATIO_LARGE_VALUE, mMinAspectRatio);
}
if (isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_MEDIUM)) {
return Math.max(OVERRIDE_MIN_ASPECT_RATIO_MEDIUM_VALUE, mMinAspectRatio);
}
return mMinAspectRatio;
} |
Returns the min aspect ratio of this activity.
This takes into account the minimum aspect ratio as defined in the app's manifest and
possible overrides as per OVERRIDE_MIN_ASPECT_RATIO.
In the rare cases where the manifest minimum aspect ratio is required, use
{@code getManifestMinAspectRatio}.
@hide
| ActivityInfo::getMinAspectRatio | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public void setKnownActivityEmbeddingCerts(@NonNull Set<String> knownActivityEmbeddingCerts) {
// Convert the provided digest to upper case for consistent Set membership
// checks when verifying the signing certificate digests of requesting apps.
mKnownActivityEmbeddingCerts = new ArraySet<>();
for (String knownCert : knownActivityEmbeddingCerts) {
mKnownActivityEmbeddingCerts.add(knownCert.toUpperCase(Locale.US));
}
} |
Sets the trusted host certificates of apps that are allowed to embed this activity.
@see #getKnownActivityEmbeddingCerts()
@hide
| ActivityInfo::setKnownActivityEmbeddingCerts | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public float getManifestMinAspectRatio() {
return mMinAspectRatio;
} |
Sets the trusted host certificates of apps that are allowed to embed this activity.
@see #getKnownActivityEmbeddingCerts()
@hide
public void setKnownActivityEmbeddingCerts(@NonNull Set<String> knownActivityEmbeddingCerts) {
// Convert the provided digest to upper case for consistent Set membership
// checks when verifying the signing certificate digests of requesting apps.
mKnownActivityEmbeddingCerts = new ArraySet<>();
for (String knownCert : knownActivityEmbeddingCerts) {
mKnownActivityEmbeddingCerts.add(knownCert.toUpperCase(Locale.US));
}
}
private boolean isChangeEnabled(long changeId) {
return CompatChanges.isChangeEnabled(changeId, applicationInfo.packageName,
UserHandle.getUserHandleForUid(applicationInfo.uid));
}
/** @hide | ActivityInfo::getManifestMinAspectRatio | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public static boolean isPreserveOrientationMode(int mode) {
return mode == RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION;
} |
Sets the trusted host certificates of apps that are allowed to embed this activity.
@see #getKnownActivityEmbeddingCerts()
@hide
public void setKnownActivityEmbeddingCerts(@NonNull Set<String> knownActivityEmbeddingCerts) {
// Convert the provided digest to upper case for consistent Set membership
// checks when verifying the signing certificate digests of requesting apps.
mKnownActivityEmbeddingCerts = new ArraySet<>();
for (String knownCert : knownActivityEmbeddingCerts) {
mKnownActivityEmbeddingCerts.add(knownCert.toUpperCase(Locale.US));
}
}
private boolean isChangeEnabled(long changeId) {
return CompatChanges.isChangeEnabled(changeId, applicationInfo.packageName,
UserHandle.getUserHandleForUid(applicationInfo.uid));
}
/** @hide
public float getManifestMinAspectRatio() {
return mMinAspectRatio;
}
/** @hide
@UnsupportedAppUsage
public static boolean isResizeableMode(int mode) {
return mode == RESIZE_MODE_RESIZEABLE
|| mode == RESIZE_MODE_FORCE_RESIZEABLE
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION
|| mode == RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION;
}
/** @hide | ActivityInfo::isPreserveOrientationMode | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public static String resizeModeToString(int mode) {
switch (mode) {
case RESIZE_MODE_UNRESIZEABLE:
return "RESIZE_MODE_UNRESIZEABLE";
case RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION:
return "RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION";
case RESIZE_MODE_RESIZEABLE:
return "RESIZE_MODE_RESIZEABLE";
case RESIZE_MODE_FORCE_RESIZEABLE:
return "RESIZE_MODE_FORCE_RESIZEABLE";
case RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY:
return "RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY";
case RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY:
return "RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY";
case RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION:
return "RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION";
default:
return "unknown=" + mode;
}
} |
Sets the trusted host certificates of apps that are allowed to embed this activity.
@see #getKnownActivityEmbeddingCerts()
@hide
public void setKnownActivityEmbeddingCerts(@NonNull Set<String> knownActivityEmbeddingCerts) {
// Convert the provided digest to upper case for consistent Set membership
// checks when verifying the signing certificate digests of requesting apps.
mKnownActivityEmbeddingCerts = new ArraySet<>();
for (String knownCert : knownActivityEmbeddingCerts) {
mKnownActivityEmbeddingCerts.add(knownCert.toUpperCase(Locale.US));
}
}
private boolean isChangeEnabled(long changeId) {
return CompatChanges.isChangeEnabled(changeId, applicationInfo.packageName,
UserHandle.getUserHandleForUid(applicationInfo.uid));
}
/** @hide
public float getManifestMinAspectRatio() {
return mMinAspectRatio;
}
/** @hide
@UnsupportedAppUsage
public static boolean isResizeableMode(int mode) {
return mode == RESIZE_MODE_RESIZEABLE
|| mode == RESIZE_MODE_FORCE_RESIZEABLE
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION
|| mode == RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION;
}
/** @hide
public static boolean isPreserveOrientationMode(int mode) {
return mode == RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION;
}
/** @hide | ActivityInfo::resizeModeToString | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public static String sizeChangesSupportModeToString(@SizeChangesSupportMode int mode) {
switch (mode) {
case SIZE_CHANGES_UNSUPPORTED_METADATA:
return "SIZE_CHANGES_UNSUPPORTED_METADATA";
case SIZE_CHANGES_UNSUPPORTED_OVERRIDE:
return "SIZE_CHANGES_UNSUPPORTED_OVERRIDE";
case SIZE_CHANGES_SUPPORTED_METADATA:
return "SIZE_CHANGES_SUPPORTED_METADATA";
case SIZE_CHANGES_SUPPORTED_OVERRIDE:
return "SIZE_CHANGES_SUPPORTED_OVERRIDE";
default:
return "unknown=" + mode;
}
} |
Sets the trusted host certificates of apps that are allowed to embed this activity.
@see #getKnownActivityEmbeddingCerts()
@hide
public void setKnownActivityEmbeddingCerts(@NonNull Set<String> knownActivityEmbeddingCerts) {
// Convert the provided digest to upper case for consistent Set membership
// checks when verifying the signing certificate digests of requesting apps.
mKnownActivityEmbeddingCerts = new ArraySet<>();
for (String knownCert : knownActivityEmbeddingCerts) {
mKnownActivityEmbeddingCerts.add(knownCert.toUpperCase(Locale.US));
}
}
private boolean isChangeEnabled(long changeId) {
return CompatChanges.isChangeEnabled(changeId, applicationInfo.packageName,
UserHandle.getUserHandleForUid(applicationInfo.uid));
}
/** @hide
public float getManifestMinAspectRatio() {
return mMinAspectRatio;
}
/** @hide
@UnsupportedAppUsage
public static boolean isResizeableMode(int mode) {
return mode == RESIZE_MODE_RESIZEABLE
|| mode == RESIZE_MODE_FORCE_RESIZEABLE
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION
|| mode == RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION;
}
/** @hide
public static boolean isPreserveOrientationMode(int mode) {
return mode == RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY
|| mode == RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION;
}
/** @hide
public static String resizeModeToString(int mode) {
switch (mode) {
case RESIZE_MODE_UNRESIZEABLE:
return "RESIZE_MODE_UNRESIZEABLE";
case RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION:
return "RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION";
case RESIZE_MODE_RESIZEABLE:
return "RESIZE_MODE_RESIZEABLE";
case RESIZE_MODE_FORCE_RESIZEABLE:
return "RESIZE_MODE_FORCE_RESIZEABLE";
case RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY:
return "RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY";
case RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY:
return "RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY";
case RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION:
return "RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION";
default:
return "unknown=" + mode;
}
}
/** @hide | ActivityInfo::sizeChangesSupportModeToString | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public boolean shouldCheckMinWidthHeightForMultiWindow() {
return isChangeEnabled(CHECK_MIN_WIDTH_HEIGHT_FOR_MULTI_WINDOW);
} |
Whether we should compare activity window layout min width/height with require space for
multi window to determine if it can be put into multi window mode.
@hide
| ActivityInfo::shouldCheckMinWidthHeightForMultiWindow | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public void dump(Printer pw, String prefix, int dumpFlags) {
super.dumpFront(pw, prefix);
if (permission != null) {
pw.println(prefix + "permission=" + permission);
}
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
pw.println(prefix + "taskAffinity=" + taskAffinity
+ " targetActivity=" + targetActivity
+ " persistableMode=" + persistableModeToString());
}
if (launchMode != 0 || flags != 0 || privateFlags != 0 || theme != 0) {
pw.println(prefix + "launchMode=" + launchMode
+ " flags=0x" + Integer.toHexString(flags)
+ " privateFlags=0x" + Integer.toHexString(privateFlags)
+ " theme=0x" + Integer.toHexString(theme));
}
if (screenOrientation != SCREEN_ORIENTATION_UNSPECIFIED
|| configChanges != 0 || softInputMode != 0) {
pw.println(prefix + "screenOrientation=" + screenOrientation
+ " configChanges=0x" + Integer.toHexString(configChanges)
+ " softInputMode=0x" + Integer.toHexString(softInputMode));
}
if (uiOptions != 0) {
pw.println(prefix + " uiOptions=0x" + Integer.toHexString(uiOptions));
}
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
pw.println(prefix + "lockTaskLaunchMode="
+ lockTaskLaunchModeToString(lockTaskLaunchMode));
}
if (windowLayout != null) {
pw.println(prefix + "windowLayout=" + windowLayout.width + "|"
+ windowLayout.widthFraction + ", " + windowLayout.height + "|"
+ windowLayout.heightFraction + ", " + windowLayout.gravity);
}
pw.println(prefix + "resizeMode=" + resizeModeToString(resizeMode));
if (requestedVrComponent != null) {
pw.println(prefix + "requestedVrComponent=" + requestedVrComponent);
}
if (getMaxAspectRatio() != 0) {
pw.println(prefix + "maxAspectRatio=" + getMaxAspectRatio());
}
final float minAspectRatio = getMinAspectRatio(screenOrientation);
if (minAspectRatio != 0) {
pw.println(prefix + "minAspectRatio=" + minAspectRatio);
if (getManifestMinAspectRatio() != minAspectRatio) {
pw.println(prefix + "getManifestMinAspectRatio=" + getManifestMinAspectRatio());
}
}
if (supportsSizeChanges) {
pw.println(prefix + "supportsSizeChanges=true");
}
if (mKnownActivityEmbeddingCerts != null) {
pw.println(prefix + "knownActivityEmbeddingCerts=" + mKnownActivityEmbeddingCerts);
}
super.dumpBack(pw, prefix, dumpFlags);
} |
Whether we should compare activity window layout min width/height with require space for
multi window to determine if it can be put into multi window mode.
@hide
public boolean shouldCheckMinWidthHeightForMultiWindow() {
return isChangeEnabled(CHECK_MIN_WIDTH_HEIGHT_FOR_MULTI_WINDOW);
}
public void dump(Printer pw, String prefix) {
dump(pw, prefix, DUMP_FLAG_ALL);
}
/** @hide | ActivityInfo::dump | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public static String screenOrientationToString(int orientation) {
switch (orientation) {
case SCREEN_ORIENTATION_UNSET:
return "SCREEN_ORIENTATION_UNSET";
case SCREEN_ORIENTATION_UNSPECIFIED:
return "SCREEN_ORIENTATION_UNSPECIFIED";
case SCREEN_ORIENTATION_LANDSCAPE:
return "SCREEN_ORIENTATION_LANDSCAPE";
case SCREEN_ORIENTATION_PORTRAIT:
return "SCREEN_ORIENTATION_PORTRAIT";
case SCREEN_ORIENTATION_USER:
return "SCREEN_ORIENTATION_USER";
case SCREEN_ORIENTATION_BEHIND:
return "SCREEN_ORIENTATION_BEHIND";
case SCREEN_ORIENTATION_SENSOR:
return "SCREEN_ORIENTATION_SENSOR";
case SCREEN_ORIENTATION_NOSENSOR:
return "SCREEN_ORIENTATION_NOSENSOR";
case SCREEN_ORIENTATION_SENSOR_LANDSCAPE:
return "SCREEN_ORIENTATION_SENSOR_LANDSCAPE";
case SCREEN_ORIENTATION_SENSOR_PORTRAIT:
return "SCREEN_ORIENTATION_SENSOR_PORTRAIT";
case SCREEN_ORIENTATION_REVERSE_LANDSCAPE:
return "SCREEN_ORIENTATION_REVERSE_LANDSCAPE";
case SCREEN_ORIENTATION_REVERSE_PORTRAIT:
return "SCREEN_ORIENTATION_REVERSE_PORTRAIT";
case SCREEN_ORIENTATION_FULL_SENSOR:
return "SCREEN_ORIENTATION_FULL_SENSOR";
case SCREEN_ORIENTATION_USER_LANDSCAPE:
return "SCREEN_ORIENTATION_USER_LANDSCAPE";
case SCREEN_ORIENTATION_USER_PORTRAIT:
return "SCREEN_ORIENTATION_USER_PORTRAIT";
case SCREEN_ORIENTATION_FULL_USER:
return "SCREEN_ORIENTATION_FULL_USER";
case SCREEN_ORIENTATION_LOCKED:
return "SCREEN_ORIENTATION_LOCKED";
default:
return Integer.toString(orientation);
}
} |
Convert the screen orientation constant to a human readable format.
@hide
| ActivityInfo::screenOrientationToString | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public static String colorModeToString(@ColorMode int colorMode) {
switch (colorMode) {
case COLOR_MODE_DEFAULT:
return "COLOR_MODE_DEFAULT";
case COLOR_MODE_WIDE_COLOR_GAMUT:
return "COLOR_MODE_WIDE_COLOR_GAMUT";
case COLOR_MODE_HDR:
return "COLOR_MODE_HDR";
case COLOR_MODE_A8:
return "COLOR_MODE_A8";
default:
return Integer.toString(colorMode);
}
} |
@hide
| ActivityInfo::colorModeToString | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public WindowLayout(int width, float widthFraction, int height, float heightFraction,
int gravity, int minWidth, int minHeight, String windowLayoutAffinity) {
this.width = width;
this.widthFraction = widthFraction;
this.height = height;
this.heightFraction = heightFraction;
this.gravity = gravity;
this.minWidth = minWidth;
this.minHeight = minHeight;
this.windowLayoutAffinity = windowLayoutAffinity;
} |
Contains information about position and size of the activity on the display.
Used in freeform mode to set desired position when activity is first launched.
It describes how big the activity wants to be in both width and height,
the minimal allowed size, and the gravity to be applied.
@attr ref android.R.styleable#AndroidManifestLayout_defaultWidth
@attr ref android.R.styleable#AndroidManifestLayout_defaultHeight
@attr ref android.R.styleable#AndroidManifestLayout_gravity
@attr ref android.R.styleable#AndroidManifestLayout_minWidth
@attr ref android.R.styleable#AndroidManifestLayout_minHeight
public static final class WindowLayout {
public WindowLayout(int width, float widthFraction, int height, float heightFraction,
int gravity, int minWidth, int minHeight) {
this(width, widthFraction, height, heightFraction, gravity, minWidth, minHeight,
null /* windowLayoutAffinity */);
}
/** @hide | WindowLayout::WindowLayout | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public WindowLayout(Parcel source) {
width = source.readInt();
widthFraction = source.readFloat();
height = source.readInt();
heightFraction = source.readFloat();
gravity = source.readInt();
minWidth = source.readInt();
minHeight = source.readInt();
windowLayoutAffinity = source.readString8();
} |
Contains information about position and size of the activity on the display.
Used in freeform mode to set desired position when activity is first launched.
It describes how big the activity wants to be in both width and height,
the minimal allowed size, and the gravity to be applied.
@attr ref android.R.styleable#AndroidManifestLayout_defaultWidth
@attr ref android.R.styleable#AndroidManifestLayout_defaultHeight
@attr ref android.R.styleable#AndroidManifestLayout_gravity
@attr ref android.R.styleable#AndroidManifestLayout_minWidth
@attr ref android.R.styleable#AndroidManifestLayout_minHeight
public static final class WindowLayout {
public WindowLayout(int width, float widthFraction, int height, float heightFraction,
int gravity, int minWidth, int minHeight) {
this(width, widthFraction, height, heightFraction, gravity, minWidth, minHeight,
null /* windowLayoutAffinity */);
}
/** @hide
public WindowLayout(int width, float widthFraction, int height, float heightFraction,
int gravity, int minWidth, int minHeight, String windowLayoutAffinity) {
this.width = width;
this.widthFraction = widthFraction;
this.height = height;
this.heightFraction = heightFraction;
this.gravity = gravity;
this.minWidth = minWidth;
this.minHeight = minHeight;
this.windowLayoutAffinity = windowLayoutAffinity;
}
/** @hide | WindowLayout::WindowLayout | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public boolean hasSpecifiedSize() {
return width >= 0 || height >= 0 || widthFraction >= 0 || heightFraction >= 0;
} |
Returns if this {@link WindowLayout} has specified bounds.
@hide
| WindowLayout::hasSpecifiedSize | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
public void writeToParcel(Parcel dest) {
dest.writeInt(width);
dest.writeFloat(widthFraction);
dest.writeInt(height);
dest.writeFloat(heightFraction);
dest.writeInt(gravity);
dest.writeInt(minWidth);
dest.writeInt(minHeight);
dest.writeString8(windowLayoutAffinity);
} |
Returns if this {@link WindowLayout} has specified bounds.
@hide
public boolean hasSpecifiedSize() {
return width >= 0 || height >= 0 || widthFraction >= 0 || heightFraction >= 0;
}
/** @hide | WindowLayout::writeToParcel | java | Reginer/aosp-android-jar | android-33/src/android/content/pm/ActivityInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/pm/ActivityInfo.java | MIT |
void setToken(IBinder token) {
switch (mWindowState) {
case WindowState.TOKEN_PENDING:
// Normal scenario. Nothing to worry about.
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.token = token;
getWindow().setAttributes(lp);
updateWindowState(WindowState.TOKEN_SET);
// As soon as we have a token, make sure the window is added (but not shown) by
// setting visibility to INVISIBLE and calling show() on Dialog. Note that
// WindowInsetsController.OnControllableInsetsChangedListener relies on the window
// being added to function.
getWindow().getDecorView().setVisibility(View.INVISIBLE);
show();
return;
case WindowState.TOKEN_SET:
case WindowState.SHOWN_AT_LEAST_ONCE:
case WindowState.REJECTED_AT_LEAST_ONCE:
throw new IllegalStateException("setToken can be called only once");
case WindowState.DESTROYED:
// Just ignore. Since there are multiple event queues from the token is issued
// in the system server to the timing when it arrives here, it can be delivered
// after the is already destroyed. No one should be blamed because of such an
// unfortunate but possible scenario.
Log.i(TAG, "Ignoring setToken() because window is already destroyed.");
return;
default:
throw new IllegalStateException("Unexpected state=" + mWindowState);
}
} |
Set {@link IBinder} window token to the window.
<p>This method can be called only once.</p>
@param token {@link IBinder} token to be associated with the window.
| SoftInputWindow::setToken | java | Reginer/aosp-android-jar | android-33/src/android/inputmethodservice/SoftInputWindow.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/inputmethodservice/SoftInputWindow.java | MIT |
SoftInputWindow(InputMethodService service, int theme,
KeyEvent.DispatcherState dispatcherState) {
super(service, theme);
mService = service;
mDispatcherState = dispatcherState;
} |
Create a SoftInputWindow that uses a custom style.
@param service The {@link InputMethodService} in which the DockWindow should run. In
particular, it uses the window manager and theme from this context
to present its UI.
@param theme A style resource describing the theme to use for the window.
See <a href="{@docRoot}reference/available-resources.html#stylesandthemes">Style
and Theme Resources</a> for more information about defining and
using styles. This theme is applied on top of the current theme in
<var>context</var>. If 0, the default dialog theme will be used.
| SoftInputWindow::SoftInputWindow | java | Reginer/aosp-android-jar | android-33/src/android/inputmethodservice/SoftInputWindow.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/inputmethodservice/SoftInputWindow.java | MIT |
private final BroadcastReceiver mOnScreenOffHandler = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
synchronized (mLock) {
// must unregister first before updating
unregisterScreenOffEventLocked();
updateLocked(0, 0);
}
}
}; |
DO NOT USE DIRECTLY
see register registerScreenOffEvent and unregisterScreenOffEvent
| getSimpleName::BroadcastReceiver | java | Reginer/aosp-android-jar | android-31/src/com/android/server/UiModeManagerService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/UiModeManagerService.java | MIT |
public Intent getServiceIntent() {
Intent intent = new Intent();
intent.setClassName(packageName, className);
return intent;
} |
Returns the intent to start the {@link #className} service.
| InjectedSetting::getServiceIntent | java | Reginer/aosp-android-jar | android-32/src/com/android/settingslib/location/InjectedSetting.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/settingslib/location/InjectedSetting.java | MIT |
public characterdatareplacedatanomodificationallowederr(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "staff", true);
} |
Constructor.
@param factory document factory, may not be null
@throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
| characterdatareplacedatanomodificationallowederr::characterdatareplacedatanomodificationallowederr | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java | MIT |
public void runTest() throws Throwable {
Document doc;
NodeList genderList;
Node genderNode;
Node entElement;
Node entElementContent;
Node entReference;
int nodeType;
doc = (Document) load("staff", true);
genderList = doc.getElementsByTagName("gender");
genderNode = genderList.item(2);
entReference = genderNode.getFirstChild();
assertNotNull("entReferenceNotNull", entReference);
nodeType = (int) entReference.getNodeType();
if (equals(1, nodeType)) {
entReference = doc.createEntityReference("ent4");
assertNotNull("createdEntRefNotNull", entReference);
}
entElement = entReference.getFirstChild();
assertNotNull("entElementNotNull", entElement);
entElementContent = entElement.getFirstChild();
assertNotNull("entElementContentNotNull", entElementContent);
{
boolean success = false;
try {
((CharacterData) /*Node */entElementContent).replaceData(1, 3, "newArg");
} catch (DOMException ex) {
success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
}
} |
Runs the test case.
@throws Throwable Any uncaught exception causes test to fail
| characterdatareplacedatanomodificationallowederr::runTest | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java | MIT |
public String getTargetURI() {
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/characterdatareplacedatanomodificationallowederr";
} |
Gets URI that identifies the test.
@return uri identifier of test
| characterdatareplacedatanomodificationallowederr::getTargetURI | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java | MIT |
public static void main(final String[] args) {
DOMTestCase.doMain(characterdatareplacedatanomodificationallowederr.class, args);
} |
Runs this test from the command line.
@param args command line arguments
| characterdatareplacedatanomodificationallowederr::main | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level1/core/characterdatareplacedatanomodificationallowederr.java | MIT |
public @Config int getChangingConfiguration() {
return mChangingConfiguration;
} |
@hide
| BaseInterpolator::getChangingConfiguration | java | Reginer/aosp-android-jar | android-31/src/android/view/animation/BaseInterpolator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/view/animation/BaseInterpolator.java | MIT |
void setChangingConfiguration(@Config int changingConfiguration) {
mChangingConfiguration = changingConfiguration;
} |
@hide
| BaseInterpolator::setChangingConfiguration | java | Reginer/aosp-android-jar | android-31/src/android/view/animation/BaseInterpolator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/view/animation/BaseInterpolator.java | MIT |
public static View getTextToastView(Context context, CharSequence text) {
View view = LayoutInflater.from(context).inflate(TEXT_TOAST_LAYOUT, null);
TextView textView = view.findViewById(com.android.internal.R.id.message);
textView.setText(text);
return view;
} |
Returns the default text toast view for message {@code text}.
| ToastPresenter::getTextToastView | java | Reginer/aosp-android-jar | android-31/src/android/widget/ToastPresenter.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/ToastPresenter.java | MIT |
public Builder(
@NonNull Icon icon,
@NonNull CharSequence label,
@NonNull PendingIntent action) {
Objects.requireNonNull(icon, "icon can not be null");
Objects.requireNonNull(label, "label can not be null");
Objects.requireNonNull(action, "pending intent can not be null");
mIcon = icon;
mLabel = label;
mAction = action;
} |
Construct a new builder for {@link ChooserAction} object.
@param icon an {@link Icon} representing this action, consisting of a white foreground
atop a transparent background.
@param label label the user-readable label for this action.
@param action {@link PendingIntent} to be invoked when the action is selected.
| Builder::Builder | java | Reginer/aosp-android-jar | android-35/src/android/service/chooser/ChooserAction.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/chooser/ChooserAction.java | MIT |
public LinearLayoutManager(Context context) {
this(context, VERTICAL, false);
} |
Creates a vertical LinearLayoutManager
@param context Current context, will be used to access resources.
| LinearLayoutManager::LinearLayoutManager | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public LinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
setOrientation(orientation);
setReverseLayout(reverseLayout);
setAutoMeasureEnabled(true);
} |
@param context Current context, will be used to access resources.
@param orientation Layout orientation. Should be {@link #HORIZONTAL} or {@link
#VERTICAL}.
@param reverseLayout When set to true, layouts from end to start.
| LinearLayoutManager::LinearLayoutManager | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public LinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
Properties properties = getProperties(context, attrs, defStyleAttr, defStyleRes);
setOrientation(properties.orientation);
setReverseLayout(properties.reverseLayout);
setStackFromEnd(properties.stackFromEnd);
setAutoMeasureEnabled(true);
} |
Constructor used when layout manager is set in XML by RecyclerView attribute
"layoutManager". Defaults to vertical orientation.
| LinearLayoutManager::LinearLayoutManager | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public boolean getRecycleChildrenOnDetach() {
return mRecycleChildrenOnDetach;
} |
Returns whether LayoutManager will recycle its children when it is detached from
RecyclerView.
@return true if LayoutManager will recycle its children when it is detached from
RecyclerView.
| LinearLayoutManager::getRecycleChildrenOnDetach | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public void setRecycleChildrenOnDetach(boolean recycleChildrenOnDetach) {
mRecycleChildrenOnDetach = recycleChildrenOnDetach;
} |
Set whether LayoutManager will recycle its children when it is detached from
RecyclerView.
<p>
If you are using a {@link RecyclerView.RecycledViewPool}, it might be a good idea to set
this flag to <code>true</code> so that views will be available to other RecyclerViews
immediately.
<p>
Note that, setting this flag will result in a performance drop if RecyclerView
is restored.
@param recycleChildrenOnDetach Whether children should be recycled in detach or not.
| LinearLayoutManager::setRecycleChildrenOnDetach | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public void setStackFromEnd(boolean stackFromEnd) {
assertNotInLayoutOrScroll(null);
if (mStackFromEnd == stackFromEnd) {
return;
}
mStackFromEnd = stackFromEnd;
requestLayout();
} |
Compatibility support for {@link android.widget.AbsListView#setStackFromBottom(boolean)}
| LinearLayoutManager::setStackFromEnd | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public int getOrientation() {
return mOrientation;
} |
Returns the current orientation of the layout.
@return Current orientation, either {@link #HORIZONTAL} or {@link #VERTICAL}
@see #setOrientation(int)
| LinearLayoutManager::getOrientation | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public void setOrientation(int orientation) {
if (orientation != HORIZONTAL && orientation != VERTICAL) {
throw new IllegalArgumentException("invalid orientation:" + orientation);
}
assertNotInLayoutOrScroll(null);
if (orientation == mOrientation) {
return;
}
mOrientation = orientation;
mOrientationHelper = null;
requestLayout();
} |
Sets the orientation of the layout. {@link com.android.internal.widget.LinearLayoutManager}
will do its best to keep scroll position.
@param orientation {@link #HORIZONTAL} or {@link #VERTICAL}
| LinearLayoutManager::setOrientation | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private void resolveShouldLayoutReverse() {
// A == B is the same result, but we rather keep it readable
if (mOrientation == VERTICAL || !isLayoutRTL()) {
mShouldReverseLayout = mReverseLayout;
} else {
mShouldReverseLayout = !mReverseLayout;
}
} |
Calculates the view layout order. (e.g. from end to start or start to end)
RTL layout support is applied automatically. So if layout is RTL and
{@link #getReverseLayout()} is {@code true}, elements will be laid out starting from left.
| LinearLayoutManager::resolveShouldLayoutReverse | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public boolean getReverseLayout() {
return mReverseLayout;
} |
Returns if views are laid out from the opposite direction of the layout.
@return If layout is reversed or not.
@see #setReverseLayout(boolean)
| LinearLayoutManager::getReverseLayout | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public void setReverseLayout(boolean reverseLayout) {
assertNotInLayoutOrScroll(null);
if (reverseLayout == mReverseLayout) {
return;
}
mReverseLayout = reverseLayout;
requestLayout();
} |
Used to reverse item traversal and layout order.
This behaves similar to the layout change for RTL views. When set to true, first item is
laid out at the end of the UI, second item is laid out before it etc.
For horizontal layouts, it depends on the layout direction.
When set to true, If {@link com.android.internal.widget.RecyclerView} is LTR, than it will
layout from RTL, if {@link com.android.internal.widget.RecyclerView}} is RTL, it will layout
from LTR.
If you are looking for the exact same behavior of
{@link android.widget.AbsListView#setStackFromBottom(boolean)}, use
{@link #setStackFromEnd(boolean)}
| LinearLayoutManager::setReverseLayout | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
protected int getExtraLayoutSpace(RecyclerView.State state) {
if (state.hasTargetScrollPosition()) {
return mOrientationHelper.getTotalSpace();
} else {
return 0;
}
} |
<p>Returns the amount of extra space that should be laid out by LayoutManager.</p>
<p>By default, {@link com.android.internal.widget.LinearLayoutManager} lays out 1 extra page
of items while smooth scrolling and 0 otherwise. You can override this method to implement
your custom layout pre-cache logic.</p>
<p><strong>Note:</strong>Laying out invisible elements generally comes with significant
performance cost. It's typically only desirable in places like smooth scrolling to an unknown
location, where 1) the extra content helps LinearLayoutManager know in advance when its
target is approaching, so it can decelerate early and smoothly and 2) while motion is
continuous.</p>
<p>Extending the extra layout space is especially expensive if done while the user may change
scrolling direction. Changing direction will cause the extra layout space to swap to the
opposite side of the viewport, incurring many rebinds/recycles, unless the cache is large
enough to handle it.</p>
@return The extra space that should be laid out (in pixels).
| LinearLayoutManager::getExtraLayoutSpace | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
void onAnchorReady(RecyclerView.Recycler recycler, RecyclerView.State state,
AnchorInfo anchorInfo, int firstLayoutItemDirection) {
} |
Method called when Anchor position is decided. Extending class can setup accordingly or
even update anchor info if necessary.
@param recycler The recycler for the layout
@param state The layout state
@param anchorInfo The mutable POJO that keeps the position and offset.
@param firstLayoutItemDirection The direction of the first layout filling in terms of adapter
indices.
| LinearLayoutManager::onAnchorReady | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private void layoutForPredictiveAnimations(RecyclerView.Recycler recycler,
RecyclerView.State state, int startOffset, int endOffset) {
// If there are scrap children that we did not layout, we need to find where they did go
// and layout them accordingly so that animations can work as expected.
// This case may happen if new views are added or an existing view expands and pushes
// another view out of bounds.
if (!state.willRunPredictiveAnimations() || getChildCount() == 0 || state.isPreLayout()
|| !supportsPredictiveItemAnimations()) {
return;
}
// to make the logic simpler, we calculate the size of children and call fill.
int scrapExtraStart = 0, scrapExtraEnd = 0;
final List<RecyclerView.ViewHolder> scrapList = recycler.getScrapList();
final int scrapSize = scrapList.size();
final int firstChildPos = getPosition(getChildAt(0));
for (int i = 0; i < scrapSize; i++) {
RecyclerView.ViewHolder scrap = scrapList.get(i);
if (scrap.isRemoved()) {
continue;
}
final int position = scrap.getLayoutPosition();
final int direction = position < firstChildPos != mShouldReverseLayout
? LayoutState.LAYOUT_START : LayoutState.LAYOUT_END;
if (direction == LayoutState.LAYOUT_START) {
scrapExtraStart += mOrientationHelper.getDecoratedMeasurement(scrap.itemView);
} else {
scrapExtraEnd += mOrientationHelper.getDecoratedMeasurement(scrap.itemView);
}
}
if (DEBUG) {
Log.d(TAG, "for unused scrap, decided to add " + scrapExtraStart
+ " towards start and " + scrapExtraEnd + " towards end");
}
mLayoutState.mScrapList = scrapList;
if (scrapExtraStart > 0) {
View anchor = getChildClosestToStart();
updateLayoutStateToFillStart(getPosition(anchor), startOffset);
mLayoutState.mExtra = scrapExtraStart;
mLayoutState.mAvailable = 0;
mLayoutState.assignPositionFromScrapList();
fill(recycler, mLayoutState, state, false);
}
if (scrapExtraEnd > 0) {
View anchor = getChildClosestToEnd();
updateLayoutStateToFillEnd(getPosition(anchor), endOffset);
mLayoutState.mExtra = scrapExtraEnd;
mLayoutState.mAvailable = 0;
mLayoutState.assignPositionFromScrapList();
fill(recycler, mLayoutState, state, false);
}
mLayoutState.mScrapList = null;
} |
If necessary, layouts new items for predictive animations
| LinearLayoutManager::layoutForPredictiveAnimations | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private boolean updateAnchorFromChildren(RecyclerView.Recycler recycler,
RecyclerView.State state, AnchorInfo anchorInfo) {
if (getChildCount() == 0) {
return false;
}
final View focused = getFocusedChild();
if (focused != null && anchorInfo.isViewValidAsAnchor(focused, state)) {
anchorInfo.assignFromViewAndKeepVisibleRect(focused);
return true;
}
if (mLastStackFromEnd != mStackFromEnd) {
return false;
}
View referenceChild = anchorInfo.mLayoutFromEnd
? findReferenceChildClosestToEnd(recycler, state)
: findReferenceChildClosestToStart(recycler, state);
if (referenceChild != null) {
anchorInfo.assignFromView(referenceChild);
// If all visible views are removed in 1 pass, reference child might be out of bounds.
// If that is the case, offset it back to 0 so that we use these pre-layout children.
if (!state.isPreLayout() && supportsPredictiveItemAnimations()) {
// validate this child is at least partially visible. if not, offset it to start
final boolean notVisible =
mOrientationHelper.getDecoratedStart(referenceChild) >= mOrientationHelper
.getEndAfterPadding()
|| mOrientationHelper.getDecoratedEnd(referenceChild)
< mOrientationHelper.getStartAfterPadding();
if (notVisible) {
anchorInfo.mCoordinate = anchorInfo.mLayoutFromEnd
? mOrientationHelper.getEndAfterPadding()
: mOrientationHelper.getStartAfterPadding();
}
}
return true;
}
return false;
} |
Finds an anchor child from existing Views. Most of the time, this is the view closest to
start or end that has a valid position (e.g. not removed).
<p>
If a child has focus, it is given priority.
| LinearLayoutManager::updateAnchorFromChildren | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private boolean updateAnchorFromPendingData(RecyclerView.State state, AnchorInfo anchorInfo) {
if (state.isPreLayout() || mPendingScrollPosition == NO_POSITION) {
return false;
}
// validate scroll position
if (mPendingScrollPosition < 0 || mPendingScrollPosition >= state.getItemCount()) {
mPendingScrollPosition = NO_POSITION;
mPendingScrollPositionOffset = INVALID_OFFSET;
if (DEBUG) {
Log.e(TAG, "ignoring invalid scroll position " + mPendingScrollPosition);
}
return false;
}
// if child is visible, try to make it a reference child and ensure it is fully visible.
// if child is not visible, align it depending on its virtual position.
anchorInfo.mPosition = mPendingScrollPosition;
if (mPendingSavedState != null && mPendingSavedState.hasValidAnchor()) {
// Anchor offset depends on how that child was laid out. Here, we update it
// according to our current view bounds
anchorInfo.mLayoutFromEnd = mPendingSavedState.mAnchorLayoutFromEnd;
if (anchorInfo.mLayoutFromEnd) {
anchorInfo.mCoordinate = mOrientationHelper.getEndAfterPadding()
- mPendingSavedState.mAnchorOffset;
} else {
anchorInfo.mCoordinate = mOrientationHelper.getStartAfterPadding()
+ mPendingSavedState.mAnchorOffset;
}
return true;
}
if (mPendingScrollPositionOffset == INVALID_OFFSET) {
View child = findViewByPosition(mPendingScrollPosition);
if (child != null) {
final int childSize = mOrientationHelper.getDecoratedMeasurement(child);
if (childSize > mOrientationHelper.getTotalSpace()) {
// item does not fit. fix depending on layout direction
anchorInfo.assignCoordinateFromPadding();
return true;
}
final int startGap = mOrientationHelper.getDecoratedStart(child)
- mOrientationHelper.getStartAfterPadding();
if (startGap < 0) {
anchorInfo.mCoordinate = mOrientationHelper.getStartAfterPadding();
anchorInfo.mLayoutFromEnd = false;
return true;
}
final int endGap = mOrientationHelper.getEndAfterPadding()
- mOrientationHelper.getDecoratedEnd(child);
if (endGap < 0) {
anchorInfo.mCoordinate = mOrientationHelper.getEndAfterPadding();
anchorInfo.mLayoutFromEnd = true;
return true;
}
anchorInfo.mCoordinate = anchorInfo.mLayoutFromEnd
? (mOrientationHelper.getDecoratedEnd(child) + mOrientationHelper
.getTotalSpaceChange())
: mOrientationHelper.getDecoratedStart(child);
} else { // item is not visible.
if (getChildCount() > 0) {
// get position of any child, does not matter
int pos = getPosition(getChildAt(0));
anchorInfo.mLayoutFromEnd = mPendingScrollPosition < pos
== mShouldReverseLayout;
}
anchorInfo.assignCoordinateFromPadding();
}
return true;
}
// override layout from end values for consistency
anchorInfo.mLayoutFromEnd = mShouldReverseLayout;
// if this changes, we should update prepareForDrop as well
if (mShouldReverseLayout) {
anchorInfo.mCoordinate = mOrientationHelper.getEndAfterPadding()
- mPendingScrollPositionOffset;
} else {
anchorInfo.mCoordinate = mOrientationHelper.getStartAfterPadding()
+ mPendingScrollPositionOffset;
}
return true;
} |
If there is a pending scroll position or saved states, updates the anchor info from that
data and returns true
| LinearLayoutManager::updateAnchorFromPendingData | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private int fixLayoutEndGap(int endOffset, RecyclerView.Recycler recycler,
RecyclerView.State state, boolean canOffsetChildren) {
int gap = mOrientationHelper.getEndAfterPadding() - endOffset;
int fixOffset = 0;
if (gap > 0) {
fixOffset = -scrollBy(-gap, recycler, state);
} else {
return 0; // nothing to fix
}
// move offset according to scroll amount
endOffset += fixOffset;
if (canOffsetChildren) {
// re-calculate gap, see if we could fix it
gap = mOrientationHelper.getEndAfterPadding() - endOffset;
if (gap > 0) {
mOrientationHelper.offsetChildren(gap);
return gap + fixOffset;
}
}
return fixOffset;
} |
@return The final offset amount for children
| LinearLayoutManager::fixLayoutEndGap | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private int fixLayoutStartGap(int startOffset, RecyclerView.Recycler recycler,
RecyclerView.State state, boolean canOffsetChildren) {
int gap = startOffset - mOrientationHelper.getStartAfterPadding();
int fixOffset = 0;
if (gap > 0) {
// check if we should fix this gap.
fixOffset = -scrollBy(gap, recycler, state);
} else {
return 0; // nothing to fix
}
startOffset += fixOffset;
if (canOffsetChildren) {
// re-calculate gap, see if we could fix it
gap = startOffset - mOrientationHelper.getStartAfterPadding();
if (gap > 0) {
mOrientationHelper.offsetChildren(-gap);
return fixOffset - gap;
}
}
return fixOffset;
} |
@return The final offset amount for children
| LinearLayoutManager::fixLayoutStartGap | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
LayoutState createLayoutState() {
return new LayoutState();
} |
Test overrides this to plug some tracking and verification.
@return A new LayoutState
| LinearLayoutManager::createLayoutState | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public void scrollToPositionWithOffset(int position, int offset) {
mPendingScrollPosition = position;
mPendingScrollPositionOffset = offset;
if (mPendingSavedState != null) {
mPendingSavedState.invalidateAnchor();
}
requestLayout();
} |
Scroll to the specified adapter position with the given offset from resolved layout
start. Resolved layout start depends on {@link #getReverseLayout()},
{@link View#getLayoutDirection()} and {@link #getStackFromEnd()}.
<p>
For example, if layout is {@link #VERTICAL} and {@link #getStackFromEnd()} is true, calling
<code>scrollToPositionWithOffset(10, 20)</code> will layout such that
<code>item[10]</code>'s bottom is 20 pixels above the RecyclerView's bottom.
<p>
Note that scroll position change will not be reflected until the next layout call.
<p>
If you are just trying to make a position visible, use {@link #scrollToPosition(int)}.
@param position Index (starting at 0) of the reference item.
@param offset The distance (in pixels) between the start edge of the item view and
start edge of the RecyclerView.
@see #setReverseLayout(boolean)
@see #scrollToPosition(int)
| LinearLayoutManager::scrollToPositionWithOffset | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public void setSmoothScrollbarEnabled(boolean enabled) {
mSmoothScrollbarEnabled = enabled;
} |
When smooth scrollbar is enabled, the position and size of the scrollbar thumb is computed
based on the number of visible pixels in the visible items. This however assumes that all
list items have similar or equal widths or heights (depending on list orientation).
If you use a list in which items have different dimensions, the scrollbar will change
appearance as the user scrolls through the list. To avoid this issue, you need to disable
this property.
When smooth scrollbar is disabled, the position and size of the scrollbar thumb is based
solely on the number of items in the adapter and the position of the visible items inside
the adapter. This provides a stable scrollbar as the user navigates through a list of items
with varying widths / heights.
@param enabled Whether or not to enable smooth scrollbar.
@see #setSmoothScrollbarEnabled(boolean)
| LinearLayoutManager::setSmoothScrollbarEnabled | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public boolean isSmoothScrollbarEnabled() {
return mSmoothScrollbarEnabled;
} |
Returns the current state of the smooth scrollbar feature. It is enabled by default.
@return True if smooth scrollbar is enabled, false otherwise.
@see #setSmoothScrollbarEnabled(boolean)
| LinearLayoutManager::isSmoothScrollbarEnabled | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public void setInitialPrefetchItemCount(int itemCount) {
mInitialItemPrefetchCount = itemCount;
} |
Sets the number of items to prefetch in
{@link #collectInitialPrefetchPositions(int, LayoutPrefetchRegistry)}, which defines
how many inner items should be prefetched when this LayoutManager's RecyclerView
is nested inside another RecyclerView.
<p>Set this value to the number of items this inner LayoutManager will display when it is
first scrolled into the viewport. RecyclerView will attempt to prefetch that number of items
so they are ready, avoiding jank as the inner RecyclerView is scrolled into the viewport.</p>
<p>For example, take a vertically scrolling RecyclerView with horizontally scrolling inner
RecyclerViews. The rows always have 4 items visible in them (or 5 if not aligned). Passing
<code>4</code> to this method for each inner RecyclerView's LinearLayoutManager will enable
RecyclerView's prefetching feature to do create/bind work for 4 views within a row early,
before it is scrolled on screen, instead of just the default 2.</p>
<p>Calling this method does nothing unless the LayoutManager is in a RecyclerView
nested in another RecyclerView.</p>
<p class="note"><strong>Note:</strong> Setting this value to be larger than the number of
views that will be visible in this view can incur unnecessary bind work, and an increase to
the number of Views created and in active use.</p>
@param itemCount Number of items to prefetch
@see #isItemPrefetchEnabled()
@see #getInitialItemPrefetchCount()
@see #collectInitialPrefetchPositions(int, LayoutPrefetchRegistry)
| LinearLayoutManager::setInitialPrefetchItemCount | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public int getInitialItemPrefetchCount() {
return mInitialItemPrefetchCount;
} |
Gets the number of items to prefetch in
{@link #collectInitialPrefetchPositions(int, LayoutPrefetchRegistry)}, which defines
how many inner items should be prefetched when this LayoutManager's RecyclerView
is nested inside another RecyclerView.
@see #isItemPrefetchEnabled()
@see #setInitialPrefetchItemCount(int)
@see #collectInitialPrefetchPositions(int, LayoutPrefetchRegistry)
@return number of items to prefetch.
| LinearLayoutManager::getInitialItemPrefetchCount | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private void recycleChildren(RecyclerView.Recycler recycler, int startIndex, int endIndex) {
if (startIndex == endIndex) {
return;
}
if (DEBUG) {
Log.d(TAG, "Recycling " + Math.abs(startIndex - endIndex) + " items");
}
if (endIndex > startIndex) {
for (int i = endIndex - 1; i >= startIndex; i--) {
removeAndRecycleViewAt(i, recycler);
}
} else {
for (int i = startIndex; i > endIndex; i--) {
removeAndRecycleViewAt(i, recycler);
}
}
} |
Recycles children between given indices.
@param startIndex inclusive
@param endIndex exclusive
| LinearLayoutManager::recycleChildren | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private void recycleViewsFromStart(RecyclerView.Recycler recycler, int dt) {
if (dt < 0) {
if (DEBUG) {
Log.d(TAG, "Called recycle from start with a negative value. This might happen"
+ " during layout changes but may be sign of a bug");
}
return;
}
// ignore padding, ViewGroup may not clip children.
final int limit = dt;
final int childCount = getChildCount();
if (mShouldReverseLayout) {
for (int i = childCount - 1; i >= 0; i--) {
View child = getChildAt(i);
if (mOrientationHelper.getDecoratedEnd(child) > limit
|| mOrientationHelper.getTransformedEndWithDecoration(child) > limit) {
// stop here
recycleChildren(recycler, childCount - 1, i);
return;
}
}
} else {
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (mOrientationHelper.getDecoratedEnd(child) > limit
|| mOrientationHelper.getTransformedEndWithDecoration(child) > limit) {
// stop here
recycleChildren(recycler, 0, i);
return;
}
}
}
} |
Recycles views that went out of bounds after scrolling towards the end of the layout.
<p>
Checks both layout position and visible position to guarantee that the view is not visible.
@param recycler Recycler instance of {@link com.android.internal.widget.RecyclerView}
@param dt This can be used to add additional padding to the visible area. This is used
to detect children that will go out of bounds after scrolling, without
actually moving them.
| LinearLayoutManager::recycleViewsFromStart | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private void recycleViewsFromEnd(RecyclerView.Recycler recycler, int dt) {
final int childCount = getChildCount();
if (dt < 0) {
if (DEBUG) {
Log.d(TAG, "Called recycle from end with a negative value. This might happen"
+ " during layout changes but may be sign of a bug");
}
return;
}
final int limit = mOrientationHelper.getEnd() - dt;
if (mShouldReverseLayout) {
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (mOrientationHelper.getDecoratedStart(child) < limit
|| mOrientationHelper.getTransformedStartWithDecoration(child) < limit) {
// stop here
recycleChildren(recycler, 0, i);
return;
}
}
} else {
for (int i = childCount - 1; i >= 0; i--) {
View child = getChildAt(i);
if (mOrientationHelper.getDecoratedStart(child) < limit
|| mOrientationHelper.getTransformedStartWithDecoration(child) < limit) {
// stop here
recycleChildren(recycler, childCount - 1, i);
return;
}
}
}
} |
Recycles views that went out of bounds after scrolling towards the start of the layout.
<p>
Checks both layout position and visible position to guarantee that the view is not visible.
@param recycler Recycler instance of {@link com.android.internal.widget.RecyclerView}
@param dt This can be used to add additional padding to the visible area. This is used
to detect children that will go out of bounds after scrolling, without
actually moving them.
| LinearLayoutManager::recycleViewsFromEnd | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private void recycleByLayoutState(RecyclerView.Recycler recycler, LayoutState layoutState) {
if (!layoutState.mRecycle || layoutState.mInfinite) {
return;
}
if (layoutState.mLayoutDirection == LayoutState.LAYOUT_START) {
recycleViewsFromEnd(recycler, layoutState.mScrollingOffset);
} else {
recycleViewsFromStart(recycler, layoutState.mScrollingOffset);
}
} |
Helper method to call appropriate recycle method depending on current layout direction
@param recycler Current recycler that is attached to RecyclerView
@param layoutState Current layout state. Right now, this object does not change but
we may consider moving it out of this view so passing around as a
parameter for now, rather than accessing {@link #mLayoutState}
@see #recycleViewsFromStart(com.android.internal.widget.RecyclerView.Recycler, int)
@see #recycleViewsFromEnd(com.android.internal.widget.RecyclerView.Recycler, int)
@see com.android.internal.widget.LinearLayoutManager.LayoutState#mLayoutDirection
| LinearLayoutManager::recycleByLayoutState | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
int fill(RecyclerView.Recycler recycler, LayoutState layoutState,
RecyclerView.State state, boolean stopOnFocusable) {
// max offset we should set is mFastScroll + available
final int start = layoutState.mAvailable;
if (layoutState.mScrollingOffset != LayoutState.SCROLLING_OFFSET_NaN) {
// TODO ugly bug fix. should not happen
if (layoutState.mAvailable < 0) {
layoutState.mScrollingOffset += layoutState.mAvailable;
}
recycleByLayoutState(recycler, layoutState);
}
int remainingSpace = layoutState.mAvailable + layoutState.mExtra;
LayoutChunkResult layoutChunkResult = mLayoutChunkResult;
while ((layoutState.mInfinite || remainingSpace > 0) && layoutState.hasMore(state)) {
layoutChunkResult.resetInternal();
layoutChunk(recycler, state, layoutState, layoutChunkResult);
if (layoutChunkResult.mFinished) {
break;
}
layoutState.mOffset += layoutChunkResult.mConsumed * layoutState.mLayoutDirection;
/**
* Consume the available space if:
* * layoutChunk did not request to be ignored
* * OR we are laying out scrap children
* * OR we are not doing pre-layout
*/
if (!layoutChunkResult.mIgnoreConsumed || mLayoutState.mScrapList != null
|| !state.isPreLayout()) {
layoutState.mAvailable -= layoutChunkResult.mConsumed;
// we keep a separate remaining space because mAvailable is important for recycling
remainingSpace -= layoutChunkResult.mConsumed;
}
if (layoutState.mScrollingOffset != LayoutState.SCROLLING_OFFSET_NaN) {
layoutState.mScrollingOffset += layoutChunkResult.mConsumed;
if (layoutState.mAvailable < 0) {
layoutState.mScrollingOffset += layoutState.mAvailable;
}
recycleByLayoutState(recycler, layoutState);
}
if (stopOnFocusable && layoutChunkResult.mFocusable) {
break;
}
}
if (DEBUG) {
validateChildOrder();
}
return start - layoutState.mAvailable;
} |
The magic functions :). Fills the given layout, defined by the layoutState. This is fairly
independent from the rest of the {@link com.android.internal.widget.LinearLayoutManager}
and with little change, can be made publicly available as a helper class.
@param recycler Current recycler that is attached to RecyclerView
@param layoutState Configuration on how we should fill out the available space.
@param state Context passed by the RecyclerView to control scroll steps.
@param stopOnFocusable If true, filling stops in the first focusable new child
@return Number of pixels that it added. Useful for scroll functions.
| LinearLayoutManager::fill | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
int convertFocusDirectionToLayoutDirection(int focusDirection) {
switch (focusDirection) {
case View.FOCUS_BACKWARD:
if (mOrientation == VERTICAL) {
return LayoutState.LAYOUT_START;
} else if (isLayoutRTL()) {
return LayoutState.LAYOUT_END;
} else {
return LayoutState.LAYOUT_START;
}
case View.FOCUS_FORWARD:
if (mOrientation == VERTICAL) {
return LayoutState.LAYOUT_END;
} else if (isLayoutRTL()) {
return LayoutState.LAYOUT_START;
} else {
return LayoutState.LAYOUT_END;
}
case View.FOCUS_UP:
return mOrientation == VERTICAL ? LayoutState.LAYOUT_START
: LayoutState.INVALID_LAYOUT;
case View.FOCUS_DOWN:
return mOrientation == VERTICAL ? LayoutState.LAYOUT_END
: LayoutState.INVALID_LAYOUT;
case View.FOCUS_LEFT:
return mOrientation == HORIZONTAL ? LayoutState.LAYOUT_START
: LayoutState.INVALID_LAYOUT;
case View.FOCUS_RIGHT:
return mOrientation == HORIZONTAL ? LayoutState.LAYOUT_END
: LayoutState.INVALID_LAYOUT;
default:
if (DEBUG) {
Log.d(TAG, "Unknown focus request:" + focusDirection);
}
return LayoutState.INVALID_LAYOUT;
}
} |
Converts a focusDirection to orientation.
@param focusDirection One of {@link View#FOCUS_UP}, {@link View#FOCUS_DOWN},
{@link View#FOCUS_LEFT}, {@link View#FOCUS_RIGHT},
{@link View#FOCUS_BACKWARD}, {@link View#FOCUS_FORWARD}
or 0 for not applicable
@return {@link LayoutState#LAYOUT_START} or {@link LayoutState#LAYOUT_END} if focus direction
is applicable to current state, {@link LayoutState#INVALID_LAYOUT} otherwise.
| LinearLayoutManager::convertFocusDirectionToLayoutDirection | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private View getChildClosestToStart() {
return getChildAt(mShouldReverseLayout ? getChildCount() - 1 : 0);
} |
Convenience method to find the child closes to start. Caller should check it has enough
children.
@return The child closes to start of the layout from user's perspective.
| LinearLayoutManager::getChildClosestToStart | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private View getChildClosestToEnd() {
return getChildAt(mShouldReverseLayout ? 0 : getChildCount() - 1);
} |
Convenience method to find the child closes to end. Caller should check it has enough
children.
@return The child closes to end of the layout from user's perspective.
| LinearLayoutManager::getChildClosestToEnd | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private View findFirstVisibleChildClosestToStart(boolean completelyVisible,
boolean acceptPartiallyVisible) {
if (mShouldReverseLayout) {
return findOneVisibleChild(getChildCount() - 1, -1, completelyVisible,
acceptPartiallyVisible);
} else {
return findOneVisibleChild(0, getChildCount(), completelyVisible,
acceptPartiallyVisible);
}
} |
Convenience method to find the visible child closes to start. Caller should check if it has
enough children.
@param completelyVisible Whether child should be completely visible or not
@return The first visible child closest to start of the layout from user's perspective.
| LinearLayoutManager::findFirstVisibleChildClosestToStart | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private View findFirstVisibleChildClosestToEnd(boolean completelyVisible,
boolean acceptPartiallyVisible) {
if (mShouldReverseLayout) {
return findOneVisibleChild(0, getChildCount(), completelyVisible,
acceptPartiallyVisible);
} else {
return findOneVisibleChild(getChildCount() - 1, -1, completelyVisible,
acceptPartiallyVisible);
}
} |
Convenience method to find the visible child closes to end. Caller should check if it has
enough children.
@param completelyVisible Whether child should be completely visible or not
@return The first visible child closest to end of the layout from user's perspective.
| LinearLayoutManager::findFirstVisibleChildClosestToEnd | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private View findReferenceChildClosestToEnd(RecyclerView.Recycler recycler,
RecyclerView.State state) {
return mShouldReverseLayout ? findFirstReferenceChild(recycler, state) :
findLastReferenceChild(recycler, state);
} |
Among the children that are suitable to be considered as an anchor child, returns the one
closest to the end of the layout.
<p>
Due to ambiguous adapter updates or children being removed, some children's positions may be
invalid. This method is a best effort to find a position within adapter bounds if possible.
<p>
It also prioritizes children that are within the visible bounds.
@return A View that can be used an an anchor View.
| LinearLayoutManager::findReferenceChildClosestToEnd | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private View findReferenceChildClosestToStart(RecyclerView.Recycler recycler,
RecyclerView.State state) {
return mShouldReverseLayout ? findLastReferenceChild(recycler, state) :
findFirstReferenceChild(recycler, state);
} |
Among the children that are suitable to be considered as an anchor child, returns the one
closest to the start of the layout.
<p>
Due to ambiguous adapter updates or children being removed, some children's positions may be
invalid. This method is a best effort to find a position within adapter bounds if possible.
<p>
It also prioritizes children that are within the visible bounds.
@return A View that can be used an an anchor View.
| LinearLayoutManager::findReferenceChildClosestToStart | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public int findFirstVisibleItemPosition() {
final View child = findOneVisibleChild(0, getChildCount(), false, true);
return child == null ? NO_POSITION : getPosition(child);
} |
Returns the adapter position of the first visible view. This position does not include
adapter changes that were dispatched after the last layout pass.
<p>
Note that, this value is not affected by layout orientation or item order traversal.
({@link #setReverseLayout(boolean)}). Views are sorted by their positions in the adapter,
not in the layout.
<p>
If RecyclerView has item decorators, they will be considered in calculations as well.
<p>
LayoutManager may pre-cache some views that are not necessarily visible. Those views
are ignored in this method.
@return The adapter position of the first visible item or {@link RecyclerView#NO_POSITION} if
there aren't any visible items.
@see #findFirstCompletelyVisibleItemPosition()
@see #findLastVisibleItemPosition()
| LinearLayoutManager::findFirstVisibleItemPosition | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public int findFirstCompletelyVisibleItemPosition() {
final View child = findOneVisibleChild(0, getChildCount(), true, false);
return child == null ? NO_POSITION : getPosition(child);
} |
Returns the adapter position of the first fully visible view. This position does not include
adapter changes that were dispatched after the last layout pass.
<p>
Note that bounds check is only performed in the current orientation. That means, if
LayoutManager is horizontal, it will only check the view's left and right edges.
@return The adapter position of the first fully visible item or
{@link RecyclerView#NO_POSITION} if there aren't any visible items.
@see #findFirstVisibleItemPosition()
@see #findLastCompletelyVisibleItemPosition()
| LinearLayoutManager::findFirstCompletelyVisibleItemPosition | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public int findLastVisibleItemPosition() {
final View child = findOneVisibleChild(getChildCount() - 1, -1, false, true);
return child == null ? NO_POSITION : getPosition(child);
} |
Returns the adapter position of the last visible view. This position does not include
adapter changes that were dispatched after the last layout pass.
<p>
Note that, this value is not affected by layout orientation or item order traversal.
({@link #setReverseLayout(boolean)}). Views are sorted by their positions in the adapter,
not in the layout.
<p>
If RecyclerView has item decorators, they will be considered in calculations as well.
<p>
LayoutManager may pre-cache some views that are not necessarily visible. Those views
are ignored in this method.
@return The adapter position of the last visible view or {@link RecyclerView#NO_POSITION} if
there aren't any visible items.
@see #findLastCompletelyVisibleItemPosition()
@see #findFirstVisibleItemPosition()
| LinearLayoutManager::findLastVisibleItemPosition | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public int findLastCompletelyVisibleItemPosition() {
final View child = findOneVisibleChild(getChildCount() - 1, -1, true, false);
return child == null ? NO_POSITION : getPosition(child);
} |
Returns the adapter position of the last fully visible view. This position does not include
adapter changes that were dispatched after the last layout pass.
<p>
Note that bounds check is only performed in the current orientation. That means, if
LayoutManager is horizontal, it will only check the view's left and right edges.
@return The adapter position of the last fully visible view or
{@link RecyclerView#NO_POSITION} if there aren't any visible items.
@see #findLastVisibleItemPosition()
@see #findFirstCompletelyVisibleItemPosition()
| LinearLayoutManager::findLastCompletelyVisibleItemPosition | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private void logChildren() {
Log.d(TAG, "internal representation of views on the screen");
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
Log.d(TAG, "item " + getPosition(child) + ", coord:"
+ mOrientationHelper.getDecoratedStart(child));
}
Log.d(TAG, "==============");
} |
Used for debugging.
Logs the internal representation of children to default logger.
| LinearLayoutManager::logChildren | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
void validateChildOrder() {
Log.d(TAG, "validating child count " + getChildCount());
if (getChildCount() < 1) {
return;
}
int lastPos = getPosition(getChildAt(0));
int lastScreenLoc = mOrientationHelper.getDecoratedStart(getChildAt(0));
if (mShouldReverseLayout) {
for (int i = 1; i < getChildCount(); i++) {
View child = getChildAt(i);
int pos = getPosition(child);
int screenLoc = mOrientationHelper.getDecoratedStart(child);
if (pos < lastPos) {
logChildren();
throw new RuntimeException("detected invalid position. loc invalid? "
+ (screenLoc < lastScreenLoc));
}
if (screenLoc > lastScreenLoc) {
logChildren();
throw new RuntimeException("detected invalid location");
}
}
} else {
for (int i = 1; i < getChildCount(); i++) {
View child = getChildAt(i);
int pos = getPosition(child);
int screenLoc = mOrientationHelper.getDecoratedStart(child);
if (pos < lastPos) {
logChildren();
throw new RuntimeException("detected invalid position. loc invalid? "
+ (screenLoc < lastScreenLoc));
}
if (screenLoc < lastScreenLoc) {
logChildren();
throw new RuntimeException("detected invalid location");
}
}
}
} |
Used for debugging.
Validates that child views are laid out in correct order. This is important because rest of
the algorithm relies on this constraint.
In default layout, child 0 should be closest to screen position 0 and last child should be
closest to position WIDTH or HEIGHT.
In reverse layout, last child should be closes to screen position 0 and first child should
be closest to position WIDTH or HEIGHT
| LinearLayoutManager::validateChildOrder | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
boolean hasMore(RecyclerView.State state) {
return mCurrentPosition >= 0 && mCurrentPosition < state.getItemCount();
} |
@return true if there are more items in the data adapter
| LayoutState::hasMore | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
View next(RecyclerView.Recycler recycler) {
if (mScrapList != null) {
return nextViewFromScrapList();
}
final View view = recycler.getViewForPosition(mCurrentPosition);
mCurrentPosition += mItemDirection;
return view;
} |
Gets the view for the next element that we should layout.
Also updates current item index to the next item, based on {@link #mItemDirection}
@return The next element that we should layout.
| LayoutState::next | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
private View nextViewFromScrapList() {
final int size = mScrapList.size();
for (int i = 0; i < size; i++) {
final View view = mScrapList.get(i).itemView;
final LayoutParams lp = (LayoutParams) view.getLayoutParams();
if (lp.isItemRemoved()) {
continue;
}
if (mCurrentPosition == lp.getViewLayoutPosition()) {
assignPositionFromScrapList(view);
return view;
}
}
return null;
} |
Returns the next item from the scrap list.
<p>
Upon finding a valid VH, sets current item position to VH.itemPosition + mItemDirection
@return View if an item in the current position or direction exists if not null.
| LayoutState::nextViewFromScrapList | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
void assignCoordinateFromPadding() {
mCoordinate = mLayoutFromEnd
? mOrientationHelper.getEndAfterPadding()
: mOrientationHelper.getStartAfterPadding();
} |
assigns anchor coordinate from the RecyclerView's padding depending on current
layoutFromEnd value
| AnchorInfo::assignCoordinateFromPadding | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/widget/LinearLayoutManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/widget/LinearLayoutManager.java | MIT |
public boolean equals(Object obj) {
return (this == obj);
} |
Indicates whether some other object is "equal to" this one.
<p>
The {@code equals} method implements an equivalence relation
on non-null object references:
<ul>
<li>It is <i>reflexive</i>: for any non-null reference value
{@code x}, {@code x.equals(x)} should return
{@code true}.
<li>It is <i>symmetric</i>: for any non-null reference values
{@code x} and {@code y}, {@code x.equals(y)}
should return {@code true} if and only if
{@code y.equals(x)} returns {@code true}.
<li>It is <i>transitive</i>: for any non-null reference values
{@code x}, {@code y}, and {@code z}, if
{@code x.equals(y)} returns {@code true} and
{@code y.equals(z)} returns {@code true}, then
{@code x.equals(z)} should return {@code true}.
<li>It is <i>consistent</i>: for any non-null reference values
{@code x} and {@code y}, multiple invocations of
{@code x.equals(y)} consistently return {@code true}
or consistently return {@code false}, provided no
information used in {@code equals} comparisons on the
objects is modified.
<li>For any non-null reference value {@code x},
{@code x.equals(null)} should return {@code false}.
</ul>
<p>
The {@code equals} method for class {@code Object} implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values {@code x} and
{@code y}, this method returns {@code true} if and only
if {@code x} and {@code y} refer to the same object
({@code x == y} has the value {@code true}).
<p>
Note that it is generally necessary to override the {@code hashCode}
method whenever this method is overridden, so as to maintain the
general contract for the {@code hashCode} method, which states
that equal objects must have equal hash codes.
@param obj the reference object with which to compare.
@return {@code true} if this object is the same as the obj
argument; {@code false} otherwise.
@see #hashCode()
@see java.util.HashMap
| Object::equals | java | Reginer/aosp-android-jar | android-31/src/java/lang/Object.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/lang/Object.java | MIT |
public String toString() {
return getClass().getName() + "@" + Integer.toHexString(hashCode());
} |
Returns a string representation of the object. In general, the
{@code toString} method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
<p>
The {@code toString} method for class {@code Object}
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `{@code @}', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
<blockquote>
<pre>
getClass().getName() + '@' + Integer.toHexString(hashCode())
</pre></blockquote>
@return a string representation of the object.
| Object::toString | java | Reginer/aosp-android-jar | android-31/src/java/lang/Object.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/lang/Object.java | MIT |
public final void wait() throws InterruptedException {
wait(0);
} |
Causes the current thread to wait until another thread invokes the
{@link java.lang.Object#notify()} method or the
{@link java.lang.Object#notifyAll()} method for this object.
In other words, this method behaves exactly as if it simply
performs the call {@code wait(0)}.
<p>
The current thread must own this object's monitor. The thread
releases ownership of this monitor and waits until another thread
notifies threads waiting on this object's monitor to wake up
either through a call to the {@code notify} method or the
{@code notifyAll} method. The thread then waits until it can
re-obtain ownership of the monitor and resumes execution.
<p>
As in the one argument version, interrupts and spurious wakeups are
possible, and this method should always be used in a loop:
<pre>
synchronized (obj) {
while (<condition does not hold>)
obj.wait();
... // Perform action appropriate to condition
}
</pre>
This method should only be called by a thread that is the owner
of this object's monitor. See the {@code notify} method for a
description of the ways in which a thread can become the owner of
a monitor.
@throws IllegalMonitorStateException if the current thread is not
the owner of the object's monitor.
@throws InterruptedException if any thread interrupted the
current thread before or while the current thread
was waiting for a notification. The <i>interrupted
status</i> of the current thread is cleared when
this exception is thrown.
@see java.lang.Object#notify()
@see java.lang.Object#notifyAll()
| Object::wait | java | Reginer/aosp-android-jar | android-31/src/java/lang/Object.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/lang/Object.java | MIT |
protected void finalize() throws Throwable { } |
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
A subclass overrides the {@code finalize} method to dispose of
system resources or to perform other cleanup.
<p>
The general contract of {@code finalize} is that it is invoked
if and when the Java™ virtual
machine has determined that there is no longer any
means by which this object can be accessed by any thread that has
not yet died, except as a result of an action taken by the
finalization of some other object or class which is ready to be
finalized. The {@code finalize} method may take any action, including
making this object available again to other threads; the usual purpose
of {@code finalize}, however, is to perform cleanup actions before
the object is irrevocably discarded. For example, the finalize method
for an object that represents an input/output connection might perform
explicit I/O transactions to break the connection before the object is
permanently discarded.
<p>
The {@code finalize} method of class {@code Object} performs no
special action; it simply returns normally. Subclasses of
{@code Object} may override this definition.
<p>
The Java programming language does not guarantee which thread will
invoke the {@code finalize} method for any given object. It is
guaranteed, however, that the thread that invokes finalize will not
be holding any user-visible synchronization locks when finalize is
invoked. If an uncaught exception is thrown by the finalize method,
the exception is ignored and finalization of that object terminates.
<p>
After the {@code finalize} method has been invoked for an object, no
further action is taken until the Java virtual machine has again
determined that there is no longer any means by which this object can
be accessed by any thread that has not yet died, including possible
actions by other objects or classes which are ready to be finalized,
at which point the object may be discarded.
<p>
The {@code finalize} method is never invoked more than once by a Java
virtual machine for any given object.
<p>
Any exception thrown by the {@code finalize} method causes
the finalization of this object to be halted, but is otherwise
ignored.
@throws Throwable the {@code Exception} raised by this method
@see java.lang.ref.WeakReference
@see java.lang.ref.PhantomReference
@jls 12.6 Finalization of Class Instances
| Object::finalize | java | Reginer/aosp-android-jar | android-31/src/java/lang/Object.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/lang/Object.java | MIT |
public List<MeasureUnit> getOutputUnits() {
return fUnitsRouter.getOutputUnits();
} |
Returns the list of possible output units, i.e. the full set of
preferences, for the localized, usage-specific unit preferences.
<p>
The returned pointer should be valid for the lifetime of the
UsagePrefsHandler instance.
| UsagePrefsHandler::getOutputUnits | java | Reginer/aosp-android-jar | android-35/src/android/icu/impl/number/UsagePrefsHandler.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/impl/number/UsagePrefsHandler.java | MIT |
public static @Nullable <P extends Parcelling<?>> P get(Class<P> clazz) {
return (P) sCache.get(clazz);
} |
Retrieves an instance of a given {@link Parcelling} class if present.
| Cache::get | java | Reginer/aosp-android-jar | android-35/src/com/android/internal/util/Parcelling.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/util/Parcelling.java | MIT |
public static <P extends Parcelling<?>> P put(P parcelling) {
sCache.put(parcelling.getClass(), parcelling);
return parcelling;
} |
Stores an instance of a given {@link Parcelling}.
@return the provided parcelling for convenience.
| Cache::put | java | Reginer/aosp-android-jar | android-35/src/com/android/internal/util/Parcelling.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/util/Parcelling.java | MIT |
public static <P extends Parcelling<?>> P getOrCreate(Class<P> clazz) {
// No synchronization - creating an extra instance in a race case is ok
P cached = get(clazz);
if (cached != null) {
return cached;
} else {
try {
return put(clazz.newInstance());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
} |
Produces an instance of a given {@link Parcelling} class, by either retrieving a cached
instance or reflectively creating one.
| Cache::getOrCreate | java | Reginer/aosp-android-jar | android-35/src/com/android/internal/util/Parcelling.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/util/Parcelling.java | MIT |
public attreffectivevalue(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "staff", false);
} |
Constructor.
@param factory document factory, may not be null
@throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
| attreffectivevalue::attreffectivevalue | java | Reginer/aosp-android-jar | android-31/src/org/w3c/domts/level1/core/attreffectivevalue.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/org/w3c/domts/level1/core/attreffectivevalue.java | MIT |
public void runTest() throws Throwable {
Document doc;
NodeList addressList;
Node testNode;
NamedNodeMap attributes;
Attr domesticAttr;
String value;
doc = (Document) load("staff", false);
addressList = doc.getElementsByTagName("address");
testNode = addressList.item(0);
attributes = testNode.getAttributes();
domesticAttr = (Attr) attributes.getNamedItem("domestic");
value = domesticAttr.getNodeValue();
assertEquals("attrEffectiveValueAssert", "Yes", value);
} |
Runs the test case.
@throws Throwable Any uncaught exception causes test to fail
| attreffectivevalue::runTest | java | Reginer/aosp-android-jar | android-31/src/org/w3c/domts/level1/core/attreffectivevalue.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/org/w3c/domts/level1/core/attreffectivevalue.java | MIT |
public String getTargetURI() {
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/attreffectivevalue";
} |
Gets URI that identifies the test.
@return uri identifier of test
| attreffectivevalue::getTargetURI | java | Reginer/aosp-android-jar | android-31/src/org/w3c/domts/level1/core/attreffectivevalue.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/org/w3c/domts/level1/core/attreffectivevalue.java | MIT |
public static void main(final String[] args) {
DOMTestCase.doMain(attreffectivevalue.class, args);
} |
Runs this test from the command line.
@param args command line arguments
| attreffectivevalue::main | java | Reginer/aosp-android-jar | android-31/src/org/w3c/domts/level1/core/attreffectivevalue.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/org/w3c/domts/level1/core/attreffectivevalue.java | MIT |
public FilterExprIterator()
{
super(null);
} |
Create a FilterExprIterator object.
| FilterExprIterator::FilterExprIterator | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public FilterExprIterator(Expression expr)
{
super(null);
m_expr = expr;
} |
Create a FilterExprIterator object.
| FilterExprIterator::FilterExprIterator | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public void setRoot(int context, Object environment)
{
super.setRoot(context, environment);
m_exprObj = FilterExprIteratorSimple.executeFilterExpr(context,
m_execContext, getPrefixResolver(),
getIsTopLevel(), m_stackFrame, m_expr);
} |
Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation.
| FilterExprIterator::setRoot | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
protected int getNextNode()
{
if (null != m_exprObj)
{
m_lastFetched = m_exprObj.nextNode();
}
else
m_lastFetched = DTM.NULL;
return m_lastFetched;
} |
Get the next node via getNextXXX. Bottlenecked for derived class override.
@return The next node on the axis, or DTM.NULL.
| FilterExprIterator::getNextNode | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public void detach()
{
super.detach();
m_exprObj.detach();
m_exprObj = null;
} |
Detaches the walker from the set which it iterated over, releasing
any computational resources and placing the iterator in the INVALID
state.
| FilterExprIterator::detach | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public void fixupVariables(java.util.Vector vars, int globalsSize)
{
super.fixupVariables(vars, globalsSize);
m_expr.fixupVariables(vars, globalsSize);
} |
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector from the start of the vector will be its position
in the stack frame (but variables above the globalsTop value will need
to be offset to the current stack frame).
| FilterExprIterator::fixupVariables | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public Expression getInnerExpression()
{
return m_expr;
} |
Get the inner contained expression of this filter.
| FilterExprIterator::getInnerExpression | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public void setInnerExpression(Expression expr)
{
expr.exprSetParent(this);
m_expr = expr;
} |
Set the inner contained expression of this filter.
| FilterExprIterator::setInnerExpression | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public int getAnalysisBits()
{
if (null != m_expr && m_expr instanceof PathComponent)
{
return ((PathComponent) m_expr).getAnalysisBits();
}
return WalkerFactory.BIT_FILTER;
} |
Get the analysis bits for this walker, as defined in the WalkerFactory.
@return One of WalkerFactory#BIT_DESCENDANT, etc.
| FilterExprIterator::getAnalysisBits | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public boolean isDocOrdered()
{
return m_exprObj.isDocOrdered();
} |
Returns true if all the nodes in the iteration well be returned in document
order.
Warning: This can only be called after setRoot has been called!
@return true as a default.
| FilterExprIterator::isDocOrdered | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
public Expression getExpression()
{
return m_expr;
} |
@see ExpressionOwner#getExpression()
| filterExprOwner::getExpression | java | Reginer/aosp-android-jar | android-35/src/org/apache/xpath/axes/FilterExprIterator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xpath/axes/FilterExprIterator.java | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.