From 98a7f378399546086e23e25514b705e037068058 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 17 Dec 2018 15:26:29 -0500 Subject: Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index edf6878..75df4db 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +### I will be migrating this project to androidx during the winter break (Dec 20 2018 - Jan 10 2019), as well as making a bunch of other changes. Stay tuned! + +--- + KAU -- cgit v1.2.3 From a380adea1052d39f23c9c4d432a9380ce347d6c4 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 24 Dec 2018 00:27:25 -0500 Subject: Migrate to androidx (#178) * Initial refactor * Remove alpha version usages * Update test code * Add tests for checkbox * Fix invalid card import * Remove more old support content * Update kotlin version * Add back kotterknife with new imports * Update docs * Use bold notice * Add changelog * Remove deprecation for kotterknife * Remove unused dependencies * Update changelog --- README.md | 2 +- .../ca/allanwang/kau/about/AboutActivityBase.kt | 4 +- .../ca/allanwang/kau/about/AboutPanelDelegate.kt | 2 +- .../ca/allanwang/kau/about/CollapsibleTextView.kt | 2 +- .../kotlin/ca/allanwang/kau/about/CutoutIItem.kt | 2 +- .../main/kotlin/ca/allanwang/kau/about/FaqIItem.kt | 2 +- .../kotlin/ca/allanwang/kau/about/LibraryIItem.kt | 4 +- .../res/layout/kau_about_section_libraries.xml | 6 +- .../src/main/res/layout/kau_about_section_main.xml | 8 +- about/src/main/res/layout/kau_activity_about.xml | 2 +- about/src/main/res/layout/kau_iitem_library.xml | 8 +- .../kau/adapters/FastItemThemedAdapter.kt | 2 +- .../kau/adapters/RepeatedClickListener.kt | 2 +- .../allanwang/kau/animators/AnimatorInterfaces.kt | 2 +- .../allanwang/kau/animators/BaseItemAnimator.java | 13 +- .../ca/allanwang/kau/animators/DefaultAnimator.kt | 2 +- .../allanwang/kau/animators/FadeScaleAnimator.kt | 2 +- .../ca/allanwang/kau/animators/KauAnimator.kt | 2 +- .../ca/allanwang/kau/animators/NoAnimator.kt | 2 +- .../ca/allanwang/kau/animators/SlideAnimator.kt | 2 +- .../kotlin/ca/allanwang/kau/iitems/CardIItem.kt | 4 +- .../kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt | 4 +- .../kotlin/ca/allanwang/kau/iitems/KauIItem.kt | 4 +- adapter/src/main/res/layout/kau_iitem_card.xml | 8 +- adapter/src/main/res/layout/kau_iitem_header.xml | 4 +- android-lib.gradle | 3 +- buildSrc/README.md | 2 +- .../groovy/ca/allanwang/kau/Dependencies.groovy | 5 +- .../main/groovy/ca/allanwang/kau/Versions.groovy | 46 ++++--- .../ca/allanwang/kau/colorpicker/CircleView.kt | 10 +- .../allanwang/kau/colorpicker/ColorPickerDialog.kt | 4 +- .../allanwang/kau/colorpicker/ColorPickerView.kt | 4 +- .../kau/ui/activities/ElasticRecyclerActivity.kt | 9 +- .../ca/allanwang/kau/ui/views/BoundedCardView.kt | 2 +- .../ca/allanwang/kau/ui/views/MeasuredImageView.kt | 2 +- .../ui/widgets/ElasticDragDismissFrameLayout.kt | 2 +- .../allanwang/kau/ui/widgets/InkPageIndicator.java | 4 +- .../ca/allanwang/kau/ui/widgets/TextSlider.kt | 2 +- .../layout/kau_elastic_recycler_activity.xml | 16 +-- .../layout/kau_recycler_detached_background.xml | 4 +- .../res-public/layout/kau_recycler_textslider.xml | 10 +- core/build.gradle | 12 +- .../kotlin/ca/allanwang/kau/kpref/KPrefTest.kt | 9 +- .../ca/allanwang/kau/utils/KotterknifeTest.kt | 8 +- .../kotlin/ca/allanwang/kau/xml/FaqTest.kt | 15 ++- .../kotlin/ca/allanwang/kau/email/EmailBuilder.kt | 2 +- .../ca/allanwang/kau/internal/KauBaseActivity.kt | 2 +- .../kotlin/ca/allanwang/kau/kotlin/LazyContext.kt | 4 +- .../allanwang/kau/permissions/PermissionManager.kt | 2 +- .../ca/allanwang/kau/permissions/Permissions.kt | 2 +- .../ca/allanwang/kau/swipe/SwipeBackLayout.kt | 2 +- .../ca/allanwang/kau/swipe/ViewDragHelper.java | 4 +- .../ca/allanwang/kau/ui/SimpleRippleDrawable.kt | 4 +- .../kotlin/ca/allanwang/kau/utils/ActivityUtils.kt | 16 ++- .../kotlin/ca/allanwang/kau/utils/AnimHolder.kt | 2 +- .../kotlin/ca/allanwang/kau/utils/AnimUtils.kt | 2 +- .../kotlin/ca/allanwang/kau/utils/BundleUtils.kt | 2 +- .../kotlin/ca/allanwang/kau/utils/ColorUtils.kt | 12 +- .../main/kotlin/ca/allanwang/kau/utils/Const.kt | 3 +- .../kotlin/ca/allanwang/kau/utils/ContextUtils.kt | 4 +- .../kotlin/ca/allanwang/kau/utils/DrawableUtils.kt | 4 +- .../kotlin/ca/allanwang/kau/utils/FragmentUtils.kt | 2 +- .../kotlin/ca/allanwang/kau/utils/IIconUtils.kt | 2 +- .../kotlin/ca/allanwang/kau/utils/Kotterknife.kt | 135 ++++++--------------- .../ca/allanwang/kau/utils/NotificationUtils.kt | 2 +- .../kotlin/ca/allanwang/kau/utils/RecyclerUtils.kt | 2 +- .../ca/allanwang/kau/utils/TransitionUtils.kt | 14 +-- .../main/kotlin/ca/allanwang/kau/utils/Utils.kt | 2 +- .../kotlin/ca/allanwang/kau/utils/ViewUtils.kt | 20 +-- .../main/kotlin/ca/allanwang/kau/xml/Changelog.kt | 8 +- core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt | 2 +- docs/Changelog.md | 3 + docs/Migration.md | 9 ++ gradle.properties | 2 + .../allanwang/kau/kpref/activity/KPrefActivity.kt | 4 +- .../ca/allanwang/kau/kpref/activity/KPrefBinder.kt | 2 +- .../kau/kpref/activity/items/KPrefCheckbox.kt | 2 +- .../kau/kpref/activity/items/KPrefItemBase.kt | 2 +- .../kau/kpref/activity/items/KPrefItemCore.kt | 10 +- .../src/main/res/layout/kau_pref_activity.xml | 8 +- .../src/main/res/layout/kau_pref_checkbox.xml | 2 +- .../src/main/res/layout/kau_pref_core.xml | 12 +- .../src/main/res/layout/kau_pref_header.xml | 2 +- .../src/main/res/layout/kau_pref_seekbar.xml | 2 +- .../src/main/res/layout/kau_pref_seekbar_text.xml | 2 +- .../src/main/res/layout/kau_pref_text.xml | 2 +- .../ca/allanwang/kau/mediapicker/MediaItem.kt | 2 +- .../ca/allanwang/kau/mediapicker/MediaItemBasic.kt | 2 +- .../ca/allanwang/kau/mediapicker/MediaModel.kt | 6 +- .../kau/mediapicker/MediaPickerActivityBase.kt | 6 +- .../mediapicker/MediaPickerActivityOverlayBase.kt | 2 +- .../allanwang/kau/mediapicker/MediaPickerCore.kt | 16 +-- .../ca/allanwang/kau/mediapicker/MediaUtils.kt | 2 +- .../kau_activity_image_picker_overlay.xml | 2 +- .../main/res/layout/kau_activity_image_picker.xml | 16 +-- sample/build.gradle | 24 ++-- .../ca/allanwang/kau/sample/ColorPickerTest.kt | 24 ++-- .../ca/allanwang/kau/sample/KPrefViewTest.kt | 112 +++++++++++++++++ .../ca/allanwang/kau/sample/utils/EspressoUtils.kt | 22 ++++ sample/src/main/AndroidManifest.xml | 2 +- .../kotlin/ca/allanwang/kau/sample/MediaPicker.kt | 2 +- .../ca/allanwang/kau/sample/PermissionCheckbox.kt | 2 +- sample/src/main/res/layout/activity_swipe.xml | 6 +- sample/src/main/res/xml/kau_changelog.xml | 5 +- .../ca/allanwang/kau/searchview/SearchItem.kt | 4 +- .../ca/allanwang/kau/searchview/SearchView.kt | 12 +- .../src/main/res/layout/kau_search_iitem.xml | 4 +- searchview/src/main/res/layout/kau_search_view.xml | 4 +- 108 files changed, 496 insertions(+), 365 deletions(-) create mode 100644 sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt create mode 100644 sample/src/androidTest/kotlin/ca/allanwang/kau/sample/utils/EspressoUtils.kt (limited to 'README.md') diff --git a/README.md b/README.md index 75df4db..4143ca8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -### I will be migrating this project to androidx during the winter break (Dec 20 2018 - Jan 10 2019), as well as making a bunch of other changes. Stay tuned! +**Note: v3.8.0 is the last release with support dependencies. Starting with 4.0.0-alpha01, androidx will be used** --- diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt index f4ee4c5..9667f47 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt @@ -2,12 +2,12 @@ package ca.allanwang.kau.about import android.graphics.drawable.Drawable import android.os.Bundle -import android.support.v4.view.PagerAdapter -import android.support.v4.view.ViewPager import android.transition.TransitionInflater import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.viewpager.widget.PagerAdapter +import androidx.viewpager.widget.ViewPager import ca.allanwang.kau.adapters.FastItemThemedAdapter import ca.allanwang.kau.adapters.ThemableIItemColors import ca.allanwang.kau.adapters.ThemableIItemColorsDelegate diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt index b6ea16b..6698dba 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.about -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt b/about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt index f010321..3dbb87e 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.about import android.content.Context import android.content.res.Configuration -import android.support.v7.widget.AppCompatTextView +import androidx.appcompat.widget.AppCompatTextView import android.util.AttributeSet import ca.allanwang.kau.ui.views.CollapsibleView import ca.allanwang.kau.ui.views.CollapsibleViewDelegate diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt index 37c13d8..630a48e 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.about -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt index 5cf046e..5f5d0c6 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.about import android.annotation.SuppressLint -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.text.method.LinkMovementMethod import android.view.View import android.view.ViewGroup diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt index 2749c28..e1e9a76 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt @@ -1,11 +1,11 @@ package ca.allanwang.kau.about import android.os.Build -import android.support.v7.widget.CardView -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.text.Html import android.view.View import android.widget.TextView +import androidx.cardview.widget.CardView import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate import ca.allanwang.kau.iitems.KauIItem diff --git a/about/src/main/res/layout/kau_about_section_libraries.xml b/about/src/main/res/layout/kau_about_section_libraries.xml index c14225e..60d1312 100644 --- a/about/src/main/res/layout/kau_about_section_libraries.xml +++ b/about/src/main/res/layout/kau_about_section_libraries.xml @@ -1,5 +1,5 @@ - - - + diff --git a/about/src/main/res/layout/kau_about_section_main.xml b/about/src/main/res/layout/kau_about_section_main.xml index e7b83a0..7ea0415 100644 --- a/about/src/main/res/layout/kau_about_section_main.xml +++ b/about/src/main/res/layout/kau_about_section_main.xml @@ -1,12 +1,12 @@ - - @@ -41,6 +41,6 @@ - + - + diff --git a/about/src/main/res/layout/kau_activity_about.xml b/about/src/main/res/layout/kau_activity_about.xml index 3d1f9ab..626adda 100644 --- a/about/src/main/res/layout/kau_activity_about.xml +++ b/about/src/main/res/layout/kau_activity_about.xml @@ -9,7 +9,7 @@ app:dragDismissScale="0.95" tools:context=".ui.about.AboutActivityBase"> - diff --git a/about/src/main/res/layout/kau_iitem_library.xml b/about/src/main/res/layout/kau_iitem_library.xml index 47b4e01..4dd5155 100644 --- a/about/src/main/res/layout/kau_iitem_library.xml +++ b/about/src/main/res/layout/kau_iitem_library.xml @@ -1,5 +1,5 @@ - - - + - \ No newline at end of file + \ No newline at end of file diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt index 870861d..75cf876 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/FastItemThemedAdapter.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.adapters import android.content.res.ColorStateList import android.os.Build -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import android.view.View import android.widget.ImageView import android.widget.TextView diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt index aeee94c..a23ac37 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/adapters/RepeatedClickListener.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.adapters -import android.support.annotation.IntRange +import androidx.annotation.IntRange import android.view.View import com.mikepenz.fastadapter.FastAdapter import com.mikepenz.fastadapter.IAdapter diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/AnimatorInterfaces.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/AnimatorInterfaces.kt index 3cf13df..15c3b41 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/AnimatorInterfaces.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/AnimatorInterfaces.kt @@ -1,8 +1,8 @@ package ca.allanwang.kau.animators -import android.support.v7.widget.RecyclerView import android.view.View import android.view.ViewPropertyAnimator +import androidx.recyclerview.widget.RecyclerView /** * Created by Allan Wang on 2017-07-11. diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/BaseItemAnimator.java b/adapter/src/main/kotlin/ca/allanwang/kau/animators/BaseItemAnimator.java index 06b8df6..4ead735 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/BaseItemAnimator.java +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/BaseItemAnimator.java @@ -26,10 +26,11 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.TimeInterpolator; import android.animation.ValueAnimator; -import android.support.annotation.NonNull; -import android.support.v4.view.ViewCompat; -import android.support.v7.widget.RecyclerView.ViewHolder; -import android.support.v7.widget.SimpleItemAnimator; +import androidx.annotation.NonNull; +import androidx.core.view.ViewCompat; +import androidx.recyclerview.widget.RecyclerView.ViewHolder; +import androidx.recyclerview.widget.SimpleItemAnimator; + import android.view.View; import android.view.ViewPropertyAnimator; import android.view.animation.Interpolator; @@ -38,11 +39,11 @@ import java.util.ArrayList; import java.util.List; /** - * This implementation of {@link android.support.v7.widget.RecyclerView.ItemAnimator} provides basic + * This implementation of {@link androidx.recyclerview.widget.RecyclerView.ItemAnimator} provides basic * animations on remove, add, and move events that happen to the items in * a RecyclerView. RecyclerView uses a DefaultItemAnimator by default. * - * @see android.support.v7.widget.RecyclerView#setItemAnimator(android.support.v7.widget.RecyclerView.ItemAnimator) + * @see androidx.recyclerview.widget.RecyclerView#setItemAnimator(androidx.recyclerview.widget.RecyclerView.ItemAnimator) */ public abstract class BaseItemAnimator extends SimpleItemAnimator { private static final boolean DEBUG = false; diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/DefaultAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/DefaultAnimator.kt index 9aeafde..f2b6353 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/DefaultAnimator.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/DefaultAnimator.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.animators -import android.support.v7.widget.RecyclerView import android.view.ViewPropertyAnimator +import androidx.recyclerview.widget.RecyclerView /** * Created by Allan Wang on 2017-06-27. diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt index bf38cac..dec5f79 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.animators -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import android.view.ViewPropertyAnimator import ca.allanwang.kau.utils.scaleXY diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt index 7b9b732..a088273 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.animators -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.ViewPropertyAnimator import ca.allanwang.kau.utils.KAU_BOTTOM import ca.allanwang.kau.utils.KAU_RIGHT diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt index 5ecc937..ea0c123 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/NoAnimator.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.animators -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import android.view.ViewPropertyAnimator diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/SlideAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/SlideAnimator.kt index f8f71a5..01ad1ff 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/SlideAnimator.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/SlideAnimator.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.animators -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import android.view.ViewPropertyAnimator import ca.allanwang.kau.utils.KAU_BOTTOM diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt index ba969a2..784dd3c 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt @@ -2,13 +2,13 @@ package ca.allanwang.kau.iitems import android.graphics.Color import android.graphics.drawable.Drawable -import android.support.v7.widget.CardView -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import android.widget.Button import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView +import androidx.cardview.widget.CardView import ca.allanwang.kau.adapter.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt index 2116b34..098f017 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt @@ -1,9 +1,9 @@ package ca.allanwang.kau.iitems -import android.support.v7.widget.CardView -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import android.widget.TextView +import androidx.cardview.widget.CardView import ca.allanwang.kau.adapter.R import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt index 5174503..205d388 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt @@ -1,8 +1,8 @@ package ca.allanwang.kau.iitems import android.annotation.SuppressLint -import android.support.annotation.LayoutRes -import android.support.v7.widget.RecyclerView +import androidx.annotation.LayoutRes +import androidx.recyclerview.widget.RecyclerView import android.view.View import com.mikepenz.fastadapter.IClickable import com.mikepenz.fastadapter.IItem diff --git a/adapter/src/main/res/layout/kau_iitem_card.xml b/adapter/src/main/res/layout/kau_iitem_card.xml index 249f3b8..6bae0fe 100644 --- a/adapter/src/main/res/layout/kau_iitem_card.xml +++ b/adapter/src/main/res/layout/kau_iitem_card.xml @@ -3,7 +3,7 @@ - - @@ -69,6 +69,6 @@ - + - + diff --git a/adapter/src/main/res/layout/kau_iitem_header.xml b/adapter/src/main/res/layout/kau_iitem_header.xml index db809eb..b0b2ec8 100644 --- a/adapter/src/main/res/layout/kau_iitem_header.xml +++ b/adapter/src/main/res/layout/kau_iitem_header.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/android-lib.gradle b/android-lib.gradle index 7275347..e8a4c6d 100644 --- a/android-lib.gradle +++ b/android-lib.gradle @@ -31,7 +31,7 @@ android { versionCode androidGitVersion.code() consumerProguardFiles 'progress-proguard.txt' multiDexEnabled true - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -87,5 +87,6 @@ dependencies { androidTestImplementation kauDependency.kotlinTest androidTestImplementation kauDependency.espresso + androidTestImplementation kauDependency.testRules androidTestImplementation kauDependency.testRunner } \ No newline at end of file diff --git a/buildSrc/README.md b/buildSrc/README.md index 60d2dfc..91a60ac 100644 --- a/buildSrc/README.md +++ b/buildSrc/README.md @@ -48,7 +48,7 @@ You are free to use the values through `kau.[tagName]`. As an example, AppCompat is imported in KAU using ```gradle -api "com.android.support:appcompat-v7:${kau.supportLibs}" +api "androidx.appcompat:appcompat:${kau.appcompat}" ``` # Plugins diff --git a/buildSrc/src/main/groovy/ca/allanwang/kau/Dependencies.groovy b/buildSrc/src/main/groovy/ca/allanwang/kau/Dependencies.groovy index ec3d208..a27e503 100644 --- a/buildSrc/src/main/groovy/ca/allanwang/kau/Dependencies.groovy +++ b/buildSrc/src/main/groovy/ca/allanwang/kau/Dependencies.groovy @@ -7,6 +7,7 @@ class Dependencies { static def kotlin = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}" static def kotlinTest = "org.jetbrains.kotlin:kotlin-test-junit:${Versions.kotlin}" static def junit = "junit:junit:${Versions.junit}" - static def espresso = "com.android.support.test.espresso:espresso-core:${Versions.espresso}" - static def testRunner = "com.android.support.test:runner:${Versions.testRunner}" + static def espresso = "androidx.test.espresso:espresso-core:${Versions.espresso}" + static def testRunner = "androidx.test.ext:junit:${Versions.testRunner}" + static def testRules = "androidx.test:rules:${Versions.testRules}" } \ No newline at end of file diff --git a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy index 55fc646..637ae68 100644 --- a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy +++ b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy @@ -8,14 +8,26 @@ class Versions { // https://developer.android.com/studio/releases/build-tools static def buildTools = '28.0.3' - // https://developer.android.com/topic/libraries/support-library/revisions - static def supportLibs = '28.0.0' + // https://mvnrepository.com/artifact/androidx.appcompat/appcompat?repo=google + static def appcompat = '1.0.2' + + // https://mvnrepository.com/artifact/com.google.android.material/material + static def googleMaterial = '1.0.0' + + // https://mvnrepository.com/artifact/androidx.recyclerview/recyclerview + static def recyclerView = '1.0.0' + + // https://mvnrepository.com/artifact/androidx.cardview/cardview + static def cardView = '1.0.0' + + // https://mvnrepository.com/artifact/androidx.constraintlayout/constraintlayout + static def constraintLayout = '1.1.3' // https://kotlinlang.org/docs/reference/using-gradle.html - static def kotlin = '1.2.71' + static def kotlin = '1.3.11' // https://github.com/mikepenz/AboutLibraries/releases - static def aboutLibraries = '6.1.1' + static def aboutLibraries = '6.2.0' // https://github.com/Kotlin/anko/releases static def anko = '0.10.5' @@ -23,29 +35,35 @@ class Versions { // https://github.com/wasabeef/Blurry/releases static def blurry = '2.1.1' - // https://dl.google.com/dl/android/maven2/com/android/support/constraint/group-index.xml - static def constraintLayout = '1.1.3' - // https://github.com/mikepenz/FastAdapter#using-maven - static def fastAdapter = '3.2.9' + static def fastAdapter = '3.3.1' static def fastAdapterCommons = fastAdapter // https://github.com/bumptech/glide/releases static def glide = '4.8.0' // https://github.com/mikepenz/Android-Iconics#1-provide-the-gradle-dependency - static def iconics = '3.0.4' - static def iconicsGoogle = '3.0.1.2' - static def iconicsMaterial = '2.2.0.4' - static def iconicsCommunity = '2.0.46.1' + static def iconics = '3.1.0' + static def iconicsGoogle = '3.0.1.3' + static def iconicsMaterial = '2.2.0.5' + static def iconicsCommunity = '2.7.94.1' // https://github.com/afollestad/material-dialogs/releases static def materialDialog = '0.9.6.0' - static def espresso = '3.0.1' + // https://mvnrepository.com/artifact/androidx.test.espresso/espresso-core?repo=google + static def espresso = '3.1.1' + + // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api static def junit = '4.12' - static def testRunner = '1.0.1' + + static def testRunner = '1.1.0' + + // https://mvnrepository.com/artifact/androidx.test/rules?repo=google + static def testRules = '1.1.1' + + // https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google static def gradlePlugin = '3.2.1' static def mavenPlugin = '2.1' static def playPublishPlugin = '1.2.2' diff --git a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/CircleView.kt b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/CircleView.kt index 310fd53..bdd6eed 100644 --- a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/CircleView.kt +++ b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/CircleView.kt @@ -13,11 +13,11 @@ import android.graphics.drawable.ShapeDrawable import android.graphics.drawable.StateListDrawable import android.graphics.drawable.shapes.OvalShape import android.os.Build -import android.support.annotation.ColorInt -import android.support.annotation.ColorRes -import android.support.annotation.FloatRange -import android.support.v4.view.GravityCompat -import android.support.v4.view.ViewCompat +import androidx.annotation.ColorInt +import androidx.annotation.ColorRes +import androidx.annotation.FloatRange +import androidx.core.view.GravityCompat +import androidx.core.view.ViewCompat import android.util.AttributeSet import android.view.Gravity import android.widget.FrameLayout diff --git a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerDialog.kt b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerDialog.kt index b264e58..6c4ad92 100644 --- a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerDialog.kt +++ b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerDialog.kt @@ -2,8 +2,8 @@ package ca.allanwang.kau.colorpicker import android.content.Context import android.graphics.Color -import android.support.annotation.DimenRes -import android.support.annotation.StringRes +import androidx.annotation.DimenRes +import androidx.annotation.StringRes import ca.allanwang.kau.utils.INVALID_ID import ca.allanwang.kau.utils.string import com.afollestad.materialdialogs.MaterialDialog diff --git a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt index b9cea99..5174089 100644 --- a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt +++ b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt @@ -3,8 +3,8 @@ package ca.allanwang.kau.colorpicker import android.annotation.SuppressLint import android.content.Context import android.graphics.Color -import android.support.annotation.ColorInt -import android.support.v4.content.res.ResourcesCompat +import androidx.annotation.ColorInt +import androidx.core.content.res.ResourcesCompat import android.text.Editable import android.text.InputFilter import android.text.TextWatcher diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt index 3951970..5b0e97b 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/activities/ElasticRecyclerActivity.kt @@ -2,10 +2,10 @@ package ca.allanwang.kau.ui.activities import android.os.Build import android.os.Bundle -import android.support.annotation.RequiresApi -import android.support.v7.widget.RecyclerView -import android.support.v7.widget.Toolbar import android.transition.TransitionInflater +import androidx.annotation.RequiresApi +import androidx.appcompat.widget.Toolbar +import androidx.recyclerview.widget.RecyclerView import ca.allanwang.kau.internal.KauBaseActivity import ca.allanwang.kau.ui.R import ca.allanwang.kau.ui.widgets.ElasticDragDismissFrameLayout @@ -16,7 +16,7 @@ import kotlinx.android.synthetic.main.kau_elastic_recycler_activity.* * * A generic activity comprised of an ElasticDragDismissFrameLayout, CoordinatorLayout, Toolbar, RecyclerView, and Fab * [ca.allanwang.kau.ui.widgets.ElasticDragDismissFrameLayout] - * [android.support.v7.widget.RecyclerView] + * [androidx.recyclerview.widget.RecyclerView] * * The recyclerview defaults to a linearlayoutmanager, and the adapter is automatically bounded * @@ -39,6 +39,7 @@ abstract class ElasticRecyclerActivity : KauBaseActivity() { setContentView(R.layout.kau_elastic_recycler_activity) setSupportActionBar(kau_toolbar) if (!onCreate(savedInstanceState, configs)) return + kau_draggable.addListener(object : ElasticDragDismissFrameLayout.SystemChromeFader(this) { override fun onDragDismissed() { window.returnTransition = TransitionInflater.from(this@ElasticRecyclerActivity) diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/BoundedCardView.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/BoundedCardView.kt index 5fc3e06..25a05df 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/BoundedCardView.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/BoundedCardView.kt @@ -2,8 +2,8 @@ package ca.allanwang.kau.ui.views import android.content.Context import android.graphics.Rect -import android.support.v7.widget.CardView import android.util.AttributeSet +import androidx.cardview.widget.CardView import ca.allanwang.kau.ui.R import ca.allanwang.kau.utils.parentViewGroup diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt index 5db5eaa..5cb4329 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.ui.views import android.content.Context -import android.support.v7.widget.AppCompatImageView +import androidx.appcompat.widget.AppCompatImageView import android.util.AttributeSet /** diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt index f357f79..b89373e 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/ElasticDragDismissFrameLayout.kt @@ -20,7 +20,7 @@ import android.app.Activity import android.content.Context import android.graphics.Color import android.os.Build -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import android.transition.TransitionInflater import android.util.AttributeSet import android.view.MotionEvent diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java index a963556..13381aa 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/InkPageIndicator.java @@ -27,14 +27,14 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; -import android.support.annotation.ColorInt; -import android.support.v4.view.ViewPager; +import androidx.annotation.ColorInt; import android.util.AttributeSet; import android.view.View; import android.view.animation.Interpolator; import java.util.Arrays; +import androidx.viewpager.widget.ViewPager; import ca.allanwang.kau.ui.R; import ca.allanwang.kau.utils.AnimHolder; import ca.allanwang.kau.utils.ColorUtilsKt; diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt index bcd930f..a53ee9d 100644 --- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt +++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/widgets/TextSlider.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.ui.widgets import android.content.Context import android.graphics.Color -import android.support.v4.widget.TextViewCompat +import androidx.core.widget.TextViewCompat import android.text.TextUtils import android.util.AttributeSet import android.view.Gravity diff --git a/core-ui/src/main/res-public/layout/kau_elastic_recycler_activity.xml b/core-ui/src/main/res-public/layout/kau_elastic_recycler_activity.xml index 9fbe447..5fc151c 100644 --- a/core-ui/src/main/res-public/layout/kau_elastic_recycler_activity.xml +++ b/core-ui/src/main/res-public/layout/kau_elastic_recycler_activity.xml @@ -7,7 +7,7 @@ app:dragDismissDistance="@dimen/kau_drag_dismiss_distance_large" app:dragDismissScale="0.95"> - - - - + - - - + \ No newline at end of file diff --git a/core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml b/core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml index 7295d66..2273a20 100644 --- a/core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml +++ b/core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml @@ -15,13 +15,13 @@ - + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> diff --git a/core-ui/src/main/res-public/layout/kau_recycler_textslider.xml b/core-ui/src/main/res-public/layout/kau_recycler_textslider.xml index eacd5be..d048627 100644 --- a/core-ui/src/main/res-public/layout/kau_recycler_textslider.xml +++ b/core-ui/src/main/res-public/layout/kau_recycler_textslider.xml @@ -1,11 +1,11 @@ - - - + - - + diff --git a/core/build.gradle b/core/build.gradle index 046a734..a57ee6e 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -5,13 +5,11 @@ apply from: '../android-lib.gradle' dependencies { api kauDependency.kotlin - api "com.android.support:support-annotations:${kau.supportLibs}" - api "com.android.support:appcompat-v7:${kau.supportLibs}" - api "com.android.support:support-v13:${kau.supportLibs}" - api "com.android.support:design:${kau.supportLibs}" - api "com.android.support:recyclerview-v7:${kau.supportLibs}" - api "com.android.support:cardview-v7:${kau.supportLibs}" - api "com.android.support.constraint:constraint-layout:${kau.constraintLayout}" + api "androidx.appcompat:appcompat:${kau.appcompat}" + api "androidx.recyclerview:recyclerview:${kau.recyclerView}" + api "androidx.cardview:cardview:${kau.cardView}" + api "androidx.constraintlayout:constraintlayout:${kau.constraintLayout}" + api "com.google.android.material:material:${kau.googleMaterial}" api "com.mikepenz:iconics-core:${kau.iconics}@aar" api "com.mikepenz:google-material-typeface:${kau.iconicsGoogle}.original@aar" diff --git a/core/src/androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt b/core/src/androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt index 2a9263a..52f344b 100644 --- a/core/src/androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt +++ b/core/src/androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt @@ -1,9 +1,10 @@ package ca.allanwang.kau.kpref import android.annotation.SuppressLint -import android.support.test.InstrumentationRegistry -import android.support.test.filters.MediumTest -import android.support.test.runner.AndroidJUnit4 +import android.content.Context +import androidx.test.core.app.ApplicationProvider +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.MediumTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -23,7 +24,7 @@ class KPrefTest { class TestPref : KPref() { init { - initialize(InstrumentationRegistry.getTargetContext(), "kpref_test_${System.currentTimeMillis()}") + initialize(ApplicationProvider.getApplicationContext(), "kpref_test_${System.currentTimeMillis()}") } var one by kpref("one", 1) diff --git a/core/src/androidTest/kotlin/ca/allanwang/kau/utils/KotterknifeTest.kt b/core/src/androidTest/kotlin/ca/allanwang/kau/utils/KotterknifeTest.kt index 1dac92f..13a3c77 100644 --- a/core/src/androidTest/kotlin/ca/allanwang/kau/utils/KotterknifeTest.kt +++ b/core/src/androidTest/kotlin/ca/allanwang/kau/utils/KotterknifeTest.kt @@ -1,12 +1,12 @@ package ca.allanwang.kau.utils import android.content.Context -import android.support.test.InstrumentationRegistry -import android.support.test.filters.MediumTest -import android.support.test.runner.AndroidJUnit4 import android.view.View import android.widget.FrameLayout import android.widget.TextView +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.MediumTest +import androidx.test.platform.app.InstrumentationRegistry import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -25,7 +25,7 @@ class KotterknifeTest { @Before fun init() { - context = InstrumentationRegistry.getContext() + context = InstrumentationRegistry.getInstrumentation().context } @Test diff --git a/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt b/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt index f9ce24b..7a6d2e0 100644 --- a/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt +++ b/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt @@ -1,8 +1,10 @@ package ca.allanwang.kau.xml -import android.support.test.InstrumentationRegistry -import android.support.test.filters.MediumTest -import android.support.test.runner.AndroidJUnit4 +import android.content.Context +import androidx.test.core.app.ApplicationProvider +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.MediumTest +import ca.allanwang.kau.test.R import org.junit.Test import org.junit.runner.RunWith import kotlin.test.assertEquals @@ -14,9 +16,12 @@ import kotlin.test.assertEquals @MediumTest class FaqTest { + val context: Context + get() = ApplicationProvider.getApplicationContext() + @Test fun simpleTest() { - InstrumentationRegistry.getTargetContext().kauParseFaq(R.xml.test_faq) { data -> + context.kauParseFaq(R.xml.test_faq) { data -> assertEquals(2, data.size, "FAQ size is incorrect") assertEquals("1. This is a question", data.first().question.toString(), "First question does not match") assertEquals("This is an answer", data.first().answer.toString(), "First answer does not match") @@ -27,7 +32,7 @@ class FaqTest { @Test fun withoutNumbering() { - InstrumentationRegistry.getTargetContext().kauParseFaq(R.xml.test_faq, false) { data -> + context.kauParseFaq(R.xml.test_faq, false) { data -> assertEquals(2, data.size, "FAQ size is incorrect") assertEquals("This is a question", data.first().question.toString(), "First question does not match") assertEquals("This is an answer", data.first().answer.toString(), "First answer does not match") diff --git a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt index dbdcf09..0184b9a 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt @@ -6,7 +6,7 @@ import android.content.Intent import android.content.pm.PackageManager import android.net.Uri import android.os.Build -import android.support.annotation.StringRes +import androidx.annotation.StringRes import android.util.DisplayMetrics import ca.allanwang.kau.R import ca.allanwang.kau.logging.KL diff --git a/core/src/main/kotlin/ca/allanwang/kau/internal/KauBaseActivity.kt b/core/src/main/kotlin/ca/allanwang/kau/internal/KauBaseActivity.kt index 87d94ce..c71761d 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/internal/KauBaseActivity.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/internal/KauBaseActivity.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.internal -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import ca.allanwang.kau.permissions.kauOnRequestPermissionsResult /** diff --git a/core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyContext.kt b/core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyContext.kt index 0a45b65..3d98633 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyContext.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyContext.kt @@ -1,8 +1,8 @@ package ca.allanwang.kau.kotlin import android.content.Context -import android.support.annotation.AnimRes -import android.support.annotation.InterpolatorRes +import androidx.annotation.AnimRes +import androidx.annotation.InterpolatorRes import android.view.animation.Animation import android.view.animation.AnimationUtils import android.view.animation.Interpolator diff --git a/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt b/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt index 36456ec..922dc09 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt @@ -3,7 +3,7 @@ package ca.allanwang.kau.permissions import android.app.Activity import android.content.Context import android.content.pm.PackageManager -import android.support.v4.app.ActivityCompat +import androidx.core.app.ActivityCompat import ca.allanwang.kau.kotlin.lazyContext import ca.allanwang.kau.logging.KL import ca.allanwang.kau.utils.KauException diff --git a/core/src/main/kotlin/ca/allanwang/kau/permissions/Permissions.kt b/core/src/main/kotlin/ca/allanwang/kau/permissions/Permissions.kt index 248e484..83cd2ed 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/permissions/Permissions.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/permissions/Permissions.kt @@ -4,7 +4,7 @@ import android.Manifest import android.app.Activity import android.content.Context import android.os.Build -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi /** diff --git a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt index a323e6c..4d7142c 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt @@ -4,7 +4,7 @@ import android.annotation.SuppressLint import android.app.Activity import android.content.Context import android.graphics.Canvas -import android.support.v4.view.ViewCompat +import androidx.core.view.ViewCompat import android.util.AttributeSet import android.view.MotionEvent import android.view.View diff --git a/core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java b/core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java index 566e9e5..ac7fb7e 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java +++ b/core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java @@ -1,7 +1,7 @@ package ca.allanwang.kau.swipe; import android.content.Context; -import android.support.v4.view.ViewCompat; +import androidx.core.view.ViewCompat; import android.util.Log; import android.view.MotionEvent; import android.view.VelocityTracker; @@ -25,7 +25,7 @@ import static ca.allanwang.kau.swipe.SwipeBackHelperKt.SWIPE_EDGE_TOP; * of useful operations and state tracking for allowing a user to drag and reposition * views within their parent ViewGroup. *

