aboutsummaryrefslogtreecommitdiff
path: root/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-22 16:08:08 -0700
committerGitHub <noreply@github.com>2017-07-22 16:08:08 -0700
commit61d87976e8b29ed25061ae98743a6cf4f4274542 (patch)
treefa4d9bca5fe1b9478ba2f1cc1e6c7d8d18bf15ce /core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt
parent8f2b5ac043f47cc44f43c3788d1377083fb339a2 (diff)
downloadkau-61d87976e8b29ed25061ae98743a6cf4f4274542.tar.gz
kau-61d87976e8b29ed25061ae98743a6cf4f4274542.tar.bz2
kau-61d87976e8b29ed25061ae98743a6cf4f4274542.zip
Support sdk 19 where possible and add image picker (#10)3.0
* Fix plural * Switch to long * Test plural again * Comment * Major update to image picker and view utils * Make image activity full screen * Update min sdk and prefix * Lower sdk requirement and make string private * Bring kpref activity to sdk 19
Diffstat (limited to 'core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt')
-rw-r--r--core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt14
1 files changed, 4 insertions, 10 deletions
diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt
index 1dcf14b..20a81e4 100644
--- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt
+++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt
@@ -1,6 +1,8 @@
package ca.allanwang.kau.ui.activities
+import android.os.Build
import android.os.Bundle
+import android.support.annotation.RequiresApi
import android.support.design.widget.AppBarLayout
import android.support.design.widget.CoordinatorLayout
import android.support.design.widget.FloatingActionButton
@@ -23,7 +25,8 @@ import ca.allanwang.kau.utils.bindView
*
* The exit animation is set to slide out, but the entrance must be defined yourself
*/
-abstract class ElasticRecyclerActivity() : AppCompatActivity() {
+@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
+abstract class ElasticRecyclerActivity : AppCompatActivity() {
val appBar: AppBarLayout by bindView(R.id.kau_appbar)
val toolbar: Toolbar by bindView(R.id.kau_toolbar)
@@ -68,14 +71,5 @@ abstract class ElasticRecyclerActivity() : AppCompatActivity() {
draggableFrame.setOnClickListener { listener() }
}
- fun hideFabOnUpwardsScroll() {
- recycler.addOnScrollListener(object :RecyclerView.OnScrollListener(){
- override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
- if (dy > 0 && fab.isShown) fab.hide()
- else if (dy < 0 && !fab.isShown) fab.show()
- }
- })
- }
-
}