aboutsummaryrefslogtreecommitdiff
path: root/library/src/main/res
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/main/res')
-rw-r--r--library/src/main/res/layout/kau_about_iitem_library.xml (renamed from library/src/main/res/layout/kau_about_item_library.xml)0
-rw-r--r--library/src/main/res/layout/kau_about_section_main.xml2
-rw-r--r--library/src/main/res/layout/kau_iitem_card.xml76
-rw-r--r--library/src/main/res/layout/kau_iitem_cutout.xml9
-rw-r--r--library/src/main/res/layout/kau_recycler_detached_background.xml27
-rw-r--r--library/src/main/res/layout/kau_search_iitem.xml (renamed from library/src/main/res/layout/kau_search_item.xml)0
-rw-r--r--library/src/main/res/transition/kau_enter_slide_top.xml (renamed from library/src/main/res/transition/kau_about_enter.xml)0
-rw-r--r--library/src/main/res/values/attr.xml3
-rw-r--r--library/src/main/res/values/dimens.xml7
-rw-r--r--library/src/main/res/values/ids.xml2
-rw-r--r--library/src/main/res/values/styles.xml2
11 files changed, 124 insertions, 4 deletions
diff --git a/library/src/main/res/layout/kau_about_item_library.xml b/library/src/main/res/layout/kau_about_iitem_library.xml
index 0129512..0129512 100644
--- a/library/src/main/res/layout/kau_about_item_library.xml
+++ b/library/src/main/res/layout/kau_about_iitem_library.xml
diff --git a/library/src/main/res/layout/kau_about_section_main.xml b/library/src/main/res/layout/kau_about_section_main.xml
index aa338ee..40d8dfb 100644
--- a/library/src/main/res/layout/kau_about_section_main.xml
+++ b/library/src/main/res/layout/kau_about_section_main.xml
@@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
- <ca.allanwang.kau.views.CutoutTextView
+ <ca.allanwang.kau.views.CutoutView
android:id="@+id/about_main_cutout"
android:layout_width="0dp"
android:layout_height="@dimen/kau_about_header_height"
diff --git a/library/src/main/res/layout/kau_iitem_card.xml b/library/src/main/res/layout/kau_iitem_card.xml
new file mode 100644
index 0000000..4967a2e
--- /dev/null
+++ b/library/src/main/res/layout/kau_iitem_card.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Generic card with an imageview, title, description, and button
+ -->
+
+<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/kau_card_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/kau_padding_normal"
+ android:foreground="?android:selectableItemBackground"
+ android:minHeight="?android:listPreferredItemHeight"
+ android:paddingBottom="@dimen/kau_padding_normal"
+ android:paddingEnd="@dimen/kau_padding_normal"
+ android:paddingTop="@dimen/kau_padding_normal">
+
+ <android.support.constraint.ConstraintLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <ImageView
+ android:id="@+id/kau_card_image"
+ android:layout_width="@dimen/kau_avatar_bounds"
+ android:layout_height="@dimen/kau_avatar_bounds"
+ android:layout_marginEnd="@dimen/kau_avatar_margin"
+ android:layout_marginStart="@dimen/kau_avatar_margin"
+ android:padding="@dimen/kau_avatar_padding"
+ android:visibility="gone"
+ android:scaleType="fitCenter"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/kau_card_title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@id/kau_card_image"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/kau_card_description"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/TextAppearance.AppCompat.Body1"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@id/kau_card_image"
+ app:layout_constraintTop_toBottomOf="@id/kau_card_title" />
+
+ <LinearLayout
+ android:id="@+id/kau_card_bottom_row"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@id/kau_card_image"
+ app:layout_constraintTop_toBottomOf="@id/kau_card_description">
+
+ <Button
+ android:id="@+id/kau_card_button"
+ style="?android:borderlessButtonStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/kau_spacing_normal"
+ android:textColor="?attr/colorAccent" />
+
+ </LinearLayout>
+
+ </android.support.constraint.ConstraintLayout>
+
+</android.support.v7.widget.CardView>
diff --git a/library/src/main/res/layout/kau_iitem_cutout.xml b/library/src/main/res/layout/kau_iitem_cutout.xml
new file mode 100644
index 0000000..a4b17ac
--- /dev/null
+++ b/library/src/main/res/layout/kau_iitem_cutout.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ca.allanwang.kau.views.CutoutView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/kau_cutout"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/kau_about_header_height"
+ android:minHeight="@dimen/kau_about_header_height"
+ app:foregroundColor="?android:colorAccent"
+ app:heightPercentageToScreen="0.5" /> \ No newline at end of file
diff --git a/library/src/main/res/layout/kau_recycler_detached_background.xml b/library/src/main/res/layout/kau_recycler_detached_background.xml
new file mode 100644
index 0000000..7295d66
--- /dev/null
+++ b/library/src/main/res/layout/kau_recycler_detached_background.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <!-- we use a parallel view for the background rather than just setting a background on the
+ recycler view for a nicer return transition. i.e. we want the background to fade and the
+ list to slide out separately -->
+ <View
+ android:id="@+id/kau_recycler_detached_background"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="?android:colorBackground" />
+
+ <!--defaults to a LinearLayoutManager-->
+
+ <android.support.v7.widget.RecyclerView
+ android:id="@+id/kau_recycler_detached"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:clipToPadding="false"
+ android:paddingBottom="@dimen/kau_spacing_normal"
+ android:scrollbars="vertical"
+ app:layoutManager="android.support.v7.widget.LinearLayoutManager" />
+
+</FrameLayout>
diff --git a/library/src/main/res/layout/kau_search_item.xml b/library/src/main/res/layout/kau_search_iitem.xml
index efd7260..efd7260 100644
--- a/library/src/main/res/layout/kau_search_item.xml
+++ b/library/src/main/res/layout/kau_search_iitem.xml
diff --git a/library/src/main/res/transition/kau_about_enter.xml b/library/src/main/res/transition/kau_enter_slide_top.xml
index 0089b84..0089b84 100644
--- a/library/src/main/res/transition/kau_about_enter.xml
+++ b/library/src/main/res/transition/kau_enter_slide_top.xml
diff --git a/library/src/main/res/values/attr.xml b/library/src/main/res/values/attr.xml
index daeb5e3..49be8d9 100644
--- a/library/src/main/res/values/attr.xml
+++ b/library/src/main/res/values/attr.xml
@@ -29,9 +29,10 @@
<attr name="dragElasticity" format="float" />
</declare-styleable>
- <declare-styleable name="CutoutTextView">
+ <declare-styleable name="CutoutView">
<attr name="foregroundColor" format="color" />
<attr name="android:text" />
+ <attr name="android:drawable" />
<attr name="android:minHeight" />
<attr name="heightPercentageToScreen" format="float" />
<attr name="font"/>
diff --git a/library/src/main/res/values/dimens.xml b/library/src/main/res/values/dimens.xml
index d45643e..5bf6da4 100644
--- a/library/src/main/res/values/dimens.xml
+++ b/library/src/main/res/values/dimens.xml
@@ -28,5 +28,10 @@
<dimen name="kau_about_header_height">224dp</dimen>
-
+ <!-- avatar should be a 40dp asset in a 48dp touch target & optically aligned with standard padding -->
+ <dimen name="kau_avatar_size">40dp</dimen>
+ <dimen name="kau_avatar_bounds">48dp</dimen>
+ <dimen name="kau_avatar_padding">4dp</dimen> <!-- (avatar_bounds - avatar_size) / 2 -->
+ <dimen name="kau_avatar_margin">12dp</dimen> <!-- padding_normal - avatar_padding -->
+ <dimen name="kau_avatar_ripple_radius">20dp</dimen> <!-- avatar_size / 2 -->
</resources>
diff --git a/library/src/main/res/values/ids.xml b/library/src/main/res/values/ids.xml
index a21175a..fe0d411 100644
--- a/library/src/main/res/values/ids.xml
+++ b/library/src/main/res/values/ids.xml
@@ -8,6 +8,8 @@
<item name="kau_item_pref_sub_item" type="id" />
<item name="kau_item_pref_plain_text" type="id" />
<item name="kau_item_search" type="id" />
+ <item name="kau_item_cutout" type="id" />
+ <item name="kau_item_card" type="id" />
<item name="kau_item_about_library" type="id" />
<item name="kau_item_about_main" type="id" />
</resources> \ No newline at end of file
diff --git a/library/src/main/res/values/styles.xml b/library/src/main/res/values/styles.xml
index 6f5e3c1..2067c6d 100644
--- a/library/src/main/res/values/styles.xml
+++ b/library/src/main/res/values/styles.xml
@@ -14,7 +14,7 @@
</style>
<style name="Kau.Translucent.About">
- <item name="android:windowEnterTransition">@transition/kau_about_enter</item>
+ <item name="android:windowEnterTransition">@transition/kau_enter_slide_top</item>
<item name="android:windowReturnTransition">@transition/kau_about_return_upwards</item>
</style>