From 50ad7f0ae89fc52ce57fe03328f4221fb57f2eac Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 23 Jul 2017 23:26:34 -0700 Subject: Fully implement imagepicker and create play store showcase (#12) * Update changelog * Add uri to imagemodel * Revamp image pickers * Prepare play store showcase * Add encrypted files * Test showcase * Clean elastic recycler activity --- .../kotlin/ca/allanwang/kau/sample/AnimActivity.kt | 62 ++-------------------- .../kotlin/ca/allanwang/kau/sample/ImagePicker.kt | 11 ++++ .../ca/allanwang/kau/sample/ImagePickerActivity.kt | 8 --- .../kotlin/ca/allanwang/kau/sample/MainActivity.kt | 4 ++ 4 files changed, 20 insertions(+), 65 deletions(-) create mode 100644 sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePicker.kt delete mode 100644 sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePickerActivity.kt (limited to 'sample/src/main/kotlin/ca/allanwang') 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 abc65b9..abf44d8 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt @@ -7,13 +7,14 @@ 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.SWIPE_EDGE_BOTTOM +import ca.allanwang.kau.swipe.SWIPE_EDGE_LEFT 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 +import ca.allanwang.kau.utils.withAlpha import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter /** @@ -27,63 +28,10 @@ class AnimActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val adapter = FastItemAdapter() - setContentView(fullLinearRecycler(adapter)) + setContentView(fullLinearRecycler(adapter).apply { setBackgroundColor(KPrefSample.bgColor.withAlpha(255)) }) + 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, _ -> @@ -96,7 +44,7 @@ class AnimActivity : AppCompatActivity() { true } kauSwipeOnCreate { - edgeFlag = SWIPE_EDGE_BOTTOM + edgeFlag = SWIPE_EDGE_LEFT } } diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePicker.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePicker.kt new file mode 100644 index 0000000..c7f28bc --- /dev/null +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePicker.kt @@ -0,0 +1,11 @@ +package ca.allanwang.kau.sample + +import ca.allanwang.kau.imagepicker.ImagePickerActivityBase +import ca.allanwang.kau.imagepicker.ImagePickerActivityOverlayBase + +/** + * Created by Allan Wang on 2017-07-23. + */ +class ImagePickerActivity : ImagePickerActivityBase() + +class ImagePickerActivityOverlay : ImagePickerActivityOverlayBase() \ No newline at end of file diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePickerActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePickerActivity.kt deleted file mode 100644 index 8a23192..0000000 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePickerActivity.kt +++ /dev/null @@ -1,8 +0,0 @@ -package ca.allanwang.kau.sample - -import ca.allanwang.kau.imagepicker.ImagePickerActivityBase - -/** - * Created by Allan Wang on 2017-07-23. - */ -class ImagePickerActivity : ImagePickerActivityBase() \ No newline at end of file diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt index ecfef04..7ce10af 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -168,6 +168,10 @@ class MainActivity : KPrefActivity() { onClick = { _, _, _ -> kauLaunchImagePicker(ImagePickerActivity::class.java, REQUEST_IMAGE); false } } + plainText(R.string.gallery_overlay_showcase) { + onClick = { _, _, _ -> kauLaunchImagePicker(ImagePickerActivityOverlay::class.java, REQUEST_IMAGE); false } + } + plainText(R.string.adapter_showcase) { onClick = { _, _, _ -> startActivity(AdapterActivity::class.java, transition = true); false } } -- cgit v1.2.3