Created
February 3, 2020 11:25
-
-
Save crypticminds/3bd445803222aac1111c0937ce26a888 to your computer and use it in GitHub Desktop.
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
package com.arcane.coldstorageexamples.fragment | |
import android.os.Bundle | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.ImageView | |
import androidx.fragment.app.Fragment | |
import com.arcane.coldstorageannotation.LoadImage | |
import com.arcane.coldstoragecache.cache.Cache | |
import com.arcane.coldstorageexamples.R | |
class LoadImageFragment : Fragment() { | |
@LoadImage( | |
R.id.image_1, | |
"https://i.ytimg.com/vi/kYnx7nPw-xo/maxresdefault.jpg", | |
placeHolder = R.drawable.loading, enableLoadingAnimation = true | |
) | |
lateinit var imageView1: ImageView | |
@LoadImage( | |
R.id.image_2, | |
"https://image.shutterstock.com/image-photo/small-red-bunny-on-isolated-260nw-562790971.jpg", | |
placeHolder = R.drawable.loading_2, enableLoadingAnimation = true | |
) | |
lateinit var imageView2: ImageView | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { | |
return inflater.inflate(R.layout.load_image_example_fragment, container) | |
} | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
Cache.bind(this) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment