diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-08 20:25:23 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-07-08 20:25:23 -0700 |
commit | 81996038462de1be86643e95d262933c4b96c551 (patch) | |
tree | 39423b28217251e7051f86e9e4f80c47bcba20b2 /searchbar/src/main/res | |
parent | 880d433e475e5be4e5d91afac145b490f9a959b7 (diff) | |
download | kau-81996038462de1be86643e95d262933c4b96c551.tar.gz kau-81996038462de1be86643e95d262933c4b96c551.tar.bz2 kau-81996038462de1be86643e95d262933c4b96c551.zip |
Move components to separate modules
Diffstat (limited to 'searchbar/src/main/res')
-rw-r--r-- | searchbar/src/main/res/layout/kau_search_iitem.xml | 61 | ||||
-rw-r--r-- | searchbar/src/main/res/layout/kau_search_view.xml | 113 | ||||
-rw-r--r-- | searchbar/src/main/res/values/dimens.xml | 27 | ||||
-rw-r--r-- | searchbar/src/main/res/values/ids.xml | 16 |
4 files changed, 217 insertions, 0 deletions
diff --git a/searchbar/src/main/res/layout/kau_search_iitem.xml b/searchbar/src/main/res/layout/kau_search_iitem.xml new file mode 100644 index 0000000..16df945 --- /dev/null +++ b/searchbar/src/main/res/layout/kau_search_iitem.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@id/kau_search_item_frame" + android:layout_width="match_parent" + android:layout_height="@dimen/kau_search_item_height" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:gravity="start|center_vertical" + android:orientation="horizontal"> + + <ImageView + android:id="@id/kau_search_icon" + android:layout_width="@dimen/kau_search_icon" + android:layout_height="0dp" + android:contentDescription="@string/kau_search" + android:scaleType="centerInside" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@id/kau_search_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="start|center_vertical" + android:layout_weight="1" + android:ellipsize="end" + android:gravity="start|center_vertical" + android:maxLines="1" + android:paddingEnd="@dimen/kau_search_key_line_16" + android:paddingStart="@dimen/kau_search_key_line_8" + android:textIsSelectable="false" + android:textSize="@dimen/kau_search_text_small" + app:layout_constraintBottom_toTopOf="@id/kau_search_desc" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/kau_search_icon" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.5" /> + + <TextView + android:id="@id/kau_search_desc" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="start|center_vertical" + android:layout_weight="1" + android:ellipsize="end" + android:gravity="start|center_vertical" + android:maxLines="1" + android:paddingEnd="@dimen/kau_search_key_line_16" + android:paddingStart="@dimen/kau_search_key_line_8" + android:textIsSelectable="false" + android:textSize="@dimen/kau_search_text_micro" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/kau_search_icon" + app:layout_constraintTop_toBottomOf="@id/kau_search_title" /> + +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/searchbar/src/main/res/layout/kau_search_view.xml b/searchbar/src/main/res/layout/kau_search_view.xml new file mode 100644 index 0000000..c975dad --- /dev/null +++ b/searchbar/src/main/res/layout/kau_search_view.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="utf-8"?> +<merge 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="match_parent"> + + <View + android:id="@id/kau_search_shadow" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/kau_shadow_overlay" + android:visibility="gone" /> + + <ca.allanwang.kau.ui.views.BoundedCardView + android:id="@id/kau_search_cardview" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/kau_search_base_margin" + android:layout_marginStart="@dimen/kau_search_base_margin" + app:cardCornerRadius="@dimen/kau_search_base_corners" + app:maxHeightPercent="0.9"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/kau_search_height" + android:focusable="true" + android:focusableInTouchMode="true" + android:gravity="start|center_vertical" + android:orientation="horizontal"> + + <ImageView + android:id="@id/kau_search_nav" + android:layout_width="@dimen/kau_search_icon" + android:layout_height="match_parent" + android:background="?android:attr/selectableItemBackgroundBorderless" + android:clickable="true" + android:contentDescription="@string/kau_search" + android:focusable="true" + android:scaleType="centerInside" /> + + <android.support.v7.widget.AppCompatEditText + android:id="@id/kau_search_edit_text" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_gravity="start|center_vertical" + android:layout_weight="1" + android:background="@android:color/transparent" + android:ellipsize="end" + android:ems="10" + android:gravity="start|center_vertical" + android:imeOptions="actionSearch|flagNoExtractUi" + android:inputType="textNoSuggestions" + android:maxLines="1" + android:paddingEnd="@dimen/kau_search_key_line_16" + android:paddingStart="@dimen/kau_search_key_line_8" + android:privateImeOptions="nm" + android:textSize="@dimen/kau_search_text_medium" + android:windowSoftInputMode="stateAlwaysHidden" /> + + <ProgressBar + android:id="@id/kau_search_progress" + style="?android:attr/indeterminateProgressStyle" + android:layout_width="@dimen/kau_search_progress" + android:layout_height="match_parent" + android:visibility="gone" /> + + <ImageView + android:id="@id/kau_search_extra" + android:layout_width="48dp" + android:layout_height="match_parent" + android:background="?android:attr/selectableItemBackgroundBorderless" + android:clickable="true" + android:contentDescription="@string/kau_search" + android:focusable="true" + android:scaleType="center" + android:visibility="gone" /> + + <ImageView + android:id="@id/kau_search_clear" + android:layout_width="48dp" + android:layout_height="match_parent" + android:background="?android:attr/selectableItemBackgroundBorderless" + android:clickable="true" + android:contentDescription="@string/kau_search" + android:focusable="true" + android:scaleType="center" /> + + </LinearLayout> + + <View + android:id="@id/kau_search_divider" + android:layout_width="match_parent" + android:layout_height="@dimen/kau_search_divider" + android:background="?android:attr/listDivider" /> + + <android.support.v7.widget.RecyclerView + android:id="@id/kau_search_recycler" + android:layout_width="match_parent" + android:layout_height="wrap_content" + + android:overScrollMode="never" + android:visibility="gone" /> + + </LinearLayout> + + </ca.allanwang.kau.ui.views.BoundedCardView> + +</merge>
\ No newline at end of file diff --git a/searchbar/src/main/res/values/dimens.xml b/searchbar/src/main/res/values/dimens.xml new file mode 100644 index 0000000..acf79cb --- /dev/null +++ b/searchbar/src/main/res/values/dimens.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <dimen name="kau_search_height">46dp</dimen> + + <dimen name="kau_search_base_margin">4dp</dimen> + <dimen name="kau_search_base_corners">2dp</dimen> + <dimen name="kau_search_key_line_8">8dp</dimen> + <dimen name="kau_search_key_line_16">16dp</dimen> + <dimen name="kau_search_divider">1dp</dimen> + + <dimen name="kau_search_item_margin_text">24dp</dimen> + <dimen name="kau_search_item_height">56dp</dimen> + <dimen name="kau_search_icon">56dp</dimen> + <dimen name="kau_search_progress">24dp</dimen> + <dimen name="kau_search_text_micro">12sp</dimen> + <dimen name="kau_search_text_small">14sp</dimen> + <dimen name="kau_search_text_medium">16sp</dimen> + <dimen name="kau_search_reveal">24dp</dimen> + + <dimen name="kau_search_filter_margin_top">4dp</dimen> + <dimen name="kau_search_filter_margin_start">12dp</dimen> + + <dimen name="kau_search_menu_item_margin">1dp</dimen> + <dimen name="kau_search_menu_item_margin_left_right">2dp</dimen> + +</resources>
\ No newline at end of file diff --git a/searchbar/src/main/res/values/ids.xml b/searchbar/src/main/res/values/ids.xml new file mode 100644 index 0000000..b77ad4e --- /dev/null +++ b/searchbar/src/main/res/values/ids.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <item name="kau_search_cardview" type="id" /> + <item name="kau_search_clear" type="id" /> + <item name="kau_search_desc" type="id" /> + <item name="kau_search_divider" type="id" /> + <item name="kau_search_edit_text" type="id" /> + <item name="kau_search_extra" type="id" /> + <item name="kau_search_icon" type="id" /> + <item name="kau_search_item_frame" type="id" /> + <item name="kau_search_nav" type="id" /> + <item name="kau_search_progress" type="id" /> + <item name="kau_search_recycler" type="id" /> + <item name="kau_search_shadow" type="id" /> + <item name="kau_search_title" type="id" /> +</resources>
\ No newline at end of file |