Merge "Prevent causing insets if the system bar is shown forcibly" into rvc-dev

This commit is contained in:
Tiger Huang
2020-03-05 07:06:15 +00:00
committed by Android (Google) Code Review
5 changed files with 67 additions and 52 deletions

View File

@@ -342,6 +342,20 @@ public class InsetsState implements Parcelable {
}
}
/**
* A shortcut for setting the visibility of the source.
*
* @param type The {@link InternalInsetsType} of the source to set the visibility
* @param referenceState The {@link InsetsState} for reference
*/
public void setSourceVisible(@InternalInsetsType int type, InsetsState referenceState) {
InsetsSource source = mSources.get(type);
InsetsSource referenceSource = referenceState.mSources.get(type);
if (source != null && referenceSource != null) {
source.setVisible(referenceSource.isVisible());
}
}
public void set(InsetsState other) {
set(other, false /* copySources */);
}