From 8844116ebfa5dcab29ffacc66ffab4d20447a104 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 4 Jul 2017 17:04:05 -0700 Subject: Set up base --- sample/src/main/AndroidManifest.xml | 3 +++ .../main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt | 14 +------------- .../main/kotlin/ca/allanwang/kau/sample/ImageActivity.kt | 8 ++++++++ .../main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 2 +- sample/src/main/res/menu/menu_main.xml | 2 +- sample/src/main/res/xml/changelog.xml | 4 ++-- 6 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 sample/src/main/kotlin/ca/allanwang/kau/sample/ImageActivity.kt (limited to 'sample') diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 5a364b6..0ab360e 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -28,6 +28,9 @@ + \ No newline at end of file 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 diff --git a/sample/src/main/res/menu/menu_main.xml b/sample/src/main/res/menu/menu_main.xml index 0481ae5..039c2c9 100644 --- a/sample/src/main/res/menu/menu_main.xml +++ b/sample/src/main/res/menu/menu_main.xml @@ -24,7 +24,7 @@ diff --git a/sample/src/main/res/xml/changelog.xml b/sample/src/main/res/xml/changelog.xml index 1fe0a61..f4ac5bf 100644 --- a/sample/src/main/res/xml/changelog.xml +++ b/sample/src/main/res/xml/changelog.xml @@ -18,8 +18,8 @@ - - + + -- cgit v1.2.3