WearDevice.kt

/*
 * Copyright 2023 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.wear.tooling.preview.devices

import androidx.annotation.RestrictTo
import androidx.annotation.StringDef

/**
 * List with the pre-defined devices available to be used in previews.
 */
object WearDevices {
    // Make sure to update any @StringDefs that reference this object.
    /** Round device with 454px x 454px dimensions, 1.39" size and xhdpi density. */
    const val LARGE_ROUND = "id:wearos_large_round"
    /** Round device with 384px x 384px dimensions, 1.2" size and xhdpi density. */
    const val SMALL_ROUND = "id:wearos_small_round"
    /** Square device with 360px x 360px dimensions, 1.2" size and xhdpi density. */
    const val SQUARE = "id:wearos_square"
    /** Rectangular device with 402px x 476px dimensions, 1.2" size and xhdpi density. */
    const val RECT = "id:wearos_rect"
}

/**
 * Annotation for defining the device to use.
 */
@Retention(AnnotationRetention.SOURCE)
@StringDef(
    open = true,
    value = [
        WearDevices.LARGE_ROUND,
        WearDevices.SMALL_ROUND,
    ]
)
@RestrictTo(RestrictTo.Scope.LIBRARY)
annotation class WearDevice