Android Extensions: Add missing documentation, move the hasCache property to the compiler module
This commit is contained in:
+8
-3
@@ -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
|
||||
}
|
||||
}
|
||||
+4
@@ -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
|
||||
)
|
||||
+4
@@ -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?
|
||||
}
|
||||
+3
@@ -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
|
||||
+3
@@ -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].
|
||||
|
||||
Reference in New Issue
Block a user