From 82a98786f301cd8e7fcafc44bf760f0434bd2eb2 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 5 Jul 2017 21:17:03 -0700 Subject: Bring back swipe --- .../kotlin/ca/allanwang/kau/sample/AnimActivity.kt | 63 ++++++++++++++++++++-- 1 file changed, 60 insertions(+), 3 deletions(-) (limited to 'sample') diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt index dd95b18..8ccaded 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt @@ -7,7 +7,10 @@ import ca.allanwang.kau.permissions.PERMISSION_ACCESS_COARSE_LOCATION import ca.allanwang.kau.permissions.PERMISSION_ACCESS_FINE_LOCATION import ca.allanwang.kau.permissions.kauOnRequestPermissionsResult import ca.allanwang.kau.permissions.kauRequestPermissions -import ca.allanwang.kau.swipe.* +import ca.allanwang.kau.swipe.SWIPE_EDGE_TOP +import ca.allanwang.kau.swipe.kauSwipeOnCreate +import ca.allanwang.kau.swipe.kauSwipeOnDestroy +import ca.allanwang.kau.swipe.kauSwipeOnPostCreate import ca.allanwang.kau.utils.fullLinearRecycler import ca.allanwang.kau.utils.startActivitySlideOut import ca.allanwang.kau.utils.toast @@ -27,19 +30,73 @@ class AnimActivity : AppCompatActivity() { setContentView(fullLinearRecycler(adapter)) adapter.add(listOf( PERMISSION_ACCESS_COARSE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, PERMISSION_ACCESS_FINE_LOCATION ).map { PermissionCheckbox(it) }) adapter.withOnClickListener { _, _, item, _ -> KL.d("Perm Click") kauRequestPermissions(item.permission) { - granted, deniedPerm -> + granted, _ -> toast("${item.permission} enabled: $granted") adapter.notifyAdapterDataSetChanged() } true } kauSwipeOnCreate { - edgeFlag = SWIPE_EDGE_ALL + edgeFlag = SWIPE_EDGE_TOP } } -- cgit v1.2.3