aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main
diff options
context:
space:
mode:
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