Android Extensions: Add missing documentation, move the hasCache property to the compiler module

This commit is contained in:
Yan Zhulanow
2017-11-01 15:56:40 +09:00
parent e4f476c09f
commit 3d7222485d
6 changed files with 25 additions and 3 deletions
@@ -16,15 +16,20 @@
package kotlinx.android.extensions
/**
* Caching mechanism for [LayoutContainer] implementations, and also for the types directly supported by Android Extensions,
* such as [android.app.Activity] or [android.app.Fragment].
*/
public enum class CacheImplementation {
/** Use [android.util.SparseArray] as a backing store for the resolved views. */
SPARSE_ARRAY,
/** Use [HashMap] as a backing store for the resolved views (default). */
HASH_MAP,
/** Do not cache views for this layout. */
NO_CACHE;
public val hasCache: Boolean
get() = this != NO_CACHE
companion object {
/** The default cache implementation is [HASH_MAP]. */
val DEFAULT = HASH_MAP
}
}
@@ -18,6 +18,10 @@ package kotlinx.android.extensions
import kotlinx.android.extensions.CacheImplementation.*
/**
* Instructs Android Extensions to apply specific options for the annotated layout container.
*/
public annotation class ContainerOptions(
/** A cache implementation for the container. */
public val cache: CacheImplementation = HASH_MAP
)
@@ -18,6 +18,10 @@ package kotlinx.android.extensions
import android.view.View
/**
* A base interface for all view holders supporting Android Extensions-style view access.
*/
public interface LayoutContainer {
/** Returns the root holder view. */
public val containerView: View?
}