aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-02 16:21:49 -0700
committerGitHub <noreply@github.com>2017-08-02 16:21:49 -0700
commit53382b44bb7ab7ccb559e96fd1f93c47020878ee (patch)
tree79c1862992f458ac52c1910b3a2e0c01cb7d5a5a /sample/src/main/kotlin
parent7d894be6de118357ec908d2d171b6152ce67307d (diff)
downloadkau-53382b44bb7ab7ccb559e96fd1f93c47020878ee.tar.gz
kau-53382b44bb7ab7ccb559e96fd1f93c47020878ee.tar.bz2
kau-53382b44bb7ab7ccb559e96fd1f93c47020878ee.zip
Improve video prefetching (#17)
* Create base activity and add thumbnails to media picker * Add checker to see if requested permission is inside the manifest * Add faq parser with tests * Add kpref testers and expose sp * Test jitpack sample exclusion * Test caching * Improve glide caching
Diffstat (limited to 'sample/src/main/kotlin')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt13
1 files changed, 5 insertions, 8 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 abf44d8..cd86d38 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt
@@ -1,11 +1,11 @@
package ca.allanwang.kau.sample
import android.os.Bundle
-import android.support.v7.app.AppCompatActivity
+import ca.allanwang.kau.internal.KauBaseActivity
import ca.allanwang.kau.logging.KL
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.PERMISSION_CAMERA
import ca.allanwang.kau.permissions.kauRequestPermissions
import ca.allanwang.kau.swipe.SWIPE_EDGE_LEFT
import ca.allanwang.kau.swipe.kauSwipeOnCreate
@@ -23,7 +23,7 @@ import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
* Activity for animations
* Now also showcases permissions
*/
-class AnimActivity : AppCompatActivity() {
+class AnimActivity : KauBaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -32,7 +32,8 @@ class AnimActivity : AppCompatActivity() {
adapter.add(listOf(
PERMISSION_ACCESS_COARSE_LOCATION,
- PERMISSION_ACCESS_FINE_LOCATION
+ PERMISSION_ACCESS_FINE_LOCATION,
+ PERMISSION_CAMERA
).map { PermissionCheckbox(it) })
adapter.withOnClickListener { _, _, item, _ ->
KL.d("Perm Click")
@@ -62,8 +63,4 @@ class AnimActivity : AppCompatActivity() {
startActivitySlideOut(MainActivity::class.java)
}
- override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
- super.onRequestPermissionsResult(requestCode, permissions, grantResults)
- kauOnRequestPermissionsResult(permissions, grantResults)
- }
} \ No newline at end of file