-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Parent annotation] Added an annotation that will help bind and load …
…data to nested views
- Loading branch information
crypticminds
committed
Feb 19, 2020
1 parent
db9ad6e
commit 3a553e0
Showing
5 changed files
with
96 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
coldstorageannotation/src/main/java/com/arcane/coldstorageannotation/Parent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.arcane.coldstorageannotation | ||
|
||
/** | ||
* An annotation that can be used to declare the parent of a view. | ||
* This annotation is used in conjunction with other data loading and | ||
* caching annotation such as @LoadImage. | ||
* | ||
* Usage | ||
* | ||
* @LoadImage(R.id.my_image_view,"myurl") | ||
* @Parent(R.id.my_custom_view) | ||
* lateinit var myImageViewInsideCustomView : ImageView | ||
* | ||
* This will load the image from "myrul" into the "my_image_view" inside "my_custom_view" | ||
* | ||
* @param resourceId the resource id of the parent view. | ||
* | ||
* @author Anurag. | ||
*/ | ||
@Retention(AnnotationRetention.SOURCE) | ||
@Target(AnnotationTarget.FIELD) | ||
annotation class Parent(val resourceId: Int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters