aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-03 20:09:35 -0700
committerAllan Wang <me@allanwang.ca>2017-07-03 20:09:35 -0700
commit139f2dd8207d3a9cd67157a3e3754a9982c7f69d (patch)
tree548f23ff4f6ddce0a24e740fc550c75ad997fc29 /sample/src/main
parentb88a8834dc3be12a37856e9e2584eee7ef52c22e (diff)
downloadkau-139f2dd8207d3a9cd67157a3e3754a9982c7f69d.tar.gz
kau-139f2dd8207d3a9cd67157a3e3754a9982c7f69d.tar.bz2
kau-139f2dd8207d3a9cd67157a3e3754a9982c7f69d.zip
Initial creation of the Permission Manager
Diffstat (limited to 'sample/src/main')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt9
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt20
-rw-r--r--sample/src/main/res/layout/permission_checkbox.xml23
3 files changed, 51 insertions, 1 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 10f2065..2fd846c 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt
@@ -2,17 +2,24 @@ package ca.allanwang.kau.sample
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
+import ca.allanwang.kau.utils.fullLinearRecycler
import ca.allanwang.kau.utils.startActivitySlideOut
+import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
/**
* Created by Allan Wang on 2017-06-12.
*
- * Empty Activity for animations
+ * Activity for animations
+ * Now also showcases permissions
*/
class AnimActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+ val adapter = FastItemAdapter<KP>
+ val recycler = fullLinearRecycler {
+
+ }
setContentView(R.layout.sample)
}
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt
new file mode 100644
index 0000000..012d523
--- /dev/null
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt
@@ -0,0 +1,20 @@
+package ca.allanwang.kau.sample
+
+import android.support.v7.widget.RecyclerView
+import android.view.View
+import android.widget.CheckBox
+import android.widget.TextView
+import ca.allanwang.kau.iitems.KotlinIItem
+import ca.allanwang.kau.utils.bindView
+
+/**
+ * Created by Allan Wang on 2017-07-03.
+ */
+class PermissionCheckbox(val permission: String) : KotlinIItem<PermissionCheckbox, PermissionCheckbox.ViewHolder>(
+ R.layout.permission_checkbox, R.layout.permission_checkbox, { ViewHolder(it) }) {
+
+ class ViewHolder(v: View) : RecyclerView.ViewHolder(v) {
+ val text: TextView by bindView(R.id.perm_text)
+ val checkbox: CheckBox by bindView(R.id.perm_checkbox)
+ }
+} \ No newline at end of file
diff --git a/sample/src/main/res/layout/permission_checkbox.xml b/sample/src/main/res/layout/permission_checkbox.xml
new file mode 100644
index 0000000..6de8296
--- /dev/null
+++ b/sample/src/main/res/layout/permission_checkbox.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:orientation="horizontal"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingEnd="@dimen/activity_horizontal_margin"
+ android:paddingStart="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin">
+
+ <TextView
+ android:id="@+id/perm_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1" />
+
+ <CheckBox
+ android:id="@+id/perm_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+</LinearLayout> \ No newline at end of file