diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-18 20:16:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 20:16:23 -0700 |
commit | 8f2b5ac043f47cc44f43c3788d1377083fb339a2 (patch) | |
tree | 8f91042414de211cbfe67a76298300884f46a765 /sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt | |
parent | 4eee8d59c21b2061b9f5fd0e805ca60ab84c3585 (diff) | |
download | kau-8f2b5ac043f47cc44f43c3788d1377083fb339a2.tar.gz kau-8f2b5ac043f47cc44f43c3788d1377083fb339a2.tar.bz2 kau-8f2b5ac043f47cc44f43c3788d1377083fb339a2.zip |
Dev 2.1 (#8)
* Rewrite animation interfaces
* Update changelog
* Add scale factor for slide
* Remove margins in iitems and replace with decorators
* Remove mutable list
* Switch cardiitem to use lambdas for click
* status
* Utils update and imagepicker fixes
* Remove stringholder
* Add fade in fade out
* Increment about version
* Rename fromedge to direction in javadocs
* More logging
* Add logging and docs
* Make card icons visible
* Update email builder and icon padding
* Create elastic recycler activity
* Fix card iitem
* Add lint check and plurals
* Inline all the things
* Format and sort xml
* Update dependencies and increment version
Diffstat (limited to 'sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt')
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt new file mode 100644 index 0000000..874e73b --- /dev/null +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt @@ -0,0 +1,51 @@ +package ca.allanwang.kau.sample + +import android.os.Bundle +import ca.allanwang.kau.iitems.CardIItem +import ca.allanwang.kau.ui.activities.ElasticRecyclerActivity +import ca.allanwang.kau.utils.toast +import com.mikepenz.fastadapter.IItem +import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter +import com.mikepenz.google_material_typeface_library.GoogleMaterial + +/** + * Created by Allan Wang on 2017-07-17. + */ +class AdapterActivity : ElasticRecyclerActivity() { + + val adapter = FastItemAdapter<IItem<*, *>>() + + override fun onCreate(savedInstanceState: Bundle?, configs: Configs): Boolean { + recycler.adapter = adapter + adapter.add(listOf( + CardIItem { + titleRes = R.string.kau_text_copied + descRes = R.string.kau_lorem_ipsum + imageIIcon = GoogleMaterial.Icon.gmd_file_download + }, + CardIItem { + titleRes = R.string.kau_text_copied + descRes = R.string.kau_lorem_ipsum + }, + CardIItem { + titleRes = R.string.kau_text_copied + imageIIcon = GoogleMaterial.Icon.gmd_file_download + cardClick = { toast("Card click") } + }, + CardIItem { + titleRes = R.string.kau_text_copied + descRes = R.string.kau_lorem_ipsum + imageIIcon = GoogleMaterial.Icon.gmd_file_download + button = "Test" + buttonClick = { toast("T") } + }, + CardIItem { + titleRes = R.string.kau_text_copied + button = "Test" + buttonClick = { toast("HI") } + } + )) + setOutsideTapListener { finishAfterTransition() } + return true + } +}
\ No newline at end of file |