aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'sample/src/main/kotlin')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt14
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/ImageActivity.kt8
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt2
3 files changed, 10 insertions, 14 deletions
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 2ba7731..fbcb88f 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt
@@ -26,7 +26,7 @@ class AnimActivity : AppCompatActivity() {
PERMISSION_ACCESS_COARSE_LOCATION,
PERMISSION_ACCESS_FINE_LOCATION
).map { PermissionCheckbox(it) })
- val withOnClickListener = adapter.withOnClickListener { _, _, item, _ ->
+ adapter.withOnClickListener { _, _, item, _ ->
KL.d("Perm Click")
kauRequestPermissions(item.permission) {
granted, deniedPerm ->
@@ -35,18 +35,6 @@ class AnimActivity : AppCompatActivity() {
}
true
}
- kauRequestPermissions(PERMISSION_READ_EXTERNAL_STORAGE) {
- granted, deniedPerm ->
- if (!granted) return@kauRequestPermissions
- val cursor = contentResolver.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
- arrayOf(MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.Media.DISPLAY_NAME, MediaStore.Images.Media.DATE_MODIFIED),
- null, null, MediaStore.Images.Media.DEFAULT_SORT_ORDER, null)
- while (!cursor.isLast) {
- cursor.moveToNext()
- KL.d(cursor.getString(1))
- }
- cursor.close()
- }
}
override fun onBackPressed() {
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/ImageActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/ImageActivity.kt
new file mode 100644
index 0000000..a0b3dc5
--- /dev/null
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/ImageActivity.kt
@@ -0,0 +1,8 @@
+package ca.allanwang.kau.sample
+
+import ca.allanwang.kau.imagepicker.ImagePickerActivityBase
+
+/**
+ * Created by Allan Wang on 2017-07-04.
+ */
+class ImageActivity : 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 53fa68e..d0a5ee1 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -212,7 +212,7 @@ class MainActivity : KPrefActivity() {
when (item.itemId) {
R.id.action_settings -> startActivity(AnimActivity::class.java, clearStack = true)
R.id.action_email -> sendEmail(R.string.your_email, R.string.your_subject)
- R.id.test -> prefHolder.showNext()
+ R.id.test -> startActivity(ImageActivity::class.java, transition = true)
else -> return super.onOptionsItemSelected(item)
}
return true