37 lines
1.4 KiB
Java
37 lines
1.4 KiB
Java
|
package androidx.appcompat.widget;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.graphics.Rect;
|
||
|
import android.util.AttributeSet;
|
||
|
import android.widget.FrameLayout;
|
||
|
import androidx.annotation.NonNull;
|
||
|
import androidx.annotation.Nullable;
|
||
|
import androidx.annotation.RestrictTo;
|
||
|
import androidx.appcompat.widget.FitWindowsViewGroup;
|
||
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
||
|
public class FitWindowsFrameLayout extends FrameLayout implements FitWindowsViewGroup {
|
||
|
private FitWindowsViewGroup.OnFitSystemWindowsListener mListener;
|
||
|
|
||
|
public FitWindowsFrameLayout(@NonNull Context context) {
|
||
|
super(context);
|
||
|
}
|
||
|
|
||
|
public FitWindowsFrameLayout(@NonNull Context context, @Nullable AttributeSet attributeSet) {
|
||
|
super(context, attributeSet);
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View
|
||
|
public boolean fitSystemWindows(Rect rect) {
|
||
|
FitWindowsViewGroup.OnFitSystemWindowsListener onFitSystemWindowsListener = this.mListener;
|
||
|
if (onFitSystemWindowsListener != null) {
|
||
|
onFitSystemWindowsListener.onFitSystemWindows(rect);
|
||
|
}
|
||
|
return super.fitSystemWindows(rect);
|
||
|
}
|
||
|
|
||
|
@Override // androidx.appcompat.widget.FitWindowsViewGroup
|
||
|
public void setOnFitSystemWindowsListener(FitWindowsViewGroup.OnFitSystemWindowsListener onFitSystemWindowsListener) {
|
||
|
this.mListener = onFitSystemWindowsListener;
|
||
|
}
|
||
|
}
|