diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-04 17:04:05 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-07-04 17:04:05 -0700 |
commit | 8844116ebfa5dcab29ffacc66ffab4d20447a104 (patch) | |
tree | 2da1fa7008133aefca625328d060899734c60df6 /sample | |
parent | cf2a7fcd0880a8d276970124cdb5d5845d5631fe (diff) | |
download | kau-8844116ebfa5dcab29ffacc66ffab4d20447a104.tar.gz kau-8844116ebfa5dcab29ffacc66ffab4d20447a104.tar.bz2 kau-8844116ebfa5dcab29ffacc66ffab4d20447a104.zip |
Set up base
Diffstat (limited to 'sample')
6 files changed, 16 insertions, 17 deletions
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 @@ <activity android:name=".AboutActivity" android:theme="@style/Kau.Translucent.About" /> + <activity + android:name=".ImageActivity" + android:theme="@style/Kau.Translucent.ImagePicker" /> </application> </manifest>
\ 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 @@ <item android:id="@+id/test" android:orderInCategory="300" - android:title="@string/kau_menu" + android:title="Test" app:showAsAction="never" /> </menu> 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 @@ <version title="v1.4"/> <item text="Added about activities" /> - <item text="Added themed fast item adapter" /> - <item text="Added chained adapter" /> + <item text="Added themed fast item imageAdapter" /> + <item text="Added chained imageAdapter" /> <item text="Added item animators" /> <item text="Ported some views over from Plaid" /> <item text="Add string arg option for sendEmail" /> |