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?
}
@@ -16,6 +16,9 @@
package kotlinx.android.parcel
/**
* The property annotated with [IgnoredOnParcel] will not be stored into parcel.
*/
@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.SOURCE)
annotation class IgnoredOnParcel
@@ -20,6 +20,9 @@ package kotlinx.android.parcel
import android.os.Parcel
import android.os.Parcelable
/**
* The base interface for custom [Parcelize] serializers.
*/
interface Parceler<T> {
/**
* Writes the [T] instance state to the [parcel].