- * This is an extension of {@link android.support.v4.widget.ViewDragHelper} + * This is an extension of {@link androidx.core.widget.ViewDragHelper} * Along with additional methods defined in {@link ViewDragHelperExtras} */ class ViewDragHelper implements ViewDragHelperExtras { diff --git a/core/src/main/kotlin/ca/allanwang/kau/ui/SimpleRippleDrawable.kt b/core/src/main/kotlin/ca/allanwang/kau/ui/SimpleRippleDrawable.kt index b92b222..4700162 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/ui/SimpleRippleDrawable.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/ui/SimpleRippleDrawable.kt @@ -4,8 +4,8 @@ import android.content.res.ColorStateList import android.graphics.drawable.ColorDrawable import android.graphics.drawable.RippleDrawable import android.os.Build -import android.support.annotation.ColorInt -import android.support.annotation.RequiresApi +import androidx.annotation.ColorInt +import androidx.annotation.RequiresApi import ca.allanwang.kau.utils.adjustAlpha /** diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt index ab0e59f..eab9536 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt @@ -11,13 +11,13 @@ import android.content.Intent import android.graphics.Color import android.os.Build import android.os.Bundle -import android.support.annotation.ColorInt -import android.support.annotation.RequiresApi -import android.support.annotation.StringRes -import android.support.design.widget.Snackbar import android.view.Menu import android.view.View +import androidx.annotation.ColorInt +import androidx.annotation.RequiresApi +import androidx.annotation.StringRes import ca.allanwang.kau.R +import com.google.android.material.snackbar.Snackbar import com.mikepenz.iconics.typeface.IIcon import org.jetbrains.anko.contentView @@ -135,9 +135,13 @@ fun Context.setMenuIcons(menu: Menu, @ColorInt color: Int = Color.WHITE, vararg } } -inline fun Activity.hideKeyboard() = currentFocus.hideKeyboard() +inline fun Activity.hideKeyboard() { + currentFocus?.hideKeyboard() +} -inline fun Activity.showKeyboard() = currentFocus.showKeyboard() +inline fun Activity.showKeyboard() { + currentFocus?.showKeyboard() +} inline fun Activity.snackbar(text: String, duration: Int = Snackbar.LENGTH_LONG, noinline builder: Snackbar.() -> Unit = {}) = contentView!!.snackbar(text, duration, builder) diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/AnimHolder.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/AnimHolder.kt index 2767f04..b988085 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/AnimHolder.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/AnimHolder.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.utils import android.os.Build -import android.support.annotation.RequiresApi +import androidx.annotation.RequiresApi import ca.allanwang.kau.kotlin.lazyInterpolator /** diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/AnimUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/AnimUtils.kt index a287cf2..d8e4681 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/AnimUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/AnimUtils.kt @@ -3,7 +3,7 @@ package ca.allanwang.kau.utils import android.animation.Animator import android.animation.AnimatorListenerAdapter import android.annotation.SuppressLint -import android.support.annotation.StringRes +import androidx.annotation.StringRes import android.view.View import android.view.ViewAnimationUtils import android.view.ViewPropertyAnimator diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt index 82cd577..d628214 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt @@ -5,7 +5,7 @@ import android.app.Activity import android.app.ActivityOptions import android.content.Context import android.os.Bundle -import android.support.annotation.AnimRes +import androidx.annotation.AnimRes import android.util.Pair import android.view.View import ca.allanwang.kau.R diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt index 236f2ca..f010c6f 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt @@ -7,12 +7,12 @@ import android.graphics.Color import android.graphics.PorterDuff import android.graphics.drawable.Drawable import android.os.Build -import android.support.annotation.ColorInt -import android.support.annotation.FloatRange -import android.support.annotation.IntRange -import android.support.v4.graphics.drawable.DrawableCompat -import android.support.v7.widget.AppCompatEditText -import android.support.v7.widget.Toolbar +import androidx.annotation.ColorInt +import androidx.annotation.FloatRange +import androidx.annotation.IntRange +import androidx.core.graphics.drawable.DrawableCompat +import androidx.appcompat.widget.AppCompatEditText +import androidx.appcompat.widget.Toolbar import android.widget.* import com.afollestad.materialdialogs.R import java.util.* diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/Const.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/Const.kt index 1eeac1a..eb09093 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/Const.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/Const.kt @@ -1,6 +1,7 @@ package ca.allanwang.kau.utils -import android.support.v4.widget.ViewDragHelper +import androidx.customview.widget.ViewDragHelper + /** * Created by Allan Wang on 2017-06-08. diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt index 6568bf2..f6e9ac7 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt @@ -11,8 +11,8 @@ import android.content.pm.PackageManager import android.graphics.drawable.Drawable import android.net.Uri import android.os.Bundle -import android.support.annotation.* -import android.support.v4.content.ContextCompat +import androidx.annotation.* +import androidx.core.content.ContextCompat import android.util.TypedValue import android.view.View import android.view.animation.AnimationUtils diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/DrawableUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/DrawableUtils.kt index dae3bff..59e684a 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/DrawableUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/DrawableUtils.kt @@ -2,8 +2,8 @@ package ca.allanwang.kau.utils import android.content.res.ColorStateList import android.graphics.drawable.Drawable -import android.support.annotation.ColorInt -import android.support.v4.graphics.drawable.DrawableCompat +import androidx.annotation.ColorInt +import androidx.core.graphics.drawable.DrawableCompat /** * Wrap the color into a state and tint the drawable diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/FragmentUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/FragmentUtils.kt index acc71f2..f99b342 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/FragmentUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/FragmentUtils.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.utils -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import org.jetbrains.anko.bundleOf /** diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt index 51691af..66c56f8 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt @@ -4,7 +4,7 @@ import android.content.Context import android.content.res.ColorStateList import android.graphics.Color import android.graphics.drawable.Drawable -import android.support.annotation.ColorInt +import androidx.annotation.ColorInt import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.typeface.IIcon diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/Kotterknife.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/Kotterknife.kt index 8c7c039..3cbd93d 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/Kotterknife.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/Kotterknife.kt @@ -1,4 +1,4 @@ -@file:Suppress("UNCHECKED_CAST") +@file:Suppress("UNCHECKED_CAST", "DEPRECATION") package ca.allanwang.kau.utils @@ -8,146 +8,118 @@ package ca.allanwang.kau.utils * Courtesy of Jake Wharton * * https://github.com/JakeWharton/kotterknife/blob/master/src/main/kotlin/kotterknife/ButterKnife.kt + * + * Note that while this is useful for binding ids, there also exists other alternatives, such as + * `kotlin-android-extensions`. + * + * For fragments, make sure that the views are reset after the fragment lifecycle. */ import android.app.Activity import android.app.Dialog import android.app.DialogFragment import android.app.Fragment -import android.support.v7.widget.RecyclerView.ViewHolder import android.view.View +import androidx.recyclerview.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView.ViewHolder import java.util.* import kotlin.properties.ReadOnlyProperty import kotlin.reflect.KProperty -import android.support.v4.app.DialogFragment as SupportDialogFragment -import android.support.v4.app.Fragment as SupportFragment +import androidx.fragment.app.DialogFragment as SupportDialogFragment +import androidx.fragment.app.Fragment as SupportFragment -private const val DEPRECATION_MESSAGE = "Kotterknife will be removed in favour of the kotlin_android_extensions plugin" - -@Deprecated(DEPRECATION_MESSAGE) fun View.bindView(id: Int) : ReadOnlyProperty = required(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Activity.bindView(id: Int) : ReadOnlyProperty = required(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Dialog.bindView(id: Int) : ReadOnlyProperty = required(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun DialogFragment.bindView(id: Int) : ReadOnlyProperty = required(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportDialogFragment.bindView(id: Int) - : ReadOnlyProperty = required(id, viewFinder) + : ReadOnlyProperty = required(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Fragment.bindView(id: Int) : ReadOnlyProperty = required(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportFragment.bindView(id: Int) - : ReadOnlyProperty = required(id, viewFinder) + : ReadOnlyProperty = required(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) -fun ViewHolder.bindView(id: Int) - : ReadOnlyProperty = required(id, viewFinder) +fun RecyclerView.ViewHolder.bindView(id: Int) + : ReadOnlyProperty = required(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun View.bindOptionalView(id: Int) : ReadOnlyProperty = optional(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Activity.bindOptionalView(id: Int) : ReadOnlyProperty = optional(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Dialog.bindOptionalView(id: Int) : ReadOnlyProperty = optional(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun DialogFragment.bindOptionalView(id: Int) : ReadOnlyProperty = optional(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportDialogFragment.bindOptionalView(id: Int) - : ReadOnlyProperty = optional(id, viewFinder) + : ReadOnlyProperty = optional(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Fragment.bindOptionalView(id: Int) : ReadOnlyProperty = optional(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportFragment.bindOptionalView(id: Int) - : ReadOnlyProperty = optional(id, viewFinder) + : ReadOnlyProperty = optional(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) -fun ViewHolder.bindOptionalView(id: Int) - : ReadOnlyProperty = optional(id, viewFinder) +fun RecyclerView.ViewHolder.bindOptionalView(id: Int) + : ReadOnlyProperty = optional(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun View.bindViews(vararg ids: Int) : ReadOnlyProperty> = required(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Activity.bindViews(vararg ids: Int) : ReadOnlyProperty> = required(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Dialog.bindViews(vararg ids: Int) : ReadOnlyProperty> = required(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun DialogFragment.bindViews(vararg ids: Int) : ReadOnlyProperty> = required(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportDialogFragment.bindViews(vararg ids: Int) - : ReadOnlyProperty> = required(ids, viewFinder) + : ReadOnlyProperty> = required(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Fragment.bindViews(vararg ids: Int) : ReadOnlyProperty> = required(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportFragment.bindViews(vararg ids: Int) - : ReadOnlyProperty> = required(ids, viewFinder) + : ReadOnlyProperty> = required(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun ViewHolder.bindViews(vararg ids: Int) : ReadOnlyProperty> = required(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun View.bindOptionalViews(vararg ids: Int) : ReadOnlyProperty> = optional(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Activity.bindOptionalViews(vararg ids: Int) : ReadOnlyProperty> = optional(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Dialog.bindOptionalViews(vararg ids: Int) : ReadOnlyProperty> = optional(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun DialogFragment.bindOptionalViews(vararg ids: Int) : ReadOnlyProperty> = optional(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportDialogFragment.bindOptionalViews(vararg ids: Int) - : ReadOnlyProperty> = optional(ids, viewFinder) + : ReadOnlyProperty> = optional(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Fragment.bindOptionalViews(vararg ids: Int) : ReadOnlyProperty> = optional(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportFragment.bindOptionalViews(vararg ids: Int) - : ReadOnlyProperty> = optional(ids, viewFinder) + : ReadOnlyProperty> = optional(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun ViewHolder.bindOptionalViews(vararg ids: Int) : ReadOnlyProperty> = optional(ids, viewFinder) @@ -189,13 +161,13 @@ private fun optional(ids: IntArray, finder: T.(Int) -> View?) = La private open class Lazy(private val initializer: (T, KProperty<*>) -> V) : ReadOnlyProperty { protected object EMPTY - protected var value: Any? = EMPTY +protected var value: Any? = EMPTY - override fun getValue(thisRef: T, property: KProperty<*>): V { +override fun getValue(thisRef: T, property: KProperty<*>): V { if (value == EMPTY) value = initializer(thisRef, property) - return value as V +return value as V } } @@ -209,133 +181,101 @@ private open class Lazy(private val initializer: (T, KProperty<*>) * Credits to MichaelRocks */ -@Deprecated(DEPRECATION_MESSAGE) fun View.bindViewResettable(id: Int) : ReadOnlyProperty = requiredResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Activity.bindViewResettable(id: Int) : ReadOnlyProperty = requiredResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Dialog.bindViewResettable(id: Int) : ReadOnlyProperty = requiredResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun DialogFragment.bindViewResettable(id: Int) : ReadOnlyProperty = requiredResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportDialogFragment.bindViewResettable(id: Int) - : ReadOnlyProperty = requiredResettable(id, viewFinder) + : ReadOnlyProperty = requiredResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Fragment.bindViewResettable(id: Int) : ReadOnlyProperty = requiredResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportFragment.bindViewResettable(id: Int) - : ReadOnlyProperty = requiredResettable(id, viewFinder) + : ReadOnlyProperty = requiredResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun ViewHolder.bindViewResettable(id: Int) : ReadOnlyProperty = requiredResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun View.bindOptionalViewResettable(id: Int) : ReadOnlyProperty = optionalResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Activity.bindOptionalViewResettable(id: Int) : ReadOnlyProperty = optionalResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Dialog.bindOptionalViewResettable(id: Int) : ReadOnlyProperty = optionalResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun DialogFragment.bindOptionalViewResettable(id: Int) : ReadOnlyProperty = optionalResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportDialogFragment.bindOptionalViewResettable(id: Int) - : ReadOnlyProperty = optionalResettable(id, viewFinder) + : ReadOnlyProperty = optionalResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Fragment.bindOptionalViewResettable(id: Int) : ReadOnlyProperty = optionalResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportFragment.bindOptionalViewResettable(id: Int) - : ReadOnlyProperty = optionalResettable(id, viewFinder) + : ReadOnlyProperty = optionalResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun ViewHolder.bindOptionalViewResettable(id: Int) : ReadOnlyProperty = optionalResettable(id, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun View.bindViewsResettable(vararg ids: Int) : ReadOnlyProperty> = requiredResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Activity.bindViewsResettable(vararg ids: Int) : ReadOnlyProperty> = requiredResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Dialog.bindViewsResettable(vararg ids: Int) : ReadOnlyProperty> = requiredResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun DialogFragment.bindViewsResettable(vararg ids: Int) : ReadOnlyProperty> = requiredResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportDialogFragment.bindViewsResettable(vararg ids: Int) - : ReadOnlyProperty> = requiredResettable(ids, viewFinder) + : ReadOnlyProperty> = requiredResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Fragment.bindViewsResettable(vararg ids: Int) : ReadOnlyProperty> = requiredResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportFragment.bindViewsResettable(vararg ids: Int) - : ReadOnlyProperty> = requiredResettable(ids, viewFinder) + : ReadOnlyProperty> = requiredResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun ViewHolder.bindViewsResettable(vararg ids: Int) : ReadOnlyProperty> = requiredResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun View.bindOptionalViewsResettable(vararg ids: Int) : ReadOnlyProperty> = optionalResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Activity.bindOptionalViewsResettable(vararg ids: Int) : ReadOnlyProperty> = optionalResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Dialog.bindOptionalViewsResettable(vararg ids: Int) : ReadOnlyProperty> = optionalResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun DialogFragment.bindOptionalViewsResettable(vararg ids: Int) : ReadOnlyProperty> = optionalResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportDialogFragment.bindOptionalViewsResettable(vararg ids: Int) - : ReadOnlyProperty> = optionalResettable(ids, viewFinder) + : ReadOnlyProperty> = optionalResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun Fragment.bindOptionalViewsResettable(vararg ids: Int) : ReadOnlyProperty> = optionalResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun SupportFragment.bindOptionalViewsResettable(vararg ids: Int) - : ReadOnlyProperty> = optionalResettable(ids, viewFinder) + : ReadOnlyProperty> = optionalResettable(ids, viewFinder) -@Deprecated(DEPRECATION_MESSAGE) fun ViewHolder.bindOptionalViewsResettable(vararg ids: Int) - : ReadOnlyProperty> = optionalResettable(ids, viewFinder) + : ReadOnlyProperty> = optionalResettable(ids, viewFinder) private fun requiredResettable(id: Int, finder: T.(Int) -> View?) = LazyResettable { t: T, desc -> (t.finder(id) as V?)?.apply { } ?: viewNotFound(id, desc) @@ -358,12 +298,11 @@ private class LazyResettable(initializer: (T, KProperty<*>) -> V) : return super.getValue(thisRef, property) } - fun reset() { +fun reset() { value = EMPTY } } -@Deprecated(DEPRECATION_MESSAGE) object Kotterknife { fun reset(target: Any) { KotterknifeRegistry.reset(target) @@ -373,7 +312,7 @@ object Kotterknife { private object KotterknifeRegistry { private val lazyMap = WeakHashMap>>() - fun register(target: Any, lazy: LazyResettable<*, *>) = lazyMap.getOrPut(target, { Collections.newSetFromMap(WeakHashMap()) }).add(lazy) +fun register(target: Any, lazy: LazyResettable<*, *>) = lazyMap.getOrPut(target, { Collections.newSetFromMap(WeakHashMap()) }).add(lazy) - fun reset(target: Any) = lazyMap[target]?.forEach(LazyResettable<*, *>::reset) +fun reset(target: Any) = lazyMap[target]?.forEach(LazyResettable<*, *>::reset) } \ No newline at end of file diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/NotificationUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/NotificationUtils.kt index 1eb0076..016f3d2 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/NotificationUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/NotificationUtils.kt @@ -1,7 +1,7 @@ package ca.allanwang.kau.utils import android.content.Context -import android.support.v4.app.NotificationManagerCompat +import androidx.core.app.NotificationManagerCompat /** diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/RecyclerUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/RecyclerUtils.kt index 3a34db5..1c336f9 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/RecyclerUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/RecyclerUtils.kt @@ -1,8 +1,8 @@ package ca.allanwang.kau.utils import android.graphics.Rect -import android.support.v7.widget.RecyclerView import android.view.View +import androidx.recyclerview.widget.RecyclerView /** * Created by Allan Wang on 2017-07-11. diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/TransitionUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/TransitionUtils.kt index ec206ee..1d12fd3 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/TransitionUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/TransitionUtils.kt @@ -1,14 +1,14 @@ package ca.allanwang.kau.utils import android.os.Build -import android.support.annotation.RequiresApi -import android.support.annotation.TransitionRes -import android.support.transition.AutoTransition -import android.support.transition.TransitionInflater -import android.support.transition.TransitionManager +import androidx.annotation.RequiresApi +import androidx.annotation.TransitionRes +import androidx.transition.AutoTransition +import androidx.transition.TransitionInflater +import androidx.transition.TransitionManager import android.transition.Transition import android.view.ViewGroup -import android.support.transition.Transition as SupportTransition +import androidx.transition.Transition as SupportTransition /** * Created by Allan Wang on 2017-06-24. @@ -52,7 +52,7 @@ fun ViewGroup.transitionAuto(builder: AutoTransition.() -> Unit = {}) { } @KauUtils -fun ViewGroup.transitionDelayed(@TransitionRes id: Int, builder: android.support.transition.Transition.() -> Unit = {}) { +fun ViewGroup.transitionDelayed(@TransitionRes id: Int, builder: androidx.transition.Transition.() -> Unit = {}) { if (!buildIsLollipopAndUp) return val transition = TransitionInflater.from(context).inflateTransition(id) transition.builder() diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt index 46e29b2..c8d5d2a 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt @@ -8,7 +8,7 @@ import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import android.os.Handler import android.os.Looper -import android.support.annotation.IntRange +import androidx.annotation.IntRange import ca.allanwang.kau.R import java.math.RoundingMode import java.text.DecimalFormat diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt index 4e020bc..956df48 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt @@ -7,15 +7,10 @@ import android.annotation.SuppressLint import android.content.Context import android.graphics.Color import android.os.Build -import android.support.annotation.ColorInt -import android.support.annotation.ColorRes -import android.support.annotation.RequiresApi -import android.support.annotation.StringRes -import android.support.design.widget.FloatingActionButton -import android.support.design.widget.Snackbar -import android.support.design.widget.TextInputEditText -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView +import androidx.annotation.ColorInt +import androidx.annotation.ColorRes +import androidx.annotation.RequiresApi +import androidx.annotation.StringRes import android.view.LayoutInflater import android.view.MotionEvent import android.view.View @@ -23,7 +18,12 @@ import android.view.ViewGroup import android.view.inputmethod.InputMethodManager import android.widget.EditText import android.widget.ImageView +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import ca.allanwang.kau.ui.createSimpleRippleDrawable +import com.google.android.material.floatingactionbutton.FloatingActionButton +import com.google.android.material.snackbar.Snackbar +import com.google.android.material.textfield.TextInputEditText import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.typeface.IIcon @@ -291,7 +291,7 @@ fun FloatingActionButton.hideOnDownwardsScroll(recycler: RecyclerView) { recycler.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) { - if (newState == android.support.v7.widget.RecyclerView.SCROLL_STATE_IDLE && !isShown) show() + if (newState == RecyclerView.SCROLL_STATE_IDLE && !isShown) show() } override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { diff --git a/core/src/main/kotlin/ca/allanwang/kau/xml/Changelog.kt b/core/src/main/kotlin/ca/allanwang/kau/xml/Changelog.kt index 28d51a4..3955a77 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/xml/Changelog.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/xml/Changelog.kt @@ -2,14 +2,14 @@ package ca.allanwang.kau.xml import android.content.Context import android.content.res.XmlResourceParser -import android.support.annotation.ColorInt -import android.support.annotation.LayoutRes -import android.support.annotation.XmlRes -import android.support.v7.widget.RecyclerView +import androidx.annotation.ColorInt +import androidx.annotation.LayoutRes +import androidx.annotation.XmlRes import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView import ca.allanwang.kau.R import ca.allanwang.kau.utils.materialDialog import ca.allanwang.kau.utils.use diff --git a/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt b/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt index 7caf5d6..bbe9425 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.xml import android.content.Context import android.content.res.XmlResourceParser -import android.support.annotation.XmlRes +import androidx.annotation.XmlRes import android.text.Html import android.text.Spanned import ca.allanwang.kau.utils.use diff --git a/docs/Changelog.md b/docs/Changelog.md index a5f24f4..704e9c3 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,8 @@ # Changelog +## v4.0.0-alpha01 +* Migrated to androidx. See migration for external dependency changes. + ## v3.8.0 * Update everything to Android Studio 3.1 * Fix new lint issues (see Migration for resource related methods) diff --git a/docs/Migration.md b/docs/Migration.md index ff89f87..8c5e016 100644 --- a/docs/Migration.md +++ b/docs/Migration.md @@ -2,6 +2,15 @@ Below are some highlights on major refactoring/breaking changes +# v4.0.0-alpha01 + +This is the first introduction of androidx. The goal is to just do a migration with minimal changes. +Nothing has been changed internally, but the dependencies are updated. +Notably, Android-Iconics [split their Community Icons](https://github.com/mikepenz/Android-Iconics/blob/develop/MIGRATION.md) into two enums. + +Kotterknife is also no longer deprecated. There are some use cases where `kotlin-android-extensions` isn't the best, such as when multiple layout files are used, or when ids are defined in the id.xml. +It is still recommended to use the extension where applicable. + # v3.8.0 Along with the update to support Android Studio 3.1, a lot of changes have occurred with other dependencies and with lint. diff --git a/gradle.properties b/gradle.properties index f1c49f3..1e0c1d3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,8 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt index b9681e9..132c27a 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt @@ -2,8 +2,8 @@ package ca.allanwang.kau.kpref.activity import android.annotation.SuppressLint import android.os.Bundle -import android.support.annotation.StringRes -import android.support.v7.widget.Toolbar +import androidx.annotation.StringRes +import androidx.appcompat.widget.Toolbar import android.view.View import ca.allanwang.kau.animators.KauAnimator import ca.allanwang.kau.animators.SlideAnimatorAdd diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt index 2cdeae2..4b50ee4 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.kpref.activity -import android.support.annotation.StringRes +import androidx.annotation.StringRes import ca.allanwang.kau.kpref.activity.items.* /** diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt index f391747..0a7922e 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.kpref.activity.items -import android.support.v7.widget.AppCompatCheckBox +import androidx.appcompat.widget.AppCompatCheckBox import android.widget.CheckBox import ca.allanwang.kau.kpref.activity.KClick import ca.allanwang.kau.kpref.activity.R diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt index 5081f50..aa60fcd 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemBase.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.kpref.activity.items -import android.support.annotation.CallSuper +import androidx.annotation.CallSuper import android.view.View import ca.allanwang.kau.kpref.activity.GlobalOptions import ca.allanwang.kau.kpref.activity.KClick diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt index fcc13ba..4e8ecbe 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefItemCore.kt @@ -1,11 +1,11 @@ package ca.allanwang.kau.kpref.activity.items import android.annotation.SuppressLint -import android.support.annotation.CallSuper -import android.support.annotation.IdRes -import android.support.annotation.LayoutRes -import android.support.annotation.StringRes -import android.support.v7.widget.RecyclerView +import androidx.annotation.CallSuper +import androidx.annotation.IdRes +import androidx.annotation.LayoutRes +import androidx.annotation.StringRes +import androidx.recyclerview.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/kpref-activity/src/main/res/layout/kau_pref_activity.xml b/kpref-activity/src/main/res/layout/kau_pref_activity.xml index 7651e5a..d6ea6e6 100644 --- a/kpref-activity/src/main/res/layout/kau_pref_activity.xml +++ b/kpref-activity/src/main/res/layout/kau_pref_activity.xml @@ -1,5 +1,5 @@ - @@ -13,7 +13,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - - + diff --git a/kpref-activity/src/main/res/layout/kau_pref_checkbox.xml b/kpref-activity/src/main/res/layout/kau_pref_checkbox.xml index 1fecb4d..6c52b52 100644 --- a/kpref-activity/src/main/res/layout/kau_pref_checkbox.xml +++ b/kpref-activity/src/main/res/layout/kau_pref_checkbox.xml @@ -1,4 +1,4 @@ - - - - - - - + \ No newline at end of file diff --git a/kpref-activity/src/main/res/layout/kau_pref_header.xml b/kpref-activity/src/main/res/layout/kau_pref_header.xml index d802a14..65504a3 100644 --- a/kpref-activity/src/main/res/layout/kau_pref_header.xml +++ b/kpref-activity/src/main/res/layout/kau_pref_header.xml @@ -1,4 +1,4 @@ - ->( f = File(tempPath) tempPath = null } else if (data?.data != null) { - f = File(data.data.path) + f = File(data.data!!.path) } else { KL.d { "Media camera no file found" } return @@ -291,8 +291,8 @@ abstract class MediaPickerCore>( private fun onPickerResult(data: Intent?) { val items = mutableListOf() if (data?.data != null) { - KL.v { "Media picker data uri: ${data.data.path}" } - items.add(data.data) + KL.v { "Media picker data uri: ${data.data!!.path}" } + items.add(data.data!!) } else if (data != null) { val clip = data.clipData if (clip != null) { diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt index f37be75..1976172 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaUtils.kt @@ -6,7 +6,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Environment -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import ca.allanwang.kau.utils.buildIsLollipopAndUp import java.io.File import java.io.IOException diff --git a/mediapicker/src/main/res/layout-v21/kau_activity_image_picker_overlay.xml b/mediapicker/src/main/res/layout-v21/kau_activity_image_picker_overlay.xml index a0ce301..d7447b0 100644 --- a/mediapicker/src/main/res/layout-v21/kau_activity_image_picker_overlay.xml +++ b/mediapicker/src/main/res/layout-v21/kau_activity_image_picker_overlay.xml @@ -7,7 +7,7 @@ app:dragDismissDistance="@dimen/kau_drag_dismiss_distance_large" app:dragDismissScale="0.95"> - - - - - + - + - - - \ No newline at end of file + \ No newline at end of file diff --git a/sample/build.gradle b/sample/build.gradle index d7199a3..e9e5a2e 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -27,7 +27,7 @@ android { versionName androidGitVersion.name() versionCode androidGitVersion.code() multiDexEnabled true - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } def releaseSigning = file("../files/kau.properties") @@ -101,6 +101,18 @@ android { } } } + + // See https://github.com/facebook/flipper/issues/146 + configurations.all { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + def requested = details.requested + if (requested.group == "com.android.support") { + if (!requested.name.startsWith("multidex")) { + details.useVersion "26.+" + } + } + } + } } dependencies { @@ -113,17 +125,13 @@ dependencies { implementation project(':searchview') implementation project(':mediapicker') -// androidTestImplementation("com.android.support.test.espresso:espresso-core:${kau.espresso}") { -// exclude group: 'com.android.support', module: 'support-annotations' -// } -// androidTestImplementation("com.android.support.test:runner:${kau.testRunner}") { -// exclude group: 'com.android.support', module: 'support-annotations' -// } -// androidTestImplementation kauDependency.kotlinTest testImplementation kauDependency.kotlinTest testImplementation kauDependency.junit androidTestImplementation kauDependency.kotlinTest androidTestImplementation kauDependency.espresso + androidTestImplementation "androidx.test.espresso:espresso-intents:${kau.espresso}" + androidTestImplementation "androidx.test.espresso:espresso-contrib:${kau.espresso}" + androidTestImplementation kauDependency.testRules androidTestImplementation kauDependency.testRunner } diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/ColorPickerTest.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/ColorPickerTest.kt index 39aee93..3b7f932 100644 --- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/ColorPickerTest.kt +++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/ColorPickerTest.kt @@ -1,16 +1,16 @@ package ca.allanwang.kau.sample -import android.support.test.espresso.DataInteraction -import android.support.test.espresso.Espresso.onData -import android.support.test.espresso.Espresso.onView -import android.support.test.espresso.ViewAssertion -import android.support.test.espresso.action.ViewActions.click -import android.support.test.espresso.matcher.ViewMatchers.withId -import android.support.test.espresso.matcher.ViewMatchers.withText -import android.support.test.filters.MediumTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 +import androidx.test.espresso.DataInteraction +import androidx.test.espresso.Espresso.onData +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.ViewAssertion +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.matcher.ViewMatchers.withText +import androidx.test.filters.MediumTest +import androidx.test.rule.ActivityTestRule import android.view.View +import androidx.test.ext.junit.runners.AndroidJUnit4 import ca.allanwang.kau.colorpicker.CircleView import org.hamcrest.Matchers.anything import org.junit.Rule @@ -22,6 +22,8 @@ import kotlin.test.fail /** * Created by Allan Wang on 22/02/2018. + * + * Tests related to the :colorpicker module */ @RunWith(AndroidJUnit4::class) @MediumTest @@ -43,7 +45,7 @@ class ColorPickerTest { private val colorNotSelected = ViewAssertion { view, _ -> view.colorSelected(false) } @Test - fun test() { + fun colorClick() { onView(withText(R.string.accent_color)).perform(click()) val colors = onData(anything()).inAdapterView(withId(R.id.md_grid)) diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt new file mode 100644 index 0000000..31dfcb3 --- /dev/null +++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt @@ -0,0 +1,112 @@ +package ca.allanwang.kau.sample + +import android.view.View +import android.widget.CheckBox +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.ViewInteraction +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.BoundedMatcher +import androidx.test.espresso.matcher.ViewMatchers.withChild +import androidx.test.espresso.matcher.ViewMatchers.withText +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.MediumTest +import androidx.test.rule.ActivityTestRule +import org.hamcrest.BaseMatcher +import org.hamcrest.Description +import org.hamcrest.Matcher +import org.hamcrest.Matchers.allOf +import org.hamcrest.Matchers.instanceOf +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith + + +/** + * Created by Allan Wang on 21/12/2018. + * + * Tests related to the :kpref-activity module + */ +@RunWith(AndroidJUnit4::class) +@MediumTest +class KPrefViewTest { + + @get:Rule + val activity: ActivityTestRule = ActivityTestRule(MainActivity::class.java) + + fun verifyCheck(checked: Boolean): Matcher { + return object : BoundedMatcher(View::class.java) { + + + override fun describeTo(description: Description) { + description.appendText("Checkbox is ${if (checked) "checked" else "not checked"}") + } + + override fun matchesSafely(item: View): Boolean = item.findViewById(R.id.kau_pref_inner_content).isChecked == checked + } + } + + inline fun ViewInteraction.checkInnerContent(desc: String, crossinline matcher: (T) -> Boolean): ViewInteraction { + val viewMatcher = object : BaseMatcher() { + override fun describeTo(description: Description) { + description.appendText(desc) + } + + override fun matches(item: Any?): Boolean { + val view = item as? View ?: return false + val inner = view.findViewById(R.id.kau_pref_inner_content) as? T + ?: return false + return matcher(inner) + } + } + return check(matches(viewMatcher)) + } + + fun ViewInteraction.verifyCheck(tag: String, checked: Boolean, enabled: Boolean = true) = + checkInnerContent("$tag should be ${if (checked) "checked" else "not checked"}") { + it.isChecked == checked + }.check { view, _ -> + ((view.alpha == 1f) == enabled) + } + + fun onCheckboxView(vararg matchers: Matcher) = + onView(allOf(*matchers, withChild(withChild(instanceOf(CheckBox::class.java))))) + + @Test + fun basicCheckboxToggle() { + val checkbox1 = onCheckboxView(withChild(withText(R.string.checkbox_1))) + + val initiallyChecked = KPrefSample.check1 + + checkbox1.verifyCheck("checkbox1 init", initiallyChecked) + checkbox1.perform(click()) + checkbox1.verifyCheck("checkbox1 after click", !initiallyChecked) + } + + /** + * Note that checkbox3 depends on checkbox2 + */ + @Test + fun dependentCheckboxToggle() { + val checkbox2 = onCheckboxView(withChild(withText(R.string.checkbox_2))) + val checkbox3 = onCheckboxView(withChild(withText(R.string.checkbox_3)), withChild(withText(R.string.desc_dependent))) + + // normalize so that both are checked + if (!KPrefSample.check2) + checkbox2.perform(click()) + if (!KPrefSample.check3) + checkbox3.perform(click()) + + checkbox3.verifyCheck("checkbox3 init", true, true) + checkbox3.perform(click()) + checkbox3.verifyCheck("checkbox3 after click", false, true) + + checkbox2.perform(click()) + checkbox2.verifyCheck("checkbox2 after click", false, true) + checkbox3.verifyCheck("checkbox3 after checkbox2 click", false, false) + + checkbox3.perform(click()) + checkbox3.verifyCheck("checkbox3 after disabled click", false, false) + } + +} diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/utils/EspressoUtils.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/utils/EspressoUtils.kt new file mode 100644 index 0000000..2acdc4d --- /dev/null +++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/utils/EspressoUtils.kt @@ -0,0 +1,22 @@ +package ca.allanwang.kau.sample.utils + +import org.hamcrest.BaseMatcher +import org.hamcrest.Description +import org.hamcrest.Matcher + +fun index(index: Int, matcher: Matcher): Matcher = + object : BaseMatcher() { + + var current = 0 + + override fun describeTo(description: Description) { + description.appendText("Should return item at index $index") + } + + override fun matches(item: Any?): Boolean { + println("AA") + return matcher.matches(item) && current++ == index + } + } + +fun first(matcher: Matcher): Matcher = index(0, matcher) diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index d8bbe51..5846c6b 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -49,7 +49,7 @@ android:theme="@style/Kau.Translucent.SlideBottom" /> diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt index 42de62c..820d22f 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt @@ -2,7 +2,7 @@ package ca.allanwang.kau.sample import android.content.Context import android.net.Uri -import android.support.v4.content.FileProvider +import androidx.core.content.FileProvider import ca.allanwang.kau.mediapicker.* import java.io.File diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt index beb1a29..09401cd 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt @@ -1,6 +1,6 @@ package ca.allanwang.kau.sample -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import android.widget.CheckBox import android.widget.TextView diff --git a/sample/src/main/res/layout/activity_swipe.xml b/sample/src/main/res/layout/activity_swipe.xml index c65bebc..dd52325 100644 --- a/sample/src/main/res/layout/activity_swipe.xml +++ b/sample/src/main/res/layout/activity_swipe.xml @@ -1,5 +1,5 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml index f6ec799..6c0fea1 100644 --- a/sample/src/main/res/xml/kau_changelog.xml +++ b/sample/src/main/res/xml/kau_changelog.xml @@ -6,6 +6,10 @@ --> + + + + @@ -13,7 +17,6 @@ - diff --git a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchItem.kt b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchItem.kt index 0ae856a..86ed83d 100644 --- a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchItem.kt +++ b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchItem.kt @@ -2,14 +2,14 @@ package ca.allanwang.kau.searchview import android.graphics.Typeface import android.graphics.drawable.Drawable -import android.support.constraint.ConstraintLayout -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.text.Spannable import android.text.SpannableStringBuilder import android.text.style.StyleSpan import android.view.View import android.widget.ImageView import android.widget.TextView +import androidx.constraintlayout.widget.ConstraintLayout import ca.allanwang.kau.iitems.KauIItem import ca.allanwang.kau.utils.* import com.mikepenz.google_material_typeface_library.GoogleMaterial diff --git a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt index d223ec4..fecf6c5 100644 --- a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt +++ b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt @@ -4,12 +4,12 @@ import android.app.Activity import android.content.Context import android.content.res.ColorStateList import android.graphics.Color -import android.support.annotation.ColorInt -import android.support.annotation.IdRes -import android.support.transition.ChangeBounds -import android.support.transition.TransitionManager -import android.support.transition.TransitionSet -import android.support.v7.widget.RecyclerView +import androidx.annotation.ColorInt +import androidx.annotation.IdRes +import androidx.transition.ChangeBounds +import androidx.transition.TransitionManager +import androidx.transition.TransitionSet +import androidx.recyclerview.widget.RecyclerView import android.text.Editable import android.text.TextWatcher import android.util.AttributeSet diff --git a/searchview/src/main/res/layout/kau_search_iitem.xml b/searchview/src/main/res/layout/kau_search_iitem.xml index 16df945..53e33ef 100644 --- a/searchview/src/main/res/layout/kau_search_iitem.xml +++ b/searchview/src/main/res/layout/kau_search_iitem.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/searchview/src/main/res/layout/kau_search_view.xml b/searchview/src/main/res/layout/kau_search_view.xml index c975dad..cfcb2ed 100644 --- a/searchview/src/main/res/layout/kau_search_view.xml +++ b/searchview/src/main/res/layout/kau_search_view.xml @@ -43,7 +43,7 @@ android:focusable="true" android:scaleType="centerInside" /> - - Date: Mon, 24 Dec 2018 20:05:06 -0500 Subject: Enhancement/coroutines (#180) * Add coroutine dependency * Add coroutines to kprefactivity * Change base job to supervisor * Update coroutines for faq * Update changelog * Use preloading in media picker core * Make test logging internal * Remove anko --- README.md | 3 +- .../ca/allanwang/kau/about/AboutPanelDelegate.kt | 24 +++-- .../main/groovy/ca/allanwang/kau/Versions.groovy | 6 +- core/README.md | 4 +- core/build.gradle | 4 +- .../ca/allanwang/kau/internal/KauBaseActivity.kt | 30 +++++- .../src/main/kotlin/ca/allanwang/kau/kotlin/Zip.kt | 105 --------------------- .../src/main/kotlin/ca/allanwang/kau/logging/KL.kt | 7 +- .../kotlin/ca/allanwang/kau/utils/ActivityUtils.kt | 13 ++- .../kotlin/ca/allanwang/kau/utils/BundleUtils.kt | 55 ++++++++++- .../kotlin/ca/allanwang/kau/utils/ContextUtils.kt | 27 +++++- .../kotlin/ca/allanwang/kau/utils/FragmentUtils.kt | 3 +- .../main/kotlin/ca/allanwang/kau/xml/Changelog.kt | 21 ++--- core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt | 71 +++++++------- .../test/kotlin/ca/allanwang/kau/kotlin/ZipTest.kt | 83 ---------------- docs/Changelog.md | 6 ++ docs/Migration.md | 13 +++ .../allanwang/kau/kpref/activity/KPrefActivity.kt | 31 +++--- .../allanwang/kau/mediapicker/MediaPickerCore.kt | 33 ++----- sample/src/main/res/xml/kau_changelog.xml | 10 ++ .../ca/allanwang/kau/searchview/SearchView.kt | 2 +- 21 files changed, 250 insertions(+), 301 deletions(-) delete mode 100644 core/src/main/kotlin/ca/allanwang/kau/kotlin/Zip.kt delete mode 100644 core/src/test/kotlin/ca/allanwang/kau/kotlin/ZipTest.kt (limited to 'README.md') diff --git a/README.md b/README.md index 4143ca8..6fe7590 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,9 @@ This means that you'll need to explicitly include each submodule you'd like to u * [Extension Functions](core#extension-functions) * [Lazy Resettable](core#lazy-resettable) * Includes -[`AppCompat`](https://developer.android.com/topic/libraries/support-library/index.html), +[`AndroidX Components`](https://developer.android.com/topic/libraries/support-library/index.html), [`Material Dialogs (core)`](https://github.com/afollestad/material-dialogs), [`Iconics`](https://github.com/mikepenz/Android-Iconics), -[`Anko`](https://github.com/Kotlin/anko), [`Kotlin stdlib`](https://kotlinlang.org/api/latest/jvm/stdlib/) ## [Core UI](core-ui#readme) diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt index 35c1322..f77bcf2 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt @@ -35,8 +35,9 @@ import ca.allanwang.kau.utils.withMarginDecoration import ca.allanwang.kau.xml.kauParseFaq import com.mikepenz.aboutlibraries.Libs import com.mikepenz.fastadapter.IItem -import org.jetbrains.anko.doAsync -import org.jetbrains.anko.uiThread +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.async +import kotlinx.coroutines.launch /** * Created by Allan Wang on 2017-08-02. @@ -174,13 +175,16 @@ open class AboutPanelLibs : AboutPanelRecycler() { } override fun loadItems(activity: AboutActivityBase, position: Int) { - doAsync { - with(activity) { - items = - getLibraries(if (rClass == null) Libs(activity) else Libs(this, Libs.toStringArray(rClass.fields))) - .map(::LibraryIItem) + with(activity) { + launch { + items = async { + getLibraries( + if (rClass == null) Libs(activity) + else Libs(activity, Libs.toStringArray(rClass.fields)) + ).map(::LibraryIItem) + }.await() if (pageStatus[position] == 1) - uiThread { addItems(activity, position) } + addItems(activity, position) } } } @@ -202,8 +206,8 @@ open class AboutPanelFaqs : AboutPanelRecycler() { override fun loadItems(activity: AboutActivityBase, position: Int) { with(activity) { - kauParseFaq(configs.faqXmlRes, configs.faqParseNewLine) { - items = it.map(::FaqIItem) + launch { + items = async { kauParseFaq(configs.faqXmlRes, configs.faqParseNewLine) }.await().map(::FaqIItem) if (pageStatus[position] == 1) addItems(activity, position) } diff --git a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy index a85fe97..e6f3cd7 100644 --- a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy +++ b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy @@ -26,12 +26,12 @@ class Versions { // https://kotlinlang.org/docs/reference/using-gradle.html static def kotlin = '1.3.11' + // https://github.com/Kotlin/kotlinx.coroutines/releases + static def coroutines = '1.0.1' + // https://github.com/mikepenz/AboutLibraries/releases static def aboutLibraries = '6.2.0' - // https://github.com/Kotlin/anko/releases - static def anko = '0.10.5' - // https://github.com/wasabeef/Blurry/releases static def blurry = '2.1.1' diff --git a/core/README.md b/core/README.md index 39899dd..b9a10f5 100644 --- a/core/README.md +++ b/core/README.md @@ -131,6 +131,9 @@ These variants are weakly held in the private `KotterknifeRegistry` object, and values through the `Kotterknife.reset` method. This is typically useful for Fragments, as they do not follow the same lifecycle as Activities and Views. +Note that this is useful for views that have ids in multiple layout files or in `id.xml` files. +Kotlin has another solution, [`kotlin-android-extensions`](https://kotlinlang.org/docs/tutorials/android-plugin.html), which is more convenient. + ## Ripple Canvas Ripple canvas provides a way to create simultaneous ripples against a background color. @@ -210,7 +213,6 @@ Include your email and subject, along with other optional configurations such as ## Extension Functions > "[Extensions](https://kotlinlang.org/docs/reference/extensions.html) provide the ability to extend a class with new functionality without having to inherit from the class" -
Note that since KAU depends on [ANKO](https://github.com/Kotlin/anko), all of the extensions in its core package is also in KAU. KAU's vast collection of extensions is one of its strongest features. There are too many to explain here, but you may check out the [utils package](https://github.com/AllanWang/KAU/tree/master/core/src/main/kotlin/ca/allanwang/kau/utils) diff --git a/core/build.gradle b/core/build.gradle index a57ee6e..3ac4f36 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -11,12 +11,12 @@ dependencies { api "androidx.constraintlayout:constraintlayout:${kau.constraintLayout}" api "com.google.android.material:material:${kau.googleMaterial}" + api "org.jetbrains.kotlinx:kotlinx-coroutines-android:${kau.coroutines}" + api "com.mikepenz:iconics-core:${kau.iconics}@aar" api "com.mikepenz:google-material-typeface:${kau.iconicsGoogle}.original@aar" api "com.afollestad.material-dialogs:core:${kau.materialDialog}" - - api "org.jetbrains.anko:anko-commons:${kau.anko}" } apply from: '../artifacts.gradle' diff --git a/core/src/main/kotlin/ca/allanwang/kau/internal/KauBaseActivity.kt b/core/src/main/kotlin/ca/allanwang/kau/internal/KauBaseActivity.kt index 85e711b..bf977f2 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/internal/KauBaseActivity.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/internal/KauBaseActivity.kt @@ -15,8 +15,14 @@ */ package ca.allanwang.kau.internal +import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import ca.allanwang.kau.permissions.kauOnRequestPermissionsResult +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.SupervisorJob +import kotlin.coroutines.CoroutineContext /** * Created by Allan Wang on 2017-08-01. @@ -26,11 +32,31 @@ import ca.allanwang.kau.permissions.kauOnRequestPermissionsResult * Ensures that some singleton methods are called. * This is simply a convenience class; * you can always copy and paste this to your own class. + * + * This also implements [CoroutineScope] that adheres to the activity lifecycle. + * Note that by default, [SupervisorJob] is used, to avoid exceptions in one child from affecting that of another. + * The default job can be overridden within [defaultJob] */ -abstract class KauBaseActivity : AppCompatActivity() { +abstract class KauBaseActivity : AppCompatActivity(), CoroutineScope { + + open lateinit var job: Job + override val coroutineContext: CoroutineContext + get() = Dispatchers.Main + job + + open fun defaultJob(): Job = SupervisorJob() + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + job = defaultJob() + } + + override fun onDestroy() { + job.cancel() + super.onDestroy() + } override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { super.onRequestPermissionsResult(requestCode, permissions, grantResults) kauOnRequestPermissionsResult(permissions, grantResults) } -} +} \ No newline at end of file diff --git a/core/src/main/kotlin/ca/allanwang/kau/kotlin/Zip.kt b/core/src/main/kotlin/ca/allanwang/kau/kotlin/Zip.kt deleted file mode 100644 index b767b30..0000000 --- a/core/src/main/kotlin/ca/allanwang/kau/kotlin/Zip.kt +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2018 Allan Wang - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ca.allanwang.kau.kotlin - -import org.jetbrains.anko.doAsync -import java.util.concurrent.atomic.AtomicInteger - -/** - * Created by Allan Wang on 2017-08-06. - * - * Collection of zip methods that aim to replicate - * Reactive Zips - * For unit returning functions - * - * Typically, the functions will execute asynchronously and call their given callbacks when finished. - * Once all callbacks are called, the final onFinish callback will be executed. - * - * There is also a helper zipper to wrap synchronous functions with Anko's doAsync to achieve the same results - * - * Note that not wrapping synchronous functions will render these methods useless, - * as you can simply define an inline callback after all functions are finished - */ - -/** - * Callback which will only execute the first time - */ -open class ZipCallbackBase { - var completed: Boolean = false - - inline operator fun invoke(callback: () -> Unit) { - if (completed) return - completed = true - callback() - } -} - -class ZipCallback(val onReceived: (T) -> Unit) : ZipCallbackBase() { - operator fun invoke(result: T) = invoke { onReceived(result) } -} - -class ZipEmptyCallback(val onReceived: () -> Unit) : ZipCallbackBase() { - operator fun invoke() = invoke(onReceived) -} - -/** - * Given a default result, a series of tasks, and a finished callback, - * this method will run all tasks and wait until all tasks emit a response - * The response will then be sent back to the callback - * - * ALl tasks must invoke the task callback for [onFinished] to execute - */ -inline fun Collection<(ZipCallback) -> Unit>.zip( - defaultResult: T, - crossinline onFinished: (results: Array) -> Unit -) { - val result = Array(size) { defaultResult } - val countDown = AtomicInteger(size) - forEachIndexed { index, asyncFun -> - asyncFun(ZipCallback { - result[index] = it - if (countDown.decrementAndGet() <= 0) - onFinished(result) - }) - } -} - -/** - * Simplified zip method with no finished callback arguments - */ -inline fun Collection<(ZipEmptyCallback) -> Unit>.zip(crossinline onFinished: () -> Unit) { - val countDown = AtomicInteger(size) - forEach { asyncFun -> - asyncFun(ZipEmptyCallback { - if (countDown.decrementAndGet() <= 0) - onFinished() - }) - } -} - -/** - * Converts a collection of synchronous tasks to asynchronous tasks with a common callback - */ -inline fun Collection<() -> Unit>.zipAsync(crossinline onFinished: () -> Unit) { - map { synchronousFun -> - { callback: ZipEmptyCallback -> - doAsync { - synchronousFun() - callback() - }; Unit - } - }.zip(onFinished) -} diff --git a/core/src/main/kotlin/ca/allanwang/kau/logging/KL.kt b/core/src/main/kotlin/ca/allanwang/kau/logging/KL.kt index f92edb3..52e5415 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/logging/KL.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/logging/KL.kt @@ -22,4 +22,9 @@ import ca.allanwang.kau.BuildConfig * * Internal KAU logger */ -object KL : KauLogger("KAU", { BuildConfig.DEBUG }) +object KL : KauLogger("KAU", { BuildConfig.DEBUG }) { + internal inline fun test(message: () -> Any?) { + if (BuildConfig.DEBUG) + d { "Test1234 ${message()}" } + } +} diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt index a655e5b..3dd4bb9 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt @@ -28,13 +28,13 @@ import android.os.Build import android.os.Bundle import android.view.Menu import android.view.View +import android.view.ViewGroup import androidx.annotation.ColorInt import androidx.annotation.RequiresApi import androidx.annotation.StringRes import ca.allanwang.kau.R import com.google.android.material.snackbar.Snackbar import com.mikepenz.iconics.typeface.IIcon -import org.jetbrains.anko.contentView /** * Created by Allan Wang on 2017-06-21. @@ -160,6 +160,17 @@ inline fun Activity.showKeyboard() { currentFocus?.showKeyboard() } +/** + * Gets the view set by [Activity.setContentView] if it exists. + * + * Taken courtesy of Anko + * + * Previously, Anko was a dependency in KAU, but has been removed on 12/24/2018 + * as most of the methods weren't used + */ +inline val Activity.contentView: View? + get() = (findViewById(android.R.id.content) as? ViewGroup)?.getChildAt(0) + inline fun Activity.snackbar( text: String, duration: Int = Snackbar.LENGTH_LONG, diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt index 314ca60..5b4b188 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/BundleUtils.kt @@ -20,10 +20,12 @@ import android.app.Activity import android.app.ActivityOptions import android.content.Context import android.os.Bundle +import android.os.Parcelable import android.util.Pair import android.view.View import androidx.annotation.AnimRes import ca.allanwang.kau.R +import java.io.Serializable /** * Created by Allan Wang on 10/12/17. @@ -36,6 +38,56 @@ infix fun Bundle.with(bundle: Bundle?): Bundle { return this } +/** + * Saves all bundle args based on their respective types. + * + * Taken courtesy of Anko + * + * Previously, Anko was a dependency in KAU, but has been removed on 12/24/2018 + * as most of the methods weren't used + */ +fun bundleOf(vararg params: kotlin.Pair): Bundle { + val b = Bundle() + for (p in params) { + val (k, v) = p + when (v) { + null -> b.putSerializable(k, null) + is Boolean -> b.putBoolean(k, v) + is Byte -> b.putByte(k, v) + is Char -> b.putChar(k, v) + is Short -> b.putShort(k, v) + is Int -> b.putInt(k, v) + is Long -> b.putLong(k, v) + is Float -> b.putFloat(k, v) + is Double -> b.putDouble(k, v) + is String -> b.putString(k, v) + is CharSequence -> b.putCharSequence(k, v) + is Parcelable -> b.putParcelable(k, v) + is Serializable -> b.putSerializable(k, v) + is BooleanArray -> b.putBooleanArray(k, v) + is ByteArray -> b.putByteArray(k, v) + is CharArray -> b.putCharArray(k, v) + is DoubleArray -> b.putDoubleArray(k, v) + is FloatArray -> b.putFloatArray(k, v) + is IntArray -> b.putIntArray(k, v) + is LongArray -> b.putLongArray(k, v) + is Array<*> -> { + @Suppress("UNCHECKED_CAST") + when { + v.isArrayOf() -> b.putParcelableArray(k, v as Array) + v.isArrayOf() -> b.putCharSequenceArray(k, v as Array) + v.isArrayOf() -> b.putStringArray(k, v as Array) + else -> throw KauException("Unsupported bundle component (${v.javaClass})") + } + } + is ShortArray -> b.putShortArray(k, v) + is Bundle -> b.putBundle(k, v) + else -> throw KauException("Unsupported bundle component (${v.javaClass})") + } + } + return b +} + /** * Adds transition bundle if context is activity and build is lollipop+ */ @@ -62,7 +114,8 @@ fun Bundle.withSceneTransitionAnimation(parent: View, data: Map) = @SuppressLint("NewApi") fun Bundle.withSceneTransitionAnimation(context: Context, data: Map) { if (context !is Activity || !buildIsLollipopAndUp) return - val options = ActivityOptions.makeSceneTransitionAnimation(context, + val options = ActivityOptions.makeSceneTransitionAnimation( + context, *data.map { (view, tag) -> Pair(view, tag) }.toTypedArray() ) putAll(options.toBundle()) diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt index 134126d..60ef236 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt @@ -1,5 +1,5 @@ /* - * Copyright 2018 Allan Wang + * Copyright 2017 Allan Wang * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,8 @@ import android.content.pm.PackageManager import android.graphics.drawable.Drawable import android.net.Uri import android.os.Bundle +import android.os.Handler +import android.os.Looper import android.util.TypedValue import android.view.View import android.view.animation.AnimationUtils @@ -45,10 +47,33 @@ import androidx.core.content.ContextCompat import ca.allanwang.kau.R import ca.allanwang.kau.logging.KL import com.afollestad.materialdialogs.MaterialDialog +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope +import kotlin.coroutines.CoroutineContext /** * Created by Allan Wang on 2017-06-03. */ +private object ContextHelper: CoroutineScope { + + val handler = Handler(Looper.getMainLooper()) + + override val coroutineContext: CoroutineContext + get() = Dispatchers.Main +} + +/** + * Most context items implement [CoroutineScope] by default. + * We will add a fallback just in case. + * It is expected that the scope returned always has the Android main dispatcher as part of the context. + */ +internal inline val Context.ctxCoroutine: CoroutineScope + get() = this as? CoroutineScope ?: ContextHelper + +fun Context.runOnUiThread(f: Context.() -> Unit) { + if (Looper.getMainLooper() === Looper.myLooper()) f() else ContextHelper.handler.post { f() } +} /** * Helper class to launch an activity from a context diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/FragmentUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/FragmentUtils.kt index 1c97900..75dc1c1 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/FragmentUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/FragmentUtils.kt @@ -16,12 +16,11 @@ package ca.allanwang.kau.utils import androidx.fragment.app.Fragment -import org.jetbrains.anko.bundleOf /** * Created by Allan Wang on 2017-07-02. */ -fun T.withArguments(vararg params: Pair): T { +fun T.withArguments(vararg params: Pair): T { arguments = bundleOf(*params) return this } diff --git a/core/src/main/kotlin/ca/allanwang/kau/xml/Changelog.kt b/core/src/main/kotlin/ca/allanwang/kau/xml/Changelog.kt index 6a75aa9..51e63f9 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/xml/Changelog.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/xml/Changelog.kt @@ -26,11 +26,12 @@ import androidx.annotation.LayoutRes import androidx.annotation.XmlRes import androidx.recyclerview.widget.RecyclerView import ca.allanwang.kau.R +import ca.allanwang.kau.utils.ctxCoroutine import ca.allanwang.kau.utils.materialDialog import ca.allanwang.kau.utils.use import com.afollestad.materialdialogs.MaterialDialog -import org.jetbrains.anko.doAsync -import org.jetbrains.anko.uiThread +import kotlinx.coroutines.async +import kotlinx.coroutines.launch import org.xmlpull.v1.XmlPullParser /** @@ -39,15 +40,13 @@ import org.xmlpull.v1.XmlPullParser * Easy changelog loader */ fun Context.showChangelog(@XmlRes xmlRes: Int, @ColorInt textColor: Int? = null, customize: MaterialDialog.Builder.() -> Unit = {}) { - doAsync { - val items = parse(this@showChangelog, xmlRes) - uiThread { - materialDialog { - title(R.string.kau_changelog) - positiveText(R.string.kau_great) - adapter(ChangelogAdapter(items, textColor), null) - customize() - } + ctxCoroutine.launch { + val items = async { parse(this@showChangelog, xmlRes) }.await() + materialDialog { + title(R.string.kau_changelog) + positiveText(R.string.kau_great) + adapter(ChangelogAdapter(items, textColor), null) + customize() } } } diff --git a/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt b/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt index cb57216..73d7d6c 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt @@ -21,8 +21,6 @@ import android.text.Html import android.text.Spanned import androidx.annotation.XmlRes import ca.allanwang.kau.utils.use -import org.jetbrains.anko.doAsync -import org.jetbrains.anko.uiThread import org.xmlpull.v1.XmlPullParser /** @@ -30,8 +28,8 @@ import org.xmlpull.v1.XmlPullParser */ /** - * Parse an xml asynchronously with two tags, Text and Text, - * and invoke the [callback] on the ui thread + * Parse an xml asynchronously with two tags, Text and Text. + * Note that this should executed in a background thread. */ @Suppress("DEPRECATION") fun Context.kauParseFaq( @@ -39,47 +37,44 @@ fun Context.kauParseFaq( /** * If \n is used, it will automatically be converted to
*/ - parseNewLine: Boolean = true, - callback: (items: List) -> Unit -) { - doAsync { - val items = mutableListOf() - resources.getXml(xmlRes).use { parser: XmlResourceParser -> - var eventType = parser.eventType - var question: Spanned? = null - var flag = -1 //-1, 0, 1 -> invalid, question, answer - while (eventType != XmlPullParser.END_DOCUMENT) { - if (eventType == XmlPullParser.START_TAG) { - flag = when (parser.name) { - "question" -> 0 - "answer" -> 1 - else -> -1 + parseNewLine: Boolean = true +): List { + val items = mutableListOf() + resources.getXml(xmlRes).use { parser: XmlResourceParser -> + var eventType = parser.eventType + var question: Spanned? = null + var flag = -1 //-1, 0, 1 -> invalid, question, answer + while (eventType != XmlPullParser.END_DOCUMENT) { + if (eventType == XmlPullParser.START_TAG) { + flag = when (parser.name) { + "question" -> 0 + "answer" -> 1 + else -> -1 + } + } else if (eventType == XmlPullParser.TEXT) { + when (flag) { + 0 -> { + question = Html.fromHtml(parser.text.replace("\n", if (parseNewLine) "
" else "")) + flag = -1 } - } else if (eventType == XmlPullParser.TEXT) { - when (flag) { - 0 -> { - question = Html.fromHtml(parser.text.replace("\n", if (parseNewLine) "
" else "")) - flag = -1 - } - 1 -> { - items.add( - FaqItem( - items.size + 1, - question - ?: throw IllegalArgumentException("KAU FAQ answer found without a question"), - Html.fromHtml(parser.text.replace("\n", if (parseNewLine) "
" else "")) - ) + 1 -> { + items.add( + FaqItem( + items.size + 1, + question + ?: throw IllegalArgumentException("KAU FAQ answer found without a question"), + Html.fromHtml(parser.text.replace("\n", if (parseNewLine) "
" else "")) ) - question = null - flag = -1 - } + ) + question = null + flag = -1 } } - eventType = parser.next() } + eventType = parser.next() } - uiThread { callback(items) } } + return items } data class FaqItem(val number: Int, val question: Spanned, val answer: Spanned) diff --git a/core/src/test/kotlin/ca/allanwang/kau/kotlin/ZipTest.kt b/core/src/test/kotlin/ca/allanwang/kau/kotlin/ZipTest.kt deleted file mode 100644 index 1fbc38f..0000000 --- a/core/src/test/kotlin/ca/allanwang/kau/kotlin/ZipTest.kt +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2018 Allan Wang - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ca.allanwang.kau.kotlin - -import org.jetbrains.anko.doAsync -import org.junit.Test -import java.util.Random -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit -import kotlin.test.assertTrue - -/** - * Created by Allan Wang on 2017-08-06. - */ -class ZipTest { - - val debug = false - - fun p(text: String) { - if (debug) println(text) - } - - @Test - fun basic() { - val start = System.currentTimeMillis() - val latch = CountDownLatch(1) - val rnd = Random() - (0..10).map { - { callback: ZipCallback -> - doAsync { - val sleepTime = rnd.nextInt(100) + 200L - p("Task $it will sleep for ${sleepTime}ms") - Thread.sleep(sleepTime) - val finish = System.currentTimeMillis() - p("Task $it finished in ${finish - start}ms at $finish") - callback(it) - }; Unit - } - }.zip(-1) { results -> - val finish = System.currentTimeMillis() - println("Results ${results.contentToString()} received in ${finish - start}ms at $finish") - assertTrue((0..10).toList().toTypedArray().contentEquals(results), "Basic zip results do not match") - assertTrue(finish - start < 1000L, "Basic zip does not seem to be running asynchronously") - latch.countDown() - } - latch.await(1100, TimeUnit.MILLISECONDS) - } - - @Test - fun basicAsync() { - val start = System.currentTimeMillis() - val latch = CountDownLatch(1) - val rnd = Random() - (0..10).map { - { - val sleepTime = rnd.nextInt(100) + 200L - p("Task $it will sleep for ${sleepTime}ms") - Thread.sleep(sleepTime) - val finish = System.currentTimeMillis() - p("Task $it finished in ${finish - start}ms at $finish") - } - }.zipAsync { - val finish = System.currentTimeMillis() - println("Results received in ${finish - start}ms at $finish") - assertTrue(finish - start < 1000L, "BasicAsync does not seem to be wrapping the tasks asynchronously") - latch.countDown() - } - latch.await(1100, TimeUnit.MILLISECONDS) - } -} diff --git a/docs/Changelog.md b/docs/Changelog.md index 1e1b0d8..283759d 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,11 @@ # Changelog +## v4.0.0-alpha02 +* :core: Remove anko dependency. Methods that used it now use coroutines; see the migration doc for minor changes +* :core: Add default CoroutineScope implementation to KauBaseActivity +* :core: Remove zip class. Coroutines and join can be used as an alternative +* :mediapicker: Use video preloading instead of full async loading + ## v4.0.0-alpha01 * Migrate to androidx. See migration for external dependency changes. * :core: Remove deprecation warning for Kotterknife diff --git a/docs/Migration.md b/docs/Migration.md index 8c5e016..cdaca4c 100644 --- a/docs/Migration.md +++ b/docs/Migration.md @@ -2,6 +2,19 @@ Below are some highlights on major refactoring/breaking changes +# v4.0.1-alpha02 + +* `kauParseFaq` is now synchronous. + +## Anko has been removed + +A lot of the methods are already implemented in KAU, and it was primarily imported for its `doAsync` methods. Now, they have been replaced with coroutines. +Some methods have been copied over: + +* import org.jetbrains.anko.runOnUiThread > import ca.allanwang.kau.utils.runOnUiThread +* import org.jetbrains.anko.contentView > import ca.allanwang.kau.utils.contentView +* import org.jetbrains.anko.bundleOf > import ca.allanwang.kau.utils.bundleOf + # v4.0.0-alpha01 This is the first introduction of androidx. The goal is to just do a migration with minimal changes. diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt index 02b6e98..450bc6e 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt @@ -33,8 +33,8 @@ import ca.allanwang.kau.utils.statusBarColor import ca.allanwang.kau.utils.withLinearAdapter import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter import kotlinx.android.synthetic.main.kau_pref_activity.* -import org.jetbrains.anko.doAsync -import org.jetbrains.anko.uiThread +import kotlinx.coroutines.async +import kotlinx.coroutines.launch import java.util.Stack abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { @@ -104,19 +104,24 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { builder: KPrefAdapterBuilder.() -> Unit, first: Boolean ) { - doAsync { - val items = KPrefAdapterBuilder(globalOptions) - builder(items) - kprefStack.push(toolbarTitleRes to items.list) + launch { + val items = async { + val items = KPrefAdapterBuilder(globalOptions) + builder(items) + kprefStack.push(toolbarTitleRes to items.list) + items.list + }.await() kau_recycler.itemAnimator = if (animate && !first) recyclerAnimatorNext else null - uiThread { - adapter.clear() - adapter.add(items.list.filter { it.core.visible() }) - toolbar.setTitle(toolbarTitleRes) - } + show(toolbarTitleRes, items) } } + private fun show(@StringRes toolbarTitleRes: Int, items: List) { + toolbar.setTitle(toolbarTitleRes) + adapter.clear() + adapter.add(items.filter { it.core.visible() }) + } + /** * Pops the stack and loads the next kpref list * Indices are not checked so ensure that this is possible first @@ -125,9 +130,7 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { kprefStack.pop() val (title, list) = kprefStack.peek() kau_recycler.itemAnimator = if (animate) recyclerAnimatorPrev else null - adapter.clear() - adapter.add(list.filter { it.core.visible() }) - toolbar.setTitle(title) + show(title, list) } /** diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt index abdc266..7004967 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt @@ -49,10 +49,8 @@ import com.mikepenz.fastadapter.adapters.ItemAdapter import com.mikepenz.google_material_typeface_library.GoogleMaterial import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.typeface.IIcon -import org.jetbrains.anko.doAsync +import kotlinx.coroutines.CancellationException import java.io.File -import java.util.concurrent.ExecutionException -import java.util.concurrent.Future /** * Created by Allan Wang on 2017-07-23. @@ -121,7 +119,6 @@ abstract class MediaPickerCore>( lateinit var glide: RequestManager private var hasPreloaded = false - private var prefetcher: Future<*>? = null val adapter = ItemAdapter() @@ -137,7 +134,7 @@ abstract class MediaPickerCore>( fun initializeRecycler(recycler: RecyclerView) { val adapterHeader = ItemAdapter() - val fulladapter = fastAdapter(adapterHeader, adapter) + val fulladapter = fastAdapter>(adapterHeader, adapter) adapterHeader.add(mediaActions.map { MediaActionItem(it, mediaType) }) recycler.apply { val manager = object : GridLayoutManager(context, computeColumnCount(context)) { @@ -146,7 +143,6 @@ abstract class MediaPickerCore>( } } setItemViewCacheSize(CACHE_SIZE) - isDrawingCacheEnabled = true layoutManager = manager adapter = fulladapter setHasFixedSize(true) @@ -195,18 +191,14 @@ abstract class MediaPickerCore>( addItems(models.map { converter(it) }) if (!hasPreloaded && mediaType == MediaType.VIDEO) { hasPreloaded = true - prefetcher = doAsync { - models.subList(0, Math.min(models.size, 50)).map { it.data }.forEach { - val target = glide.load(it) - .applyMediaOptions(this@MediaPickerCore) - .submit() - try { - target.get() - } catch (ignored: InterruptedException) { - } catch (ignored: ExecutionException) { - } finally { - glide.clear(target) - } + val preloads = models.subList(0, Math.min(models.size, 50)).map { + glide.load(it.data) + .applyMediaOptions(this@MediaPickerCore) + .preload() + } + job.invokeOnCompletion { + if (it is CancellationException) { + preloads.forEach(glide::clear) } } } @@ -242,11 +234,6 @@ abstract class MediaPickerCore>( open fun onStatusChange(loaded: Boolean) {} - override fun onDestroy() { - prefetcher?.cancel(true) - super.onDestroy() - } - /** * Method used to retrieve uri data for API 19+ * See diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml index 6c0fea1..3c49078 100644 --- a/sample/src/main/res/xml/kau_changelog.xml +++ b/sample/src/main/res/xml/kau_changelog.xml @@ -6,6 +6,16 @@ --> + + + + + + + + + + diff --git a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt index 11880cd..169e914 100644 --- a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt +++ b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt @@ -53,6 +53,7 @@ import ca.allanwang.kau.utils.hideKeyboard import ca.allanwang.kau.utils.invisibleIf import ca.allanwang.kau.utils.isVisible import ca.allanwang.kau.utils.parentViewGroup +import ca.allanwang.kau.utils.runOnUiThread import ca.allanwang.kau.utils.setIcon import ca.allanwang.kau.utils.setMarginTop import ca.allanwang.kau.utils.showKeyboard @@ -65,7 +66,6 @@ import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter import com.mikepenz.google_material_typeface_library.GoogleMaterial import com.mikepenz.iconics.typeface.IIcon import kotlinx.android.synthetic.main.kau_search_view.view.* -import org.jetbrains.anko.runOnUiThread /** * Created by Allan Wang on 2017-06-23. -- cgit v1.2.3 From 274e10fab9a7ee1a7f1934d1f07bd5cffdc84c1b Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 5 Jan 2019 22:21:06 -0500 Subject: Translations (#187) * Update README.md * New translations strings_colorpicker.xml (Serbian (Cyrillic)) * New translations strings_commons.xml (Serbian (Cyrillic)) * New translations strings_mediapicker.xml (Serbian (Cyrillic)) * New translations strings_about.xml (Serbian (Cyrillic)) * New translations strings_about.xml (Portuguese) * New translations strings_commons.xml (Portuguese) * New translations strings_mediapicker.xml (Portuguese) * New translations strings_commons.xml (Chinese Traditional) * New translations strings_mediapicker.xml (Chinese Traditional) * New translations strings_about.xml (Spanish) * New translations strings_colorpicker.xml (Spanish) * New translations strings_commons.xml (Spanish) * New translations strings_mediapicker.xml (Spanish) * New translations strings_about.xml (Afrikaans) * New translations strings_about.xml (Hebrew) * New translations strings_commons.xml (French) * New translations strings_mediapicker.xml (French) * New translations strings_about.xml (Galician) * New translations strings_colorpicker.xml (Galician) * New translations strings_commons.xml (Galician) * New translations strings_mediapicker.xml (Galician) * New translations strings_about.xml (German) * New translations strings_colorpicker.xml (German) * New translations strings_commons.xml (German) * New translations strings_mediapicker.xml (German) * New translations strings_colorpicker.xml (Afrikaans) * New translations strings_colorpicker.xml (Greek) * New translations strings_commons.xml (Greek) * New translations strings_mediapicker.xml (Greek) * New translations strings_colorpicker.xml (Hebrew) * New translations strings_about.xml (French) * New translations strings_commons.xml (Italian) * New translations strings_about.xml (Korean) * New translations strings_mediapicker.xml (Japanese) * New translations strings_commons.xml (Japanese) * New translations strings_colorpicker.xml (Japanese) * New translations strings_about.xml (Japanese) * New translations strings_mediapicker.xml (Italian) * New translations strings_colorpicker.xml (Italian) * New translations strings_commons.xml (Hebrew) * New translations strings_about.xml (Italian) * New translations strings_mediapicker.xml (Hungarian) * New translations strings_commons.xml (Hungarian) * New translations strings_colorpicker.xml (Hungarian) * New translations strings_about.xml (Hungarian) * New translations strings_mediapicker.xml (Hebrew) * New translations strings_colorpicker.xml (French) * New translations strings_about.xml (Greek) * New translations strings_mediapicker.xml (Finnish) * New translations strings_colorpicker.xml (Catalan) * New translations strings_mediapicker.xml (Chinese Simplified) * New translations strings_commons.xml (Chinese Simplified) * New translations strings_colorpicker.xml (Chinese Simplified) * New translations strings_about.xml (Chinese Simplified) * New translations strings_mediapicker.xml (Catalan) * New translations strings_commons.xml (Catalan) * New translations strings_about.xml (Catalan) * New translations strings_colorpicker.xml (Chinese Traditional) * New translations strings_mediapicker.xml (Arabic) * New translations strings_commons.xml (Arabic) * New translations strings_commons.xml (Finnish) * New translations strings_about.xml (Arabic) * New translations strings_mediapicker.xml (Afrikaans) * New translations strings_commons.xml (Afrikaans) * New translations strings_about.xml (Chinese Traditional) * New translations strings_colorpicker.xml (Arabic) * New translations strings_commons.xml (Chinese Traditional) * New translations strings_mediapicker.xml (Dutch) * New translations strings_mediapicker.xml (Chinese Traditional) * New translations strings_colorpicker.xml (Finnish) * New translations strings_mediapicker.xml (English) * New translations strings_commons.xml (English) * New translations strings_colorpicker.xml (English) * New translations strings_about.xml (English) * New translations strings_about.xml (Finnish) * New translations strings_commons.xml (Dutch) * New translations strings_about.xml (Czech) * New translations strings_about.xml (Dutch) * New translations strings_mediapicker.xml (Czech) * New translations strings_commons.xml (Czech) * New translations strings_colorpicker.xml (Czech) * New translations strings_colorpicker.xml (Dutch) * New translations strings_colorpicker.xml (Romanian) * New translations strings_commons.xml (Romanian) * New translations strings_mediapicker.xml (Romanian) * New translations strings_about.xml (Russian) * New translations strings_colorpicker.xml (Russian) * New translations strings_about.xml (Vietnamese) * New translations strings_commons.xml (Russian) * New translations strings_mediapicker.xml (Russian) * New translations strings_colorpicker.xml (Vietnamese) * New translations strings_commons.xml (Vietnamese) * New translations strings_mediapicker.xml (Portuguese, Brazilian) * New translations strings_about.xml (Romanian) * New translations strings_commons.xml (Norwegian) * New translations strings_commons.xml (Portuguese, Brazilian) * New translations strings_colorpicker.xml (Portuguese, Brazilian) * New translations strings_about.xml (Portuguese, Brazilian) * New translations strings_commons.xml (Portuguese) * New translations strings_colorpicker.xml (Portuguese) * New translations strings_about.xml (Portuguese) * New translations strings_mediapicker.xml (Norwegian) * New translations strings_colorpicker.xml (Norwegian) * New translations strings_about.xml (Norwegian) * New translations strings_mediapicker.xml (Korean) * New translations strings_commons.xml (Korean) * New translations strings_colorpicker.xml (Korean) * New translations strings_mediapicker.xml (Vietnamese) * New translations strings_about.xml (Serbian (Cyrillic)) * New translations strings_colorpicker.xml (Serbian (Cyrillic)) * New translations strings_commons.xml (Serbian (Cyrillic)) * New translations strings_mediapicker.xml (Serbian (Cyrillic)) * New translations strings_commons.xml (Portuguese) * New translations strings_mediapicker.xml (Portuguese) * New translations strings_commons.xml (Danish) * New translations strings_mediapicker.xml (Turkish) * New translations strings_mediapicker.xml (Thai) * New translations strings_mediapicker.xml (Tagalog) * New translations strings_mediapicker.xml (Swedish) * New translations strings_mediapicker.xml (Polish) * New translations strings_mediapicker.xml (Indonesian) * New translations strings_mediapicker.xml (Danish) * New translations strings_commons.xml (Ukrainian) * New translations strings_commons.xml (Turkish) * New translations strings_commons.xml (Thai) * New translations strings_commons.xml (Tagalog) * New translations strings_commons.xml (Swedish) * New translations strings_commons.xml (Polish) * New translations strings_commons.xml (Indonesian) * New translations strings_colorpicker.xml (Ukrainian) * New translations strings_about.xml (Danish) * New translations strings_colorpicker.xml (Turkish) * New translations strings_colorpicker.xml (Thai) * New translations strings_colorpicker.xml (Tagalog) * New translations strings_colorpicker.xml (Swedish) * New translations strings_colorpicker.xml (Polish) * New translations strings_colorpicker.xml (Indonesian) * New translations strings_colorpicker.xml (Danish) * New translations strings_about.xml (Ukrainian) * New translations strings_about.xml (Turkish) * New translations strings_about.xml (Thai) * New translations strings_about.xml (Tagalog) * New translations strings_about.xml (Swedish) * New translations strings_about.xml (Polish) * New translations strings_about.xml (Indonesian) * New translations strings_mediapicker.xml (Ukrainian) * Remove blank translations * Update translation credits * Update translation credits --- README.md | 14 ++-- about/src/main/res/values-da-rDK/strings_about.xml | 3 +- about/src/main/res/values-de-rDE/strings_about.xml | 3 +- about/src/main/res/values-es-rES/strings_about.xml | 3 +- about/src/main/res/values-fr-rFR/strings_about.xml | 3 +- about/src/main/res/values-gl-rES/strings_about.xml | 3 +- about/src/main/res/values-hu-rHU/strings_about.xml | 3 +- about/src/main/res/values-in-rID/strings_about.xml | 3 +- about/src/main/res/values-it-rIT/strings_about.xml | 3 +- about/src/main/res/values-ko-rKR/strings_about.xml | 3 +- about/src/main/res/values-no-rNO/strings_about.xml | 3 +- about/src/main/res/values-pl-rPL/strings_about.xml | 3 +- about/src/main/res/values-pt-rBR/strings_about.xml | 3 +- about/src/main/res/values-pt-rPT/strings_about.xml | 6 ++ about/src/main/res/values-sr-rSP/strings_about.xml | 6 ++ about/src/main/res/values-sv-rSE/strings_about.xml | 3 +- about/src/main/res/values-th-rTH/strings_about.xml | 3 +- about/src/main/res/values-tr-rTR/strings_about.xml | 3 +- about/src/main/res/values-uk-rUA/strings_about.xml | 3 +- about/src/main/res/values-vi-rVN/strings_about.xml | 3 +- about/src/main/res/values-zh-rCN/strings_about.xml | 3 +- about/src/main/res/values-zh-rTW/strings_about.xml | 6 ++ .../main/res/values-da-rDK/strings_colorpicker.xml | 3 +- .../main/res/values-de-rDE/strings_colorpicker.xml | 3 +- .../main/res/values-es-rES/strings_colorpicker.xml | 3 +- .../main/res/values-fr-rFR/strings_colorpicker.xml | 3 +- .../main/res/values-gl-rES/strings_colorpicker.xml | 3 +- .../main/res/values-hu-rHU/strings_colorpicker.xml | 3 +- .../main/res/values-in-rID/strings_colorpicker.xml | 3 +- .../main/res/values-it-rIT/strings_colorpicker.xml | 3 +- .../main/res/values-ko-rKR/strings_colorpicker.xml | 3 +- .../main/res/values-no-rNO/strings_colorpicker.xml | 3 +- .../main/res/values-pl-rPL/strings_colorpicker.xml | 3 +- .../main/res/values-pt-rBR/strings_colorpicker.xml | 3 +- .../main/res/values-pt-rPT/strings_colorpicker.xml | 6 ++ .../main/res/values-sr-rSP/strings_colorpicker.xml | 6 ++ .../main/res/values-sv-rSE/strings_colorpicker.xml | 3 +- .../main/res/values-th-rTH/strings_colorpicker.xml | 3 +- .../main/res/values-tr-rTR/strings_colorpicker.xml | 3 +- .../main/res/values-uk-rUA/strings_colorpicker.xml | 3 +- .../main/res/values-vi-rVN/strings_colorpicker.xml | 3 +- .../main/res/values-zh-rCN/strings_colorpicker.xml | 3 +- .../main/res/values-zh-rTW/strings_colorpicker.xml | 6 ++ .../res-public/values-da-rDK/strings_commons.xml | 4 +- .../res-public/values-de-rDE/strings_commons.xml | 4 +- .../res-public/values-es-rES/strings_commons.xml | 4 +- .../res-public/values-fr-rFR/strings_commons.xml | 4 +- .../res-public/values-gl-rES/strings_commons.xml | 4 +- .../res-public/values-hu-rHU/strings_commons.xml | 4 +- .../res-public/values-in-rID/strings_commons.xml | 4 +- .../res-public/values-it-rIT/strings_commons.xml | 4 +- .../res-public/values-ko-rKR/strings_commons.xml | 4 +- .../res-public/values-no-rNO/strings_commons.xml | 4 +- .../res-public/values-pl-rPL/strings_commons.xml | 4 +- .../res-public/values-pt-rBR/strings_commons.xml | 4 +- .../res-public/values-pt-rPT/strings_commons.xml | 71 ++++++++++++++++++++ .../res-public/values-sr-rSP/strings_commons.xml | 75 ++++++++++++++++++++++ .../res-public/values-sv-rSE/strings_commons.xml | 4 +- .../res-public/values-th-rTH/strings_commons.xml | 4 +- .../res-public/values-tr-rTR/strings_commons.xml | 4 +- .../res-public/values-uk-rUA/strings_commons.xml | 28 +++++++- .../res-public/values-vi-rVN/strings_commons.xml | 4 +- .../res-public/values-zh-rCN/strings_commons.xml | 4 +- .../res-public/values-zh-rTW/strings_commons.xml | 67 +++++++++++++++++++ files/translation_migration.sh | 1 + .../main/res/values-da-rDK/strings_mediapicker.xml | 3 +- .../main/res/values-de-rDE/strings_mediapicker.xml | 3 +- .../main/res/values-es-rES/strings_mediapicker.xml | 3 +- .../main/res/values-fr-rFR/strings_mediapicker.xml | 3 +- .../main/res/values-gl-rES/strings_mediapicker.xml | 3 +- .../main/res/values-hu-rHU/strings_mediapicker.xml | 3 +- .../main/res/values-in-rID/strings_mediapicker.xml | 3 +- .../main/res/values-it-rIT/strings_mediapicker.xml | 3 +- .../main/res/values-ko-rKR/strings_mediapicker.xml | 3 +- .../main/res/values-no-rNO/strings_mediapicker.xml | 3 +- .../main/res/values-pl-rPL/strings_mediapicker.xml | 3 +- .../main/res/values-pt-rBR/strings_mediapicker.xml | 3 +- .../main/res/values-pt-rPT/strings_mediapicker.xml | 11 ++++ .../main/res/values-sr-rSP/strings_mediapicker.xml | 11 ++++ .../main/res/values-sv-rSE/strings_mediapicker.xml | 3 +- .../main/res/values-th-rTH/strings_mediapicker.xml | 3 +- .../main/res/values-tr-rTR/strings_mediapicker.xml | 3 +- .../main/res/values-uk-rUA/strings_mediapicker.xml | 3 +- .../main/res/values-vi-rVN/strings_mediapicker.xml | 3 +- .../main/res/values-zh-rCN/strings_mediapicker.xml | 3 +- .../main/res/values-zh-rTW/strings_mediapicker.xml | 11 ++++ searchview/README.md | 2 +- 87 files changed, 479 insertions(+), 78 deletions(-) create mode 100644 about/src/main/res/values-pt-rPT/strings_about.xml create mode 100644 about/src/main/res/values-sr-rSP/strings_about.xml create mode 100644 about/src/main/res/values-zh-rTW/strings_about.xml create mode 100644 colorpicker/src/main/res/values-pt-rPT/strings_colorpicker.xml create mode 100644 colorpicker/src/main/res/values-sr-rSP/strings_colorpicker.xml create mode 100644 colorpicker/src/main/res/values-zh-rTW/strings_colorpicker.xml create mode 100644 core/src/main/res-public/values-pt-rPT/strings_commons.xml create mode 100644 core/src/main/res-public/values-sr-rSP/strings_commons.xml create mode 100644 core/src/main/res-public/values-zh-rTW/strings_commons.xml create mode 100644 mediapicker/src/main/res/values-pt-rPT/strings_mediapicker.xml create mode 100644 mediapicker/src/main/res/values-sr-rSP/strings_mediapicker.xml create mode 100644 mediapicker/src/main/res/values-zh-rTW/strings_mediapicker.xml (limited to 'README.md') diff --git a/README.md b/README.md index 6fe7590..e584f9b 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,8 @@ Special thanks to the following awesome people for translating significant porti | Language | Contributors | |----------|--------------| -| Chinese (Simplified) | | +| Chinese (Simplified) | [Alcatelia](https://crowdin.com/profile/Alcatelia) | +| Chinese (Traditional) | [yipinghuang](https://crowdin.com/profile/yipinghuang) • [Su, Jun-Ming](https://crowdin.com/profile/sujunmin) • [Wei](https://crowdin.com/profile/wei4green) | | French | [Vincent Kulak](https://github.com/VonOx) • [Jean-Philippe Gravel](https://crowdin.com/profile/wokija) | | Galician | [Xesús M. Mosquera](https://twitter.com/xesusmmc?lang=en) | | German | [Bushido1992](https://forum.xda-developers.com/member.php?u=5179246) • [Marcel Soehnchen](https://crowdin.com/profile/msoehnchen) • [3LD0mi HA](https://forum.xda-developers.com/member.php?u=5860523) | @@ -183,11 +184,14 @@ Special thanks to the following awesome people for translating significant porti | Italian | [Bonnee](https://github.com/Bonnee) | | Korean | [잇스테이크](https://crowdin.com/profile/bexco2010) | | Norwegian | | -| Polish | | -| Portuguese | [TheusKhan](https://crowdin.com/profile/TheusKhan) | +| Polish | [pantinPL](https://crowdin.com/profile/pantinPL) | +| Portuguese | [Sérgio Marques](https://crowdin.com/profile/smarquespt) • [Miguel Dos Reis](https://crowdin.com/profile/siersod) | +| Portuguese (Brazilian) | [TheusKhan](https://crowdin.com/profile/TheusKhan) | +| Serbian | [Nikola Radmanović](https://crowdin.com/profile/nikoladradmanovic) | | Spanish | [Jahir Fiquitiva](https://jahirfiquitiva.me/) • [Nefi Salazar](https://plus.google.com/u/0/105547968033551087431)| -| Thai | | -| Turkish | | +| Thai | [Thanawat Hanthong](https://crowdin.com/profile/peet6015) | +| Turkish | [zuma17](https://crowdin.com/profile/zuma17) | | Vietnamese | [Alienz](https://crowdin.com/profile/alienyd) | The full activity stream for the translations can be found [here](https://crowdin.com/project/kotlin-android-utils/activity_stream) + diff --git a/about/src/main/res/values-da-rDK/strings_about.xml b/about/src/main/res/values-da-rDK/strings_about.xml index 837d419..87fc65b 100644 --- a/about/src/main/res/values-da-rDK/strings_about.xml +++ b/about/src/main/res/values-da-rDK/strings_about.xml @@ -1,4 +1,5 @@ - + + Denne app vil ikke være mulig uden de følgende fantastiske biblioteker. Ofte stillede spørgsmål diff --git a/about/src/main/res/values-de-rDE/strings_about.xml b/about/src/main/res/values-de-rDE/strings_about.xml index 5d7bc28..69df4d9 100644 --- a/about/src/main/res/values-de-rDE/strings_about.xml +++ b/about/src/main/res/values-de-rDE/strings_about.xml @@ -1,4 +1,5 @@ - + + Diese App wäre nicht möglich ohne die folgenden großartigen Bibliotheken. Häufige Fragen / FAQ diff --git a/about/src/main/res/values-es-rES/strings_about.xml b/about/src/main/res/values-es-rES/strings_about.xml index 3fb0bed..743bc4d 100644 --- a/about/src/main/res/values-es-rES/strings_about.xml +++ b/about/src/main/res/values-es-rES/strings_about.xml @@ -1,4 +1,5 @@ - + + Esta aplicación no sería posible sin las siguientes geniales librerías. Preguntas Frecuentes diff --git a/about/src/main/res/values-fr-rFR/strings_about.xml b/about/src/main/res/values-fr-rFR/strings_about.xml index 91db02c..0d50f86 100644 --- a/about/src/main/res/values-fr-rFR/strings_about.xml +++ b/about/src/main/res/values-fr-rFR/strings_about.xml @@ -1,4 +1,5 @@ - + + Ce soft ne serait pas possible sans ces super bibliothèques. FAQ diff --git a/about/src/main/res/values-gl-rES/strings_about.xml b/about/src/main/res/values-gl-rES/strings_about.xml index fe64f7f..f0da61f 100644 --- a/about/src/main/res/values-gl-rES/strings_about.xml +++ b/about/src/main/res/values-gl-rES/strings_about.xml @@ -1,4 +1,5 @@ - + + Esta aplicación non sería posible sen a existencia destas fantásticas librarías. Preguntas frecuentes diff --git a/about/src/main/res/values-hu-rHU/strings_about.xml b/about/src/main/res/values-hu-rHU/strings_about.xml index d57e13d..e4efded 100644 --- a/about/src/main/res/values-hu-rHU/strings_about.xml +++ b/about/src/main/res/values-hu-rHU/strings_about.xml @@ -1,4 +1,5 @@ - + + Ez az app nem jöhetett volna létre a következő könyvtárak nélkül. GyIK diff --git a/about/src/main/res/values-in-rID/strings_about.xml b/about/src/main/res/values-in-rID/strings_about.xml index e2e83a7..5bdee31 100644 --- a/about/src/main/res/values-in-rID/strings_about.xml +++ b/about/src/main/res/values-in-rID/strings_about.xml @@ -1,4 +1,5 @@ - + + Aplikasi ini tidak mungkin dilakukan tanpa perpustakaan besar berikut ini. FAQ diff --git a/about/src/main/res/values-it-rIT/strings_about.xml b/about/src/main/res/values-it-rIT/strings_about.xml index 170ff15..5867d94 100644 --- a/about/src/main/res/values-it-rIT/strings_about.xml +++ b/about/src/main/res/values-it-rIT/strings_about.xml @@ -1,4 +1,5 @@ - + + Questa applicazione non sarebbe possibile senza queste fantastiche librerie. Domande frequenti diff --git a/about/src/main/res/values-ko-rKR/strings_about.xml b/about/src/main/res/values-ko-rKR/strings_about.xml index f6b4413..00c80e3 100644 --- a/about/src/main/res/values-ko-rKR/strings_about.xml +++ b/about/src/main/res/values-ko-rKR/strings_about.xml @@ -1,4 +1,5 @@ - + + 이 앱은 아래의 라이브러리가 없었다면 만들 수 없었습니다. FAQ diff --git a/about/src/main/res/values-no-rNO/strings_about.xml b/about/src/main/res/values-no-rNO/strings_about.xml index 2cffcbc..328fda3 100644 --- a/about/src/main/res/values-no-rNO/strings_about.xml +++ b/about/src/main/res/values-no-rNO/strings_about.xml @@ -1,4 +1,5 @@ - + + Denne appens eksistens ville ikke vært mulig uten de flotte, følgende bibliotekene. Spørsmål og svar diff --git a/about/src/main/res/values-pl-rPL/strings_about.xml b/about/src/main/res/values-pl-rPL/strings_about.xml index cfdd1ef..a5daa6d 100644 --- a/about/src/main/res/values-pl-rPL/strings_about.xml +++ b/about/src/main/res/values-pl-rPL/strings_about.xml @@ -1,4 +1,5 @@ - + + Aplikacja nie byłaby możliwa bez następujących świetnych bibliotek. FAQ diff --git a/about/src/main/res/values-pt-rBR/strings_about.xml b/about/src/main/res/values-pt-rBR/strings_about.xml index e6feb8d..8e98238 100644 --- a/about/src/main/res/values-pt-rBR/strings_about.xml +++ b/about/src/main/res/values-pt-rBR/strings_about.xml @@ -1,4 +1,5 @@ - + + Este aplicativo não seria possível sem as seguintes excelentes bibliotecas. Perguntas Frequentes diff --git a/about/src/main/res/values-pt-rPT/strings_about.xml b/about/src/main/res/values-pt-rPT/strings_about.xml new file mode 100644 index 0000000..d092302 --- /dev/null +++ b/about/src/main/res/values-pt-rPT/strings_about.xml @@ -0,0 +1,6 @@ + + + + Esta aplicação não seria possível sem as seguintes bibliotecas. + FAQ + diff --git a/about/src/main/res/values-sr-rSP/strings_about.xml b/about/src/main/res/values-sr-rSP/strings_about.xml new file mode 100644 index 0000000..550aa9b --- /dev/null +++ b/about/src/main/res/values-sr-rSP/strings_about.xml @@ -0,0 +1,6 @@ + + + + Ова апликација не бу била могућа без ових одличних библиотека. + ЧПП + diff --git a/about/src/main/res/values-sv-rSE/strings_about.xml b/about/src/main/res/values-sv-rSE/strings_about.xml index 02f5417..d8f888f 100644 --- a/about/src/main/res/values-sv-rSE/strings_about.xml +++ b/about/src/main/res/values-sv-rSE/strings_about.xml @@ -1,4 +1,5 @@ - + + Den här appen skulle inte varit möjlig utan följande bibliotek. Vanliga frågor diff --git a/about/src/main/res/values-th-rTH/strings_about.xml b/about/src/main/res/values-th-rTH/strings_about.xml index ab1863b..7a3a5ed 100644 --- a/about/src/main/res/values-th-rTH/strings_about.xml +++ b/about/src/main/res/values-th-rTH/strings_about.xml @@ -1,4 +1,5 @@ - + + แอพนี้จะไม่สามารถเกิดขึ้นได้ถ้าไม่ได้ไลบาลี้เหล่านี้ ถามตอบ diff --git a/about/src/main/res/values-tr-rTR/strings_about.xml b/about/src/main/res/values-tr-rTR/strings_about.xml index b54bb6e..857aec3 100644 --- a/about/src/main/res/values-tr-rTR/strings_about.xml +++ b/about/src/main/res/values-tr-rTR/strings_about.xml @@ -1,4 +1,5 @@ - + + Bu uygulama aşağıdaki büyük kütüphaneler olmadan mümkün olmayacaktır. SSS diff --git a/about/src/main/res/values-uk-rUA/strings_about.xml b/about/src/main/res/values-uk-rUA/strings_about.xml index 1ca3901..d4dca9b 100644 --- a/about/src/main/res/values-uk-rUA/strings_about.xml +++ b/about/src/main/res/values-uk-rUA/strings_about.xml @@ -1,4 +1,5 @@ - + + Цей додаток не був би можливим без використання великих бібліотек. FAQ diff --git a/about/src/main/res/values-vi-rVN/strings_about.xml b/about/src/main/res/values-vi-rVN/strings_about.xml index a71d127..4f84966 100644 --- a/about/src/main/res/values-vi-rVN/strings_about.xml +++ b/about/src/main/res/values-vi-rVN/strings_about.xml @@ -1,4 +1,5 @@ - + + Ứng dụng này ra đời nhờ những thư viện tuyệt vời dưới đây. CÂU HỎI THƯỜNG GẶP diff --git a/about/src/main/res/values-zh-rCN/strings_about.xml b/about/src/main/res/values-zh-rCN/strings_about.xml index 8625ef7..cf63c9a 100644 --- a/about/src/main/res/values-zh-rCN/strings_about.xml +++ b/about/src/main/res/values-zh-rCN/strings_about.xml @@ -1,4 +1,5 @@ - + + 没有以下的大数据库,这个应用程序不会运行。 常见问题 diff --git a/about/src/main/res/values-zh-rTW/strings_about.xml b/about/src/main/res/values-zh-rTW/strings_about.xml new file mode 100644 index 0000000..a292a93 --- /dev/null +++ b/about/src/main/res/values-zh-rTW/strings_about.xml @@ -0,0 +1,6 @@ + + + + 若無下述函式庫的幫忙, 本程式無法成真. + 常見問題 + diff --git a/colorpicker/src/main/res/values-da-rDK/strings_colorpicker.xml b/colorpicker/src/main/res/values-da-rDK/strings_colorpicker.xml index a5f7487..334896f 100644 --- a/colorpicker/src/main/res/values-da-rDK/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-da-rDK/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Farvepalette Forhåndsvalg diff --git a/colorpicker/src/main/res/values-de-rDE/strings_colorpicker.xml b/colorpicker/src/main/res/values-de-rDE/strings_colorpicker.xml index 5dd7b38..5763d20 100644 --- a/colorpicker/src/main/res/values-de-rDE/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-de-rDE/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Farbpalette Vorlagen diff --git a/colorpicker/src/main/res/values-es-rES/strings_colorpicker.xml b/colorpicker/src/main/res/values-es-rES/strings_colorpicker.xml index 56148fd..2be5b2c 100644 --- a/colorpicker/src/main/res/values-es-rES/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-es-rES/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Paleta de colores Ajustes preestablecidos diff --git a/colorpicker/src/main/res/values-fr-rFR/strings_colorpicker.xml b/colorpicker/src/main/res/values-fr-rFR/strings_colorpicker.xml index a044e6e..19c2935 100644 --- a/colorpicker/src/main/res/values-fr-rFR/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-fr-rFR/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Palette de couleurs Réglages prédéfinis diff --git a/colorpicker/src/main/res/values-gl-rES/strings_colorpicker.xml b/colorpicker/src/main/res/values-gl-rES/strings_colorpicker.xml index fbc1d90..5a42281 100644 --- a/colorpicker/src/main/res/values-gl-rES/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-gl-rES/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Paleta de cores Axustes predefinidos diff --git a/colorpicker/src/main/res/values-hu-rHU/strings_colorpicker.xml b/colorpicker/src/main/res/values-hu-rHU/strings_colorpicker.xml index 42f3700..69b3850 100644 --- a/colorpicker/src/main/res/values-hu-rHU/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-hu-rHU/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Színpaletta Sablonok diff --git a/colorpicker/src/main/res/values-in-rID/strings_colorpicker.xml b/colorpicker/src/main/res/values-in-rID/strings_colorpicker.xml index 52e59bc..d7ddb5d 100644 --- a/colorpicker/src/main/res/values-in-rID/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-in-rID/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Palet warna Preset diff --git a/colorpicker/src/main/res/values-it-rIT/strings_colorpicker.xml b/colorpicker/src/main/res/values-it-rIT/strings_colorpicker.xml index 4f3e282..b7c907d 100644 --- a/colorpicker/src/main/res/values-it-rIT/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-it-rIT/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Tavolozza dei colori Preimpostazioni diff --git a/colorpicker/src/main/res/values-ko-rKR/strings_colorpicker.xml b/colorpicker/src/main/res/values-ko-rKR/strings_colorpicker.xml index 7c65db1..92ad098 100644 --- a/colorpicker/src/main/res/values-ko-rKR/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-ko-rKR/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + 색상 팔레트 사전 설정 diff --git a/colorpicker/src/main/res/values-no-rNO/strings_colorpicker.xml b/colorpicker/src/main/res/values-no-rNO/strings_colorpicker.xml index d79a6d8..fb15bbb 100644 --- a/colorpicker/src/main/res/values-no-rNO/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-no-rNO/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Fargepalett Forhåndsinnstillinger diff --git a/colorpicker/src/main/res/values-pl-rPL/strings_colorpicker.xml b/colorpicker/src/main/res/values-pl-rPL/strings_colorpicker.xml index 42cb6e0..e9fea97 100644 --- a/colorpicker/src/main/res/values-pl-rPL/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-pl-rPL/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Paleta kolorów Zdefiniowane diff --git a/colorpicker/src/main/res/values-pt-rBR/strings_colorpicker.xml b/colorpicker/src/main/res/values-pt-rBR/strings_colorpicker.xml index 0694ed4..67d239d 100644 --- a/colorpicker/src/main/res/values-pt-rBR/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-pt-rBR/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Paleta de Cores Predefinições diff --git a/colorpicker/src/main/res/values-pt-rPT/strings_colorpicker.xml b/colorpicker/src/main/res/values-pt-rPT/strings_colorpicker.xml new file mode 100644 index 0000000..9346ff5 --- /dev/null +++ b/colorpicker/src/main/res/values-pt-rPT/strings_colorpicker.xml @@ -0,0 +1,6 @@ + + + + Paleta de cores + Predefinições + diff --git a/colorpicker/src/main/res/values-sr-rSP/strings_colorpicker.xml b/colorpicker/src/main/res/values-sr-rSP/strings_colorpicker.xml new file mode 100644 index 0000000..6459b1b --- /dev/null +++ b/colorpicker/src/main/res/values-sr-rSP/strings_colorpicker.xml @@ -0,0 +1,6 @@ + + + + Палета боја + Предподешења + diff --git a/colorpicker/src/main/res/values-sv-rSE/strings_colorpicker.xml b/colorpicker/src/main/res/values-sv-rSE/strings_colorpicker.xml index 6b06ba9..565bb71 100644 --- a/colorpicker/src/main/res/values-sv-rSE/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-sv-rSE/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Färgpalett Förval diff --git a/colorpicker/src/main/res/values-th-rTH/strings_colorpicker.xml b/colorpicker/src/main/res/values-th-rTH/strings_colorpicker.xml index 7fdf610..9dbf908 100644 --- a/colorpicker/src/main/res/values-th-rTH/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-th-rTH/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + ชุดสี ค่าที่ตั้งไว้ diff --git a/colorpicker/src/main/res/values-tr-rTR/strings_colorpicker.xml b/colorpicker/src/main/res/values-tr-rTR/strings_colorpicker.xml index eddc8ad..fd90b4a 100644 --- a/colorpicker/src/main/res/values-tr-rTR/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-tr-rTR/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Renk paleti Hazır ayarlar diff --git a/colorpicker/src/main/res/values-uk-rUA/strings_colorpicker.xml b/colorpicker/src/main/res/values-uk-rUA/strings_colorpicker.xml index d114ba5..9120a10 100644 --- a/colorpicker/src/main/res/values-uk-rUA/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-uk-rUA/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Кольорова палітра Пресети diff --git a/colorpicker/src/main/res/values-vi-rVN/strings_colorpicker.xml b/colorpicker/src/main/res/values-vi-rVN/strings_colorpicker.xml index f14a044..68bacae 100644 --- a/colorpicker/src/main/res/values-vi-rVN/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-vi-rVN/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + Bảng màu Cài đặt sẵn diff --git a/colorpicker/src/main/res/values-zh-rCN/strings_colorpicker.xml b/colorpicker/src/main/res/values-zh-rCN/strings_colorpicker.xml index 9b117f5..38f4aeb 100644 --- a/colorpicker/src/main/res/values-zh-rCN/strings_colorpicker.xml +++ b/colorpicker/src/main/res/values-zh-rCN/strings_colorpicker.xml @@ -1,4 +1,5 @@ - + + 调色板 预设 diff --git a/colorpicker/src/main/res/values-zh-rTW/strings_colorpicker.xml b/colorpicker/src/main/res/values-zh-rTW/strings_colorpicker.xml new file mode 100644 index 0000000..a7fb17b --- /dev/null +++ b/colorpicker/src/main/res/values-zh-rTW/strings_colorpicker.xml @@ -0,0 +1,6 @@ + + + + 調色板 + 預設 + diff --git a/core/src/main/res-public/values-da-rDK/strings_commons.xml b/core/src/main/res-public/values-da-rDK/strings_commons.xml index 5be1277..745418a 100644 --- a/core/src/main/res-public/values-da-rDK/strings_commons.xml +++ b/core/src/main/res-public/values-da-rDK/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-de-rDE/strings_commons.xml b/core/src/main/res-public/values-de-rDE/strings_commons.xml index 015b612..e67292c 100644 --- a/core/src/main/res-public/values-de-rDE/strings_commons.xml +++ b/core/src/main/res-public/values-de-rDE/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-es-rES/strings_commons.xml b/core/src/main/res-public/values-es-rES/strings_commons.xml index 7cab287..34e4aa7 100644 --- a/core/src/main/res-public/values-es-rES/strings_commons.xml +++ b/core/src/main/res-public/values-es-rES/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-fr-rFR/strings_commons.xml b/core/src/main/res-public/values-fr-rFR/strings_commons.xml index 2d681ff..89a9a99 100644 --- a/core/src/main/res-public/values-fr-rFR/strings_commons.xml +++ b/core/src/main/res-public/values-fr-rFR/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-gl-rES/strings_commons.xml b/core/src/main/res-public/values-gl-rES/strings_commons.xml index b9a5564..8b4d1b4 100644 --- a/core/src/main/res-public/values-gl-rES/strings_commons.xml +++ b/core/src/main/res-public/values-gl-rES/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-hu-rHU/strings_commons.xml b/core/src/main/res-public/values-hu-rHU/strings_commons.xml index 5488f1d..bae6c1e 100644 --- a/core/src/main/res-public/values-hu-rHU/strings_commons.xml +++ b/core/src/main/res-public/values-hu-rHU/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-in-rID/strings_commons.xml b/core/src/main/res-public/values-in-rID/strings_commons.xml index b734377..5532b67 100644 --- a/core/src/main/res-public/values-in-rID/strings_commons.xml +++ b/core/src/main/res-public/values-in-rID/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-it-rIT/strings_commons.xml b/core/src/main/res-public/values-it-rIT/strings_commons.xml index 821191e..c2d513a 100644 --- a/core/src/main/res-public/values-it-rIT/strings_commons.xml +++ b/core/src/main/res-public/values-it-rIT/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-ko-rKR/strings_commons.xml b/core/src/main/res-public/values-ko-rKR/strings_commons.xml index 112e8d5..48153cb 100644 --- a/core/src/main/res-public/values-ko-rKR/strings_commons.xml +++ b/core/src/main/res-public/values-ko-rKR/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-no-rNO/strings_commons.xml b/core/src/main/res-public/values-no-rNO/strings_commons.xml index c18b439..e27f20d 100644 --- a/core/src/main/res-public/values-no-rNO/strings_commons.xml +++ b/core/src/main/res-public/values-no-rNO/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-pl-rPL/strings_commons.xml b/core/src/main/res-public/values-pl-rPL/strings_commons.xml index 248e409..323a0ff 100644 --- a/core/src/main/res-public/values-pl-rPL/strings_commons.xml +++ b/core/src/main/res-public/values-pl-rPL/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-pt-rBR/strings_commons.xml b/core/src/main/res-public/values-pt-rBR/strings_commons.xml index 716e373..4eaea6c 100644 --- a/core/src/main/res-public/values-pt-rBR/strings_commons.xml +++ b/core/src/main/res-public/values-pt-rBR/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-pt-rPT/strings_commons.xml b/core/src/main/res-public/values-pt-rPT/strings_commons.xml new file mode 100644 index 0000000..863b8b7 --- /dev/null +++ b/core/src/main/res-public/values-pt-rPT/strings_commons.xml @@ -0,0 +1,71 @@ + + + + + Acerca + Acerca de %s + Adicionar conta + Voltar + Cancelar + Registo de alterações + Fechar + Contacte-nos + Copiar + Personalizada + Escuro + Padrão + Não mostrar novamente + Feito + Erro + Sair + Tem a certeza de que deseja sair? + Tem a certeza de que deseja sair de %s? + Vidro + Percebi + Excelente + Ocultar + Claro + Iniciar sessão + Sair + Tem a certeza de que deseja sair como %s? + Gerir conta + Talvez + Menu + Não + Não existem resultados + Nenhum + OK + Play Store + Avaliar + Comunicar um erro + Procurar + Enviar comentários + Enviar via + Definições + Partilhar + Texto copiado para a área de transferência. + Obrigado + Bolas + Aviso + + %d dia + %d dias + + + %d hora + %d horas + + + %d minuto + %d minutos + + + %d segundo + %d segundos + + Sim + Permissão negada + diff --git a/core/src/main/res-public/values-sr-rSP/strings_commons.xml b/core/src/main/res-public/values-sr-rSP/strings_commons.xml new file mode 100644 index 0000000..213d876 --- /dev/null +++ b/core/src/main/res-public/values-sr-rSP/strings_commons.xml @@ -0,0 +1,75 @@ + + + + + О апликацији + О %s + Додајте налог + Назад + Откажи + Евиденција измена + Затвори + Контактирајте нас + Копирај + Прилагођено + Тамно + Подразумевано + Не приказуј поново + Готово + Грешка + Изађи + Да ли сте сигурни да желите да изађете? + Да ли сте сигурно желите да напустите %s? + Стакло + Разумем + Одлично + Сакриј + Светло + Пријава + Одјави се + Заиста желите да се одјавите са %s? + Управљај налозима + Можда + Мени + Не + Нема резултата + Ниједно + ОК + Плеј продавница + Оцени + Пријави грешку + Претражи + Пошаљите повратне информације + Пошаљи преко + Подешавања + Подели + Текст је копиран у привремену меморију. + Хвала + Јао не + Упозорење + + %d дан + %d дана + %d дана + + + %d сат + %d сати + %d сати + + + %d минут + %d минута + %d минута + + + %d секунду + %d сек + %d секунди + + Да + Немате овлашћења + diff --git a/core/src/main/res-public/values-sv-rSE/strings_commons.xml b/core/src/main/res-public/values-sv-rSE/strings_commons.xml index 6cc2bb3..8d4362b 100644 --- a/core/src/main/res-public/values-sv-rSE/strings_commons.xml +++ b/core/src/main/res-public/values-sv-rSE/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-th-rTH/strings_commons.xml b/core/src/main/res-public/values-th-rTH/strings_commons.xml index 2f4bdec..e47273d 100644 --- a/core/src/main/res-public/values-th-rTH/strings_commons.xml +++ b/core/src/main/res-public/values-th-rTH/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-tr-rTR/strings_commons.xml b/core/src/main/res-public/values-tr-rTR/strings_commons.xml index 1e8395e..b36ca43 100644 --- a/core/src/main/res-public/values-tr-rTR/strings_commons.xml +++ b/core/src/main/res-public/values-tr-rTR/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-uk-rUA/strings_commons.xml b/core/src/main/res-public/values-uk-rUA/strings_commons.xml index 60ca520..0f62c6a 100644 --- a/core/src/main/res-public/values-uk-rUA/strings_commons.xml +++ b/core/src/main/res-public/values-uk-rUA/strings_commons.xml @@ -1,4 +1,6 @@ - + @@ -48,6 +50,30 @@ Most resources are verbatim and x represents a formatted item Дякуємо Вам Ой-ой Увага + + %d день + %d днів + %d днів + %d днів + + + %d годину + %d годин + %d годин + %d годин + + + %d хвилини + %d хвилин + %d хвилин + %d хвилин + + + %d секунди + %d секунд + %d секунд + %d секунд + Так У доступі відмовлено diff --git a/core/src/main/res-public/values-vi-rVN/strings_commons.xml b/core/src/main/res-public/values-vi-rVN/strings_commons.xml index 767e628..a444dc2 100644 --- a/core/src/main/res-public/values-vi-rVN/strings_commons.xml +++ b/core/src/main/res-public/values-vi-rVN/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-zh-rCN/strings_commons.xml b/core/src/main/res-public/values-zh-rCN/strings_commons.xml index 47ddbda..66a7423 100644 --- a/core/src/main/res-public/values-zh-rCN/strings_commons.xml +++ b/core/src/main/res-public/values-zh-rCN/strings_commons.xml @@ -1,4 +1,6 @@ - + diff --git a/core/src/main/res-public/values-zh-rTW/strings_commons.xml b/core/src/main/res-public/values-zh-rTW/strings_commons.xml new file mode 100644 index 0000000..bf9f59b --- /dev/null +++ b/core/src/main/res-public/values-zh-rTW/strings_commons.xml @@ -0,0 +1,67 @@ + + + + + 關於此程式 + 關於 %s + 新增帳號 + 回上頁 + 取消 + 更新資訊 + 關閉 + 與我們聯繫 + 複製 + 自訂 + 黑色主題 + 默認 + 不要再顯示 + 完成 + 錯誤 + 結束 + 您確定要離開嗎? + 您確定要離開%s嗎? + 玻璃 + 知道了 + + 隱藏 + 亮色調 + 登入 + 登出 + 您確定要登出%s嗎? + 帳戶管理 + 可能 + 選單 + + 找不到相符的結果 + + 確定 + Play商店 + 評分 + 回報程式錯誤 + 搜尋 + 回饋意見 + 來發送 + 設定 + 分享 + 文字已複製到剪貼簿 + 感謝 + 噢! + 警告 + + %d 天 + + + %d 小時 + + + %d 分鐘 + + + %d 秒 + + + 權限不足 + diff --git a/files/translation_migration.sh b/files/translation_migration.sh index 9adfdc4..0def30f 100644 --- a/files/translation_migration.sh +++ b/files/translation_migration.sh @@ -15,3 +15,4 @@ else find . -type d -empty -delete fi +echo "Finished cleaning files" \ No newline at end of file diff --git a/mediapicker/src/main/res/values-da-rDK/strings_mediapicker.xml b/mediapicker/src/main/res/values-da-rDK/strings_mediapicker.xml index d3636d3..6f37f28 100644 --- a/mediapicker/src/main/res/values-da-rDK/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-da-rDK/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Ingen elementer fundet Ingen elementer er valgt diff --git a/mediapicker/src/main/res/values-de-rDE/strings_mediapicker.xml b/mediapicker/src/main/res/values-de-rDE/strings_mediapicker.xml index ae441cc..ff49433 100644 --- a/mediapicker/src/main/res/values-de-rDE/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-de-rDE/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Keine Elemente gefunden Keine Datei ausgewählt diff --git a/mediapicker/src/main/res/values-es-rES/strings_mediapicker.xml b/mediapicker/src/main/res/values-es-rES/strings_mediapicker.xml index 21da558..72b8903 100644 --- a/mediapicker/src/main/res/values-es-rES/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-es-rES/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + No se encontraron elementos No se han seleccionado elementos diff --git a/mediapicker/src/main/res/values-fr-rFR/strings_mediapicker.xml b/mediapicker/src/main/res/values-fr-rFR/strings_mediapicker.xml index 1705e9e..99a68d4 100644 --- a/mediapicker/src/main/res/values-fr-rFR/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-fr-rFR/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Aucun élément trouvé Aucun élément n\'a été sélectionné diff --git a/mediapicker/src/main/res/values-gl-rES/strings_mediapicker.xml b/mediapicker/src/main/res/values-gl-rES/strings_mediapicker.xml index 1ad6650..831c96b 100644 --- a/mediapicker/src/main/res/values-gl-rES/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-gl-rES/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Ningún elemento atopado Ningún elemento seleccionado diff --git a/mediapicker/src/main/res/values-hu-rHU/strings_mediapicker.xml b/mediapicker/src/main/res/values-hu-rHU/strings_mediapicker.xml index b191d61..30b6a1b 100644 --- a/mediapicker/src/main/res/values-hu-rHU/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-hu-rHU/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Nem található elem Nincs kijelölt elem diff --git a/mediapicker/src/main/res/values-in-rID/strings_mediapicker.xml b/mediapicker/src/main/res/values-in-rID/strings_mediapicker.xml index 8f64d74..3980589 100644 --- a/mediapicker/src/main/res/values-in-rID/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-in-rID/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Item tidak ditemukan Tidak ada item yang dipilih diff --git a/mediapicker/src/main/res/values-it-rIT/strings_mediapicker.xml b/mediapicker/src/main/res/values-it-rIT/strings_mediapicker.xml index 4b795b1..f712b12 100644 --- a/mediapicker/src/main/res/values-it-rIT/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-it-rIT/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Nessun elemento trovato Non è stato selezionato alcun elemento diff --git a/mediapicker/src/main/res/values-ko-rKR/strings_mediapicker.xml b/mediapicker/src/main/res/values-ko-rKR/strings_mediapicker.xml index aab5e63..26793bc 100644 --- a/mediapicker/src/main/res/values-ko-rKR/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-ko-rKR/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + 항목이 없습니다. 선택된 항목이 없습니다. diff --git a/mediapicker/src/main/res/values-no-rNO/strings_mediapicker.xml b/mediapicker/src/main/res/values-no-rNO/strings_mediapicker.xml index 7b251bc..9ee6501 100644 --- a/mediapicker/src/main/res/values-no-rNO/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-no-rNO/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Ingen elementer funnet Ingen elementer har blitt valgt diff --git a/mediapicker/src/main/res/values-pl-rPL/strings_mediapicker.xml b/mediapicker/src/main/res/values-pl-rPL/strings_mediapicker.xml index 5aaaae1..7db61f8 100644 --- a/mediapicker/src/main/res/values-pl-rPL/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-pl-rPL/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Brak pozycji Brak wybranych pozycji diff --git a/mediapicker/src/main/res/values-pt-rBR/strings_mediapicker.xml b/mediapicker/src/main/res/values-pt-rBR/strings_mediapicker.xml index bac9913..62abec1 100644 --- a/mediapicker/src/main/res/values-pt-rBR/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-pt-rBR/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Nenhum item encontrado Nenhum item foi selecionado diff --git a/mediapicker/src/main/res/values-pt-rPT/strings_mediapicker.xml b/mediapicker/src/main/res/values-pt-rPT/strings_mediapicker.xml new file mode 100644 index 0000000..25b8c46 --- /dev/null +++ b/mediapicker/src/main/res/values-pt-rPT/strings_mediapicker.xml @@ -0,0 +1,11 @@ + + + + Nenhum item encontrado + Não foi selecionado nenhum item + Nenhum item carregado + Nenhuma câmara encontrada + Por favor instale um aplicação de câmara e tente novamente. + Falha ao criar um ficheiro temporário. + Selecionar multimédia + diff --git a/mediapicker/src/main/res/values-sr-rSP/strings_mediapicker.xml b/mediapicker/src/main/res/values-sr-rSP/strings_mediapicker.xml new file mode 100644 index 0000000..abc3933 --- /dev/null +++ b/mediapicker/src/main/res/values-sr-rSP/strings_mediapicker.xml @@ -0,0 +1,11 @@ + + + + Није пронађена ниједна ставка + Ниједна ставка није одабрана + Нема учитаних ставки + Камера није пронађена + Инсталирајте апликацију за камеру и покушајте поново. + Креирање привремене датотеке није успело. + Одаберите мултимедију + diff --git a/mediapicker/src/main/res/values-sv-rSE/strings_mediapicker.xml b/mediapicker/src/main/res/values-sv-rSE/strings_mediapicker.xml index 15f991f..0909d2f 100644 --- a/mediapicker/src/main/res/values-sv-rSE/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-sv-rSE/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Inga objekt hittades Inga objekt har valts diff --git a/mediapicker/src/main/res/values-th-rTH/strings_mediapicker.xml b/mediapicker/src/main/res/values-th-rTH/strings_mediapicker.xml index 3e97c66..83bd30c 100644 --- a/mediapicker/src/main/res/values-th-rTH/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-th-rTH/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + ไม่พบรายการ ยังไม่ได้เลือกรายการ diff --git a/mediapicker/src/main/res/values-tr-rTR/strings_mediapicker.xml b/mediapicker/src/main/res/values-tr-rTR/strings_mediapicker.xml index 55e90b4..601432f 100644 --- a/mediapicker/src/main/res/values-tr-rTR/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-tr-rTR/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Hiç bir öge bulunamadı Hiç bir öge seçilmemişti diff --git a/mediapicker/src/main/res/values-uk-rUA/strings_mediapicker.xml b/mediapicker/src/main/res/values-uk-rUA/strings_mediapicker.xml index 6dc767e..f8a9725 100644 --- a/mediapicker/src/main/res/values-uk-rUA/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-uk-rUA/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Нічого не знайдено Жодного елементу не обрано diff --git a/mediapicker/src/main/res/values-vi-rVN/strings_mediapicker.xml b/mediapicker/src/main/res/values-vi-rVN/strings_mediapicker.xml index dae9f41..9d5fe5d 100644 --- a/mediapicker/src/main/res/values-vi-rVN/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-vi-rVN/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + Không tìm thấy mục nào Chưa chọn mục nào diff --git a/mediapicker/src/main/res/values-zh-rCN/strings_mediapicker.xml b/mediapicker/src/main/res/values-zh-rCN/strings_mediapicker.xml index 2be3fc0..b05f922 100644 --- a/mediapicker/src/main/res/values-zh-rCN/strings_mediapicker.xml +++ b/mediapicker/src/main/res/values-zh-rCN/strings_mediapicker.xml @@ -1,4 +1,5 @@ - + + 未找到项目 没有选择任何项目 diff --git a/mediapicker/src/main/res/values-zh-rTW/strings_mediapicker.xml b/mediapicker/src/main/res/values-zh-rTW/strings_mediapicker.xml new file mode 100644 index 0000000..1ecb9e0 --- /dev/null +++ b/mediapicker/src/main/res/values-zh-rTW/strings_mediapicker.xml @@ -0,0 +1,11 @@ + + + + 什麼也沒有 + 什麼也沒選到 + 什麼也沒載入 + 找不到相機 + 請安裝相機應用程式然後重試 + 無法建立暫存檔 + 選取媒體 + diff --git a/searchview/README.md b/searchview/README.md index 37d059a..4d6f010 100644 --- a/searchview/README.md +++ b/searchview/README.md @@ -9,4 +9,4 @@ The searchview is: * Fully themable - set the foreground or background color to style every portion, from text colors to backgrounds to ripples * Complete - binding the search view to a menu id will set the menu icon (if not previously set) and attach all the necessary listeners * Configurable - modify any portion of the inner Config class when binding the search view -* Debouncable - specify a time interval to throttle your queries; see [debouncing](/core#debounce) \ No newline at end of file +* Debouncable - specify a time interval to throttle your queries; see [debouncing](../core#debounce) -- cgit v1.2.3 From 3f5ce21205354c087f83b0bd182cb6727c4ca3fe Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 4 Apr 2019 15:56:07 -0400 Subject: Remove legacy descriptions --- README.md | 8 -------- docs/Changelog.md | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e584f9b..47a1414 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ -**Note: v3.8.0 is the last release with support dependencies. Starting with 4.0.0-alpha01, androidx will be used** - ---- - KAU @@ -39,8 +35,6 @@ allprojects { } ``` -(If you are using gradle < 4.0, use `maven { url "https://maven.google.com" }` instead of `google()`) - And add the following dependencies (You can use a specific version, commit, or -SNAPSHOT): Note that only `core` is required if you want the basic features. @@ -75,8 +69,6 @@ buildscript { ``` -(If you are using gradle < 4.0, use `compile` instead of `implementation`) - ----------- # Submodules diff --git a/docs/Changelog.md b/docs/Changelog.md index 021a0f1..f8054af 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,8 @@ # Changelog +## v4.0.0 +* Update translations + ## v4.0.0-alpha02 * Update translations * :core: Remove anko dependency. Methods that used it now use coroutines; see the migration doc for minor changes -- cgit v1.2.3 From 9240538d9517d591f9f04d18be45db564b2dfd77 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 7 Jun 2019 12:25:14 -0400 Subject: Update color picker docs --- README.md | 1 - colorpicker/README.md | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 47a1414..0293545 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,6 @@ This means that you'll need to explicitly include each submodule you'd like to u ![About Activity Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_about_activity.gif) ![Ink Indicator Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_ink_indicator.gif) ![Color Picker Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_color_picker.gif) -![Color Picker Custom Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_color_picker_custom.gif) ![KPref Items Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_kpref_items.gif) ![SearchView Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_search_view.gif) ![Swipe Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_swipe.gif) diff --git a/colorpicker/README.md b/colorpicker/README.md index c90809e..16977a9 100644 --- a/colorpicker/README.md +++ b/colorpicker/README.md @@ -1,10 +1,9 @@ # KAU :colorpicker -Material Dialogs by default contains a color picker, but it requires an activity that also implements the color callback. -KAU's colorpicker decouples the two, so it only needs a context and a separate callback. -The color picker also animates the selection, and uses Kotlin's DSL to provide easy calling. +As of Material Dialog 2.x, `:colorpicker` is effectively a very thin wrapper around [Material Dialog's color picker](https://github.com/afollestad/material-dialogs/blob/master/documentation/COLOR.md). +The main difference is that it exposes an interface internal to KAU, which allows a greater level of consistency within other submodules. +It also contains an extra palette for accent colors. -To use it, call `Context.colorPickerDialog` and specify and configs as required through the builder. +To use it, call `MaterialDialog.kauColorChooser` and specify the configs. ![Color Picker Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_color_picker.gif) -![Color Picker Custom Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_color_picker_custom.gif) \ No newline at end of file -- cgit v1.2.3