public class

ExtensionWindowLayoutInfo

extends java.lang.Object

 java.lang.Object

↳androidx.window.extensions.ExtensionWindowLayoutInfo

Gradle dependencies

compile group: 'androidx.window', name: 'window-extensions', version: '1.0.0-alpha01'

  • groupId: androidx.window
  • artifactId: window-extensions
  • version: 1.0.0-alpha01

Artifact androidx.window:window-extensions:1.0.0-alpha01 it located at Google repository (https://maven.google.com/)

Overview

Contains information about the layout of display features within the window.

Summary

Constructors
publicExtensionWindowLayoutInfo(java.util.List<ExtensionDisplayFeature> displayFeatures)

Methods
public booleanequals(java.lang.Object obj)

public java.util.List<ExtensionDisplayFeature>getDisplayFeatures()

Get the list of display features present within the window.

public inthashCode()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructors

public ExtensionWindowLayoutInfo(java.util.List<ExtensionDisplayFeature> displayFeatures)

Methods

public java.util.List<ExtensionDisplayFeature> getDisplayFeatures()

Get the list of display features present within the window.

public boolean equals(java.lang.Object obj)

public int hashCode()

Source

/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.window.extensions;

import android.os.IBinder;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.List;

/**
 * Contains information about the layout of display features within the window.
 */
public class ExtensionWindowLayoutInfo {

    /**
     * List of display features within the window.
     * <p>NOTE: All display features returned with this container must be cropped to the application
     * window and reported within the coordinate space of the window that was provided by the app.
     * @see ExtensionInterface#getWindowLayoutInfo(IBinder)
     */
    @Nullable
    private List<ExtensionDisplayFeature> mDisplayFeatures;

    public ExtensionWindowLayoutInfo(@NonNull List<ExtensionDisplayFeature> displayFeatures) {
        mDisplayFeatures = displayFeatures;
    }

    /**
     * Get the list of display features present within the window.
     */
    @Nullable
    public List<ExtensionDisplayFeature> getDisplayFeatures() {
        return mDisplayFeatures;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof ExtensionWindowLayoutInfo)) {
            return false;
        }
        final ExtensionWindowLayoutInfo
                other = (ExtensionWindowLayoutInfo) obj;
        if (mDisplayFeatures == null) {
            return other.mDisplayFeatures == null;
        }
        return mDisplayFeatures.equals(other.mDisplayFeatures);
    }

    @Override
    public int hashCode() {
        return mDisplayFeatures != null ? mDisplayFeatures.size() : 0;
    }
}