diff options
26 files changed, 151 insertions, 35 deletions
@@ -88,25 +88,29 @@ This means that you'll need to explicitly include each submodule you'd like to u ## [Core UI](core-ui#readme) * Collection of complex views and widgets -* Includes `:core`, `:adapter` +* Includes `:core` ## [About](about#readme) * Modularized overlaying about section. Comes with a main panel, automatic lib detection, and a FAQ parser; also includes the lib strings for KAU. -* Includes `:core-ui`, `:adapter`, +* Includes `:core-ui`, `:fastadapter`, [`About Libraries`](https://github.com/mikepenz/AboutLibraries) ## [Adapter](adapter#readme) -* Kotlin bindings for the fast adapter, as well as modularized RecyclerView animations -* Includes `:core`, -[`Fast Adapter`](https://github.com/mikepenz/FastAdapter) +* RecyclerView animations +* Includes `:core` ## [Color Picker](colorpicker#readme) * Implementation of a color picker dialog with subtle transitions and a decoupled callback * Includes `:core` +## [FastAdapter](fastadapter#readme) +* Kotlin bindings for the fast adapter +* Includes `:core`, `:adapter`, +[`Fast Adapter`](https://github.com/mikepenz/FastAdapter) + ## [KPref Activity](kpref-activity#readme) * Fully programmatic implementation of a Preference Activity, backed by a RecyclerView -* Includes `:core`, `:adapter`, `:colorpicker` +* Includes `:core`, `:fastadapter`, `:colorpicker` ## [Media Picker](mediapicker#readme) * Fully functional image and video pickers, both as an overlay and as a requested activity. @@ -116,7 +120,7 @@ This means that you'll need to explicitly include each submodule you'd like to u ## [SearchView](searchview#readme) * Material searchview with kotlin bindings -* Includes `:core-ui`, `:adapter` +* Includes `:core-ui`, `:fastadapter` ## [Gradle Plugin](buildSrc#readme) * Gradle plugin to help facilitate versioning and other gradle functions diff --git a/about/build.gradle b/about/build.gradle index 5a2a395..b970530 100644 --- a/about/build.gradle +++ b/about/build.gradle @@ -8,7 +8,7 @@ android { dependencies { implementation project(':core-ui') - implementation project(':adapter') + implementation project(':fastadapter') api kau.Dependencies.aboutLibraries } diff --git a/adapter/README.md b/adapter/README.md index a6ffb6d..f3beaff 100644 --- a/adapter/README.md +++ b/adapter/README.md @@ -1,20 +1,6 @@ # KAU :adapter -Collection of kotlin bindings and custom IItems for [Fast Adapter](https://github.com/mikepenz/FastAdapter) - -## KauIItems - -Abstract base that extends `AbstractIItems` and contains the arguments `(layoutRes, ViewHolder lambda, idRes)` in that order. -Those variables are used to override the default abstract functions. -If a layout is only used for one item, it may also be used as the id, which you may leave blank in this case. -The ViewHolder lambda is typically of the form `::ViewHolder` -Where you will have a nested class `ViewHolder(v: View) : RecyclerView.ViewHolder(v)` - -## IItem Templates - -* CardIItem - generic all encompassing card item with a title, description, imageview, and button. -All items except for the title are optional. -* HeaderIItem - simple title container with a big top margin +Helpers dealing with recyclerviews and adapters ## KauAnimator diff --git a/adapter/build.gradle b/adapter/build.gradle index de42b6c..42c6eba 100644 --- a/adapter/build.gradle +++ b/adapter/build.gradle @@ -4,9 +4,6 @@ apply from: '../android-lib.gradle' dependencies { implementation project(':core') - - api kau.Dependencies.fastAdapter - api kau.Dependencies.fastAdapterCommons } apply from: '../artifacts.gradle' diff --git a/adapter/src/main/res/values/dimens.xml b/adapter/src/main/res/values/dimens.xml deleted file mode 100644 index 193940e..0000000 --- a/adapter/src/main/res/values/dimens.xml +++ /dev/null @@ -1,3 +0,0 @@ -<resources> - <dimen name="kau_color_circle_size">56dp</dimen> -</resources> diff --git a/core-ui/build.gradle b/core-ui/build.gradle index c2732c6..23d601d 100644 --- a/core-ui/build.gradle +++ b/core-ui/build.gradle @@ -4,8 +4,6 @@ apply from: '../android-lib.gradle' dependencies { api project(':core') - implementation project(':adapter') - } apply from: '../artifacts.gradle' diff --git a/docs/Changelog.md b/docs/Changelog.md index c68629f..2c653e0 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,8 @@ # Changelog +## v5.0.1 +* :adapter: Moved fastadapter elements to new module, :fastadapter:. To migrate, simply rename the dependency. If you don't use fast adapter, no changes are necessary + ## v5.0.0 * Update Android SDK to 29 and Kotlin to 1.3.31 * Update translations diff --git a/fastadapter/.gitignore b/fastadapter/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/fastadapter/.gitignore @@ -0,0 +1 @@ +/build diff --git a/fastadapter/README.md b/fastadapter/README.md new file mode 100644 index 0000000..fa339f7 --- /dev/null +++ b/fastadapter/README.md @@ -0,0 +1,17 @@ +# KAU :fastadapter + +Collection of kotlin bindings and custom IItems for [Fast Adapter](https://github.com/mikepenz/FastAdapter) + +## KauIItems + +Abstract base that extends `AbstractIItems` and contains the arguments `(layoutRes, ViewHolder lambda, idRes)` in that order. +Those variables are used to override the default abstract functions. +If a layout is only used for one item, it may also be used as the id, which you may leave blank in this case. +The ViewHolder lambda is typically of the form `::ViewHolder` +Where you will have a nested class `ViewHolder(v: View) : RecyclerView.ViewHolder(v)` + +## IItem Templates + +* CardIItem - generic all encompassing card item with a title, description, imageview, and button. +All items except for the title are optional. +* HeaderIItem - simple title container with a big top margin
\ No newline at end of file diff --git a/fastadapter/build.gradle b/fastadapter/build.gradle new file mode 100644 index 0000000..9fd848e --- /dev/null +++ b/fastadapter/build.gradle @@ -0,0 +1,13 @@ +ext.kauSubModuleMinSdk = kau.Versions.coreMinSdk + +apply from: '../android-lib.gradle' + +dependencies { + implementation project(':core') + api project(':adapter') + + api kau.Dependencies.fastAdapter + api kau.Dependencies.fastAdapterCommons +} + +apply from: '../artifacts.gradle' diff --git a/fastadapter/progress-proguard.txt b/fastadapter/progress-proguard.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/fastadapter/progress-proguard.txt @@ -0,0 +1 @@ + diff --git a/fastadapter/src/main/AndroidManifest.xml b/fastadapter/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ab8cebb --- /dev/null +++ b/fastadapter/src/main/AndroidManifest.xml @@ -0,0 +1 @@ +<manifest package="ca.allanwang.kau.fastadapter" /> diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt index 17fd09f..17fd09f 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt index 152982f..152982f 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt index 40b4774..40b4774 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt index 6e33833..6e33833 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt index 2c488b1..2c488b1 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt index c66dc01..c66dc01 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt diff --git a/fastadapter/src/main/res/layout/kau_iitem_card.xml b/fastadapter/src/main/res/layout/kau_iitem_card.xml new file mode 100644 index 0000000..6bae0fe --- /dev/null +++ b/fastadapter/src/main/res/layout/kau_iitem_card.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + Generic card with an imageview, title, description, and button + --> +<androidx.cardview.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:background="?android:selectableItemBackground" + android:minHeight="?android:listPreferredItemHeight"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="@dimen/kau_padding_normal"> + + <ImageView + android:id="@+id/kau_card_image" + android:layout_width="56dp" + android:layout_height="56dp" + android:layout_marginBottom="4dp" + android:layout_marginTop="4dp" + android:paddingEnd="32dp" + android:scaleType="fitCenter" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0" /> + + <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" + android:visibility="gone" + 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="0dp" + 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:textColor="?attr/colorAccent" /> + + </LinearLayout> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</androidx.cardview.widget.CardView> diff --git a/fastadapter/src/main/res/layout/kau_iitem_header.xml b/fastadapter/src/main/res/layout/kau_iitem_header.xml new file mode 100644 index 0000000..b0b2ec8 --- /dev/null +++ b/fastadapter/src/main/res/layout/kau_iitem_header.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/kau_header_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + android:id="@+id/kau_header_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/kau_spacing_xlarge" + android:padding="@dimen/kau_padding_normal" + android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> + +</androidx.cardview.widget.CardView>
\ No newline at end of file diff --git a/kpref-activity/build.gradle b/kpref-activity/build.gradle index e2e2771..5cce460 100644 --- a/kpref-activity/build.gradle +++ b/kpref-activity/build.gradle @@ -7,7 +7,7 @@ apply from: '../android-lib.gradle' dependencies { implementation project(':core') implementation project(':colorpicker') - implementation project(':adapter') + implementation project(':fastadapter') } apply from: '../artifacts.gradle' diff --git a/mediapicker/build.gradle b/mediapicker/build.gradle index b3a4153..06a18d0 100644 --- a/mediapicker/build.gradle +++ b/mediapicker/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'kotlin-kapt' dependencies { implementation project(':core-ui') - implementation project(':adapter') + implementation project(':fastadapter') api kau.Dependencies.glide api kau.Dependencies.blurry diff --git a/sample/build.gradle b/sample/build.gradle index aa4bd14..4e34bf9 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -119,7 +119,7 @@ android { dependencies { implementation project(':about') - implementation project(':adapter') + implementation project(':fastadapter') implementation project(':colorpicker') implementation project(':core') implementation project(':core-ui') diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml index d59ce53..301193a 100644 --- a/sample/src/main/res/xml/kau_changelog.xml +++ b/sample/src/main/res/xml/kau_changelog.xml @@ -6,6 +6,13 @@ <item text="" /> --> + <version title="v5.0.1" /> + <item text=":adapter: Moved fastadapter elements to new module, :fastadapter:. To migrate, simply rename the dependency. If you don't use fast adapter, no changes are necessary" /> + <item text="" /> + <item text="" /> + <item text="" /> + <item text="" /> + <version title="v5.0.0" /> <item text="Update Android SDK to 29 and Kotlin to 1.3.31" /> <item text="Update translations" /> diff --git a/searchview/build.gradle b/searchview/build.gradle index 39a3662..f9e83fc 100644 --- a/searchview/build.gradle +++ b/searchview/build.gradle @@ -4,7 +4,7 @@ apply from: '../android-lib.gradle' dependencies { implementation project(':core-ui') - implementation project(':adapter') + implementation project(':fastadapter') } apply from: '../artifacts.gradle' diff --git a/settings.gradle b/settings.gradle index 2bd5947..42d498e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,6 +3,7 @@ include ':core', ':about', ':adapter', + ':fastadapter', ':colorpicker', ':mediapicker', ':kpref-activity', |