aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-23 23:26:34 -0700
committerGitHub <noreply@github.com>2017-07-23 23:26:34 -0700
commit50ad7f0ae89fc52ce57fe03328f4221fb57f2eac (patch)
tree69ead8807bb7371428953a0363519343f03f9b5b /sample/src/main/kotlin/ca/allanwang
parent4706b8f6a8d08a6961da6ab34d15881b63356d79 (diff)
downloadkau-50ad7f0ae89fc52ce57fe03328f4221fb57f2eac.tar.gz
kau-50ad7f0ae89fc52ce57fe03328f4221fb57f2eac.tar.bz2
kau-50ad7f0ae89fc52ce57fe03328f4221fb57f2eac.zip
Fully implement imagepicker and create play store showcase (#12)3.1.1
* Update changelog * Add uri to imagemodel * Revamp image pickers * Prepare play store showcase * Add encrypted files * Test showcase * Clean elastic recycler activity
Diffstat (limited to 'sample/src/main/kotlin/ca/allanwang')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt62
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePicker.kt11
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/ImagePickerActivity.kt8
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt4
4 files changed, 20 insertions, 65 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 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<PermissionCheckbox>()
- 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 }
}