├── about ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ ├── strings_about.xml │ │ │ └── strings_about_kau.xml │ │ ├── values-zh-rCN │ │ │ └── strings_about.xml │ │ ├── values-zh-rTW │ │ │ └── strings_about.xml │ │ ├── values-ko-rKR │ │ │ └── strings_about.xml │ │ ├── values-ja-rJP │ │ │ └── strings_about.xml │ │ ├── values-th-rTH │ │ │ └── strings_about.xml │ │ ├── values-fr-rFR │ │ │ └── strings_about.xml │ │ ├── values-sr-rSP │ │ │ └── strings_about.xml │ │ ├── values-ar-rSA │ │ │ └── strings_about.xml │ │ ├── values-cs-rCZ │ │ │ └── strings_about.xml │ │ ├── values-hu-rHU │ │ │ └── strings_about.xml │ │ ├── values-pl-rPL │ │ │ └── strings_about.xml │ │ ├── values-pt-rPT │ │ │ └── strings_about.xml │ │ ├── values-ru-rRU │ │ │ └── strings_about.xml │ │ ├── values-ta-rIN │ │ │ └── strings_about.xml │ │ ├── values-uk-rUA │ │ │ └── strings_about.xml │ │ ├── values-ca-rES │ │ │ └── strings_about.xml │ │ ├── values-fi-rFI │ │ │ └── strings_about.xml │ │ ├── values-tr-rTR │ │ │ └── strings_about.xml │ │ ├── values-in-rID │ │ │ └── strings_about.xml │ │ ├── values-sv-rSE │ │ │ └── strings_about.xml │ │ ├── values-vi-rVN │ │ │ └── strings_about.xml │ │ ├── values-el-rGR │ │ │ └── strings_about.xml │ │ ├── values-ml-rIN │ │ │ └── strings_about.xml │ │ ├── values-nl-rNL │ │ │ └── strings_about.xml │ │ ├── values-da-rDK │ │ │ └── strings_about.xml │ │ ├── values-de-rDE │ │ │ └── strings_about.xml │ │ ├── values-es-rES │ │ │ └── strings_about.xml │ │ ├── values-it-rIT │ │ │ └── strings_about.xml │ │ ├── values-pt-rBR │ │ │ └── strings_about.xml │ │ ├── values-tl-rPH │ │ │ └── strings_about.xml │ │ ├── values-gl-rES │ │ │ └── strings_about.xml │ │ ├── values-no-rNO │ │ │ └── strings_about.xml │ │ └── layout │ │ │ ├── kau_iitem_cutout.xml │ │ │ ├── kau_activity_about.xml │ │ │ ├── kau_about_section_libraries.xml │ │ │ └── kau_iitem_faq.xml │ │ ├── res-public │ │ └── values │ │ │ └── styles.xml │ │ └── kotlin │ │ └── ca │ │ └── allanwang │ │ └── kau │ │ └── about │ │ ├── AboutBinder.kt │ │ ├── CollapsibleTextView.kt │ │ └── CutoutIItem.kt ├── progress-proguard.txt ├── build.gradle └── README.md ├── core ├── .gitignore ├── progress-proguard.txt ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ │ ├── values │ │ │ │ ├── internal.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── constraintLayout_attr.xml │ │ │ │ ├── attr.xml │ │ │ │ └── ids.xml │ │ │ ├── values-sw600dp │ │ │ │ └── internal.xml │ │ │ └── layout │ │ │ │ ├── kau_changelog_title.xml │ │ │ │ └── kau_changelog_content.xml │ │ ├── res-public │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── dimens.xml │ │ │ ├── drawable │ │ │ │ ├── kau_transparent.xml │ │ │ │ └── kau_selectable_white.xml │ │ │ ├── anim │ │ │ │ ├── kau_fade_in.xml │ │ │ │ ├── kau_fade_out.xml │ │ │ │ ├── kau_slide_in_left.xml │ │ │ │ ├── kau_slide_in_right.xml │ │ │ │ ├── kau_slide_in_top.xml │ │ │ │ ├── kau_slide_out_top.xml │ │ │ │ ├── kau_slide_in_bottom.xml │ │ │ │ ├── kau_slide_out_bottom.xml │ │ │ │ ├── kau_slide_out_left.xml │ │ │ │ ├── kau_slide_out_right.xml │ │ │ │ ├── kau_slide_out_left_top.xml │ │ │ │ └── kau_slide_out_right_top.xml │ │ │ ├── drawable-v21 │ │ │ │ └── kau_selectable_white.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ └── transition-v21 │ │ │ │ ├── kau_exit_slide_left.xml │ │ │ │ ├── kau_exit_slide_top.xml │ │ │ │ ├── kau_exit_slide_bottom.xml │ │ │ │ ├── kau_exit_slide_right.xml │ │ │ │ ├── kau_enter_slide_left.xml │ │ │ │ ├── kau_enter_slide_top.xml │ │ │ │ ├── kau_enter_slide_bottom.xml │ │ │ │ └── kau_enter_slide_right.xml │ │ └── kotlin │ │ │ └── ca │ │ │ └── allanwang │ │ │ └── kau │ │ │ ├── swipe │ │ │ ├── ViewDragHelperExtras.java │ │ │ └── SwipeListener.kt │ │ │ ├── kotlin │ │ │ ├── Utils.kt │ │ │ ├── LazyUi.kt │ │ │ └── Streams.kt │ │ │ ├── utils │ │ │ ├── FragmentUtils.kt │ │ │ ├── NotificationUtils.kt │ │ │ ├── FileUtils.kt │ │ │ ├── AnimHolder.kt │ │ │ ├── DrawableUtils.kt │ │ │ ├── Const.kt │ │ │ ├── IIconUtils.kt │ │ │ ├── RecyclerUtils.kt │ │ │ └── FontUtils.kt │ │ │ ├── logging │ │ │ └── KL.kt │ │ │ ├── kpref │ │ │ └── KPrefFactory.kt │ │ │ ├── ui │ │ │ └── SimpleRippleDrawable.kt │ │ │ └── permissions │ │ │ └── PermissionResult.kt │ ├── androidTest │ │ ├── res │ │ │ └── xml │ │ │ │ ├── test_faq.xml │ │ │ │ └── test_changelog.xml │ │ └── kotlin │ │ │ └── ca │ │ │ └── allanwang │ │ │ └── kau │ │ │ ├── Utils.kt │ │ │ └── xml │ │ │ └── FaqTest.kt │ └── test │ │ └── kotlin │ │ └── ca │ │ └── allanwang │ │ └── kau │ │ └── kotlin │ │ ├── LazyResettableTest.kt │ │ ├── StreamsTest.kt │ │ ├── DebounceTest.kt │ │ └── CoroutineTest.kt └── build.gradle ├── sample ├── .gitignore ├── src │ ├── main │ │ ├── play │ │ │ ├── default-language.txt │ │ │ ├── contact-email.txt │ │ │ ├── listings │ │ │ │ └── en-CA │ │ │ │ │ └── listing │ │ │ │ │ ├── title-txt │ │ │ │ │ ├── short-description.txt │ │ │ │ │ └── full-description.txt │ │ │ └── release-notes │ │ │ │ └── en-CA │ │ │ │ └── default.txt │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings_sample.xml │ │ │ ├── xml │ │ │ │ ├── kau_file_paths.xml │ │ │ │ └── kau_faq.xml │ │ │ ├── layout │ │ │ │ ├── sample.xml │ │ │ │ └── permission_checkbox.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── drawable │ │ │ │ └── kau.xml │ │ └── kotlin │ │ │ └── ca │ │ │ └── allanwang │ │ │ └── kau │ │ │ └── sample │ │ │ ├── SampleApp.kt │ │ │ ├── AboutActivity.kt │ │ │ └── MediaPicker.kt │ └── androidTest │ │ └── kotlin │ │ └── ca │ │ └── allanwang │ │ └── kau │ │ └── sample │ │ ├── test │ │ ├── BaseTest.kt │ │ └── PrefFactoryTestModule.kt │ │ └── utils │ │ └── EspressoUtils.kt └── proguard-rules.pro ├── Gemfile ├── adapter ├── .gitignore ├── progress-proguard.txt ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── layout │ │ │ └── kau_iitem_header.xml │ │ └── kotlin │ │ └── ca │ │ └── allanwang │ │ └── kau │ │ └── animators │ │ └── AnimatorInterfaces.kt ├── build.gradle └── README.md ├── colorpicker ├── .gitignore ├── progress-proguard.txt ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── res-public │ │ └── values │ │ └── attrs.xml ├── build.gradle └── README.md ├── core-ui ├── .gitignore ├── progress-proguard.txt ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res-public │ │ ├── values-v21 │ │ │ └── styles.xml │ │ ├── values │ │ │ ├── public.xml │ │ │ └── styles.xml │ │ └── layout │ │ │ ├── kau_recycler_detached_background.xml │ │ │ └── kau_recycler_textslider.xml │ │ ├── kotlin │ │ └── ca │ │ │ └── allanwang │ │ │ └── kau │ │ │ └── ui │ │ │ └── views │ │ │ └── MeasuredImageView.kt │ │ └── res │ │ └── values │ │ └── attr.xml ├── build.gradle └── README.md ├── fastadapter ├── .gitignore ├── progress-proguard.txt ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── layout │ │ │ └── kau_iitem_header.xml │ │ └── kotlin │ │ └── ca │ │ └── allanwang │ │ └── kau │ │ ├── iitems │ │ └── KauIItem.kt │ │ └── adapters │ │ └── AdapterUtils.kt ├── build.gradle └── README.md ├── mediapicker ├── .gitignore ├── progress-proguard.txt ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ ├── values │ │ │ ├── ids.xml │ │ │ └── strings_mediapicker.xml │ │ ├── layout │ │ │ ├── kau_iitem_image.xml │ │ │ ├── kau_iitem_image_basic.xml │ │ │ └── kau_blurred_imageview.xml │ │ ├── values-zh-rTW │ │ │ └── strings_mediapicker.xml │ │ ├── values-zh-rCN │ │ │ └── strings_mediapicker.xml │ │ ├── transition-v21 │ │ │ ├── kau_image_enter.xml │ │ │ ├── kau_image_exit_top.xml │ │ │ └── kau_image_exit_bottom.xml │ │ ├── values-ko-rKR │ │ │ └── strings_mediapicker.xml │ │ ├── values-ja-rJP │ │ │ └── strings_mediapicker.xml │ │ ├── values-th-rTH │ │ │ └── strings_mediapicker.xml │ │ ├── values-ar-rSA │ │ │ └── strings_mediapicker.xml │ │ ├── values-vi-rVN │ │ │ └── strings_mediapicker.xml │ │ ├── values-pl-rPL │ │ │ └── strings_mediapicker.xml │ │ ├── values-sv-rSE │ │ │ └── strings_mediapicker.xml │ │ ├── values-fi-rFI │ │ │ └── strings_mediapicker.xml │ │ ├── values-in-rID │ │ │ └── strings_mediapicker.xml │ │ ├── values-tr-rTR │ │ │ └── strings_mediapicker.xml │ │ ├── values-da-rDK │ │ │ └── strings_mediapicker.xml │ │ ├── values-tl-rPH │ │ │ └── strings_mediapicker.xml │ │ ├── values-gl-rES │ │ │ └── strings_mediapicker.xml │ │ ├── values-hu-rHU │ │ │ └── strings_mediapicker.xml │ │ ├── values-no-rNO │ │ │ └── strings_mediapicker.xml │ │ ├── values-pt-rBR │ │ │ └── strings_mediapicker.xml │ │ ├── values-ru-rRU │ │ │ └── strings_mediapicker.xml │ │ ├── values-de-rDE │ │ │ └── strings_mediapicker.xml │ │ ├── values-fr-rFR │ │ │ └── strings_mediapicker.xml │ │ ├── values-it-rIT │ │ │ └── strings_mediapicker.xml │ │ ├── values-nl-rNL │ │ │ └── strings_mediapicker.xml │ │ ├── values-uk-rUA │ │ │ └── strings_mediapicker.xml │ │ ├── values-ca-rES │ │ │ └── strings_mediapicker.xml │ │ ├── values-pt-rPT │ │ │ └── strings_mediapicker.xml │ │ ├── values-sr-rSP │ │ │ └── strings_mediapicker.xml │ │ ├── values-cs-rCZ │ │ │ └── strings_mediapicker.xml │ │ ├── values-el-rGR │ │ │ └── strings_mediapicker.xml │ │ ├── values-es-rES │ │ │ └── strings_mediapicker.xml │ │ ├── values-ml-rIN │ │ │ └── strings_mediapicker.xml │ │ ├── values-ta-rIN │ │ │ └── strings_mediapicker.xml │ │ └── layout-v21 │ │ │ └── kau_activity_image_picker_overlay.xml │ │ ├── res-public │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ └── values-v21 │ │ │ └── styles.xml │ │ └── kotlin │ │ └── ca │ │ └── allanwang │ │ └── kau │ │ └── mediapicker │ │ ├── GlideHelper.kt │ │ └── MediaType.kt └── build.gradle ├── searchview ├── .gitignore ├── progress-proguard.txt ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── values │ │ │ ├── ids.xml │ │ │ └── dimens.xml │ │ └── kotlin │ │ └── ca │ │ └── allanwang │ │ └── kau │ │ └── searchview │ │ └── SearchViewHolder.kt ├── build.gradle └── README.md ├── kpref-activity ├── .gitignore ├── progress-proguard.txt ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ ├── values │ │ │ └── strings.xml │ │ └── layout │ │ │ ├── kau_pref_checkbox.xml │ │ │ ├── kau_pref_color.xml │ │ │ ├── kau_pref_seekbar.xml │ │ │ ├── kau_pref_text.xml │ │ │ ├── kau_pref_seekbar_text.xml │ │ │ ├── kau_pref_header.xml │ │ │ └── kau_pref_activity.xml │ │ ├── kotlin │ │ └── ca │ │ │ └── allanwang │ │ │ └── kau │ │ │ └── kpref │ │ │ └── activity │ │ │ ├── KPrefItemActions.kt │ │ │ ├── KClick.kt │ │ │ └── items │ │ │ ├── KPrefHeader.kt │ │ │ ├── KPrefPlainText.kt │ │ │ ├── KPrefCheckbox.kt │ │ │ └── KPrefSubItems.kt │ │ └── res-public │ │ └── values │ │ └── ids.xml └── build.gradle ├── .jitpack.yml ├── fastadapter-viewbinding ├── consumer-rules.pro ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── res │ │ └── values │ │ └── ids.xml ├── build.gradle └── proguard-rules.pro ├── files ├── kau.tar.enc ├── debug.keystore ├── kau_github.tar.gpg ├── images │ ├── kau_banner.png │ ├── kau_round_512.png │ └── logo.svg ├── .gitignore ├── travis.sh ├── github_actions.sh └── translation_migration.sh ├── favicon ├── favicon.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── mstile-150x150.png ├── apple-touch-icon.png ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── browserconfig.xml ├── site.webmanifest └── safari-pinned-tab.svg ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── encodings.xml ├── codeStyles │ └── codeStyleConfig.xml ├── compiler.xml ├── kotlinScripting.xml ├── inspectionProfiles │ ├── profiles_settings.xml │ └── ktlint.xml ├── ktfmt.xml ├── copyright │ └── Apache.xml └── jarRepositories.xml ├── _config.yml ├── spotless.gradle ├── settings.gradle ├── crowdin.yml ├── spotless.license.kt ├── .github ├── FUNDING.yml └── workflows │ └── android.yml ├── gradle.properties └── .gitignore /about/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /core/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | gem "jekyll-readme-index" -------------------------------------------------------------------------------- /adapter/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /colorpicker/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /core-ui/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /core/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /fastadapter/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mediapicker/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /searchview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /adapter/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /colorpicker/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /core-ui/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /fastadapter/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kpref-activity/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mediapicker/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /searchview/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.jitpack.yml: -------------------------------------------------------------------------------- 1 | jdk: 2 | - openjdk11 3 | -------------------------------------------------------------------------------- /fastadapter-viewbinding/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kpref-activity/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /fastadapter-viewbinding/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample/src/main/play/default-language.txt: -------------------------------------------------------------------------------- 1 | en-CA -------------------------------------------------------------------------------- /sample/src/main/play/contact-email.txt: -------------------------------------------------------------------------------- 1 | pitchedapps@gmail.com -------------------------------------------------------------------------------- /core/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/src/main/play/listings/en-CA/listing/title-txt: -------------------------------------------------------------------------------- 1 | KAU - Library Showcase -------------------------------------------------------------------------------- /core-ui/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /files/kau.tar.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/files/kau.tar.enc -------------------------------------------------------------------------------- /about/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /adapter/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/favicon/favicon.ico -------------------------------------------------------------------------------- /files/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/files/debug.keystore -------------------------------------------------------------------------------- /sample/src/main/play/release-notes/en-CA/default.txt: -------------------------------------------------------------------------------- 1 | A full changelog is available in the app -------------------------------------------------------------------------------- /colorpicker/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /fastadapter/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /files/kau_github.tar.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/files/kau_github.tar.gpg -------------------------------------------------------------------------------- /mediapicker/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /searchview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /favicon/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/favicon/mstile-150x150.png -------------------------------------------------------------------------------- /files/images/kau_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/files/images/kau_banner.png -------------------------------------------------------------------------------- /kpref-activity/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /sample/src/main/play/listings/en-CA/listing/short-description.txt: -------------------------------------------------------------------------------- 1 | A simple showcase for Kotlin Android Utils -------------------------------------------------------------------------------- /files/images/kau_round_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/files/images/kau_round_512.png -------------------------------------------------------------------------------- /about/progress-proguard.txt: -------------------------------------------------------------------------------- 1 | -keepclasseswithmembers class **.R$* { 2 | public static final int define_*; 3 | } 4 | -------------------------------------------------------------------------------- /favicon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/favicon/android-chrome-192x192.png -------------------------------------------------------------------------------- /favicon/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/favicon/android-chrome-512x512.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fastadapter-viewbinding/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /files/.gitignore: -------------------------------------------------------------------------------- 1 | gplay-keys.json 2 | kau.keystore 3 | kau.properties 4 | update-dev.sh 5 | kau.tar 6 | kau_github.tar 7 | -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -ignorewarnings 2 | -dontwarn kotlin.** 3 | # Iconics 4 | -keep class .R 5 | -keep class **.R$* { 6 | ; 7 | } -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllanWang/KAU/HEAD/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /core/src/main/res/values/internal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | -------------------------------------------------------------------------------- /core/src/main/res/values-sw600dp/internal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /about/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 224dp 4 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /core/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Cannot resolve email activity 4 | -------------------------------------------------------------------------------- /about/src/main/res-public/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mediapicker/src/main/res-public/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':core', 2 | ':core-ui', 3 | 4 | ':about', 5 | ':adapter', 6 | ':fastadapter', 7 | ':fastadapter-viewbinding', 8 | ':colorpicker', 9 | ':mediapicker', 10 | ':kpref-activity', 11 | ':searchview', 12 | 13 | ':gradle-plugin' 14 | 15 | if (!System.env.JITPACK) 16 | include ':sample' 17 | 18 | project(":gradle-plugin").projectDir = file("buildSrc") -------------------------------------------------------------------------------- /fastadapter/build.gradle: -------------------------------------------------------------------------------- 1 | import kau.Dependencies 2 | import kau.Versions 3 | 4 | ext.kauSubModuleMinSdk = Versions.coreMinSdk 5 | 6 | apply from: '../android-lib.gradle' 7 | 8 | dependencies { 9 | implementation project(':core') 10 | api project(':adapter') 11 | 12 | api Dependencies.fastAdapter 13 | api Dependencies.fastAdapter("utils") 14 | implementation Dependencies.fastAdapter("diff") 15 | } 16 | 17 | apply from: '../artifacts.gradle' 18 | -------------------------------------------------------------------------------- /files/translation_migration.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | MODULE=KAU 4 | 5 | cd .. 6 | 7 | current=${PWD##*/} 8 | 9 | if [[ "$current" != "$MODULE" ]]; then 10 | echo "Not in $MODULE"; 11 | else 12 | # DANGEROUS! Removes all files matching regex 13 | grep -Lir "" --include="strings*.xml" "." | tr '\n' '\0' | xargs -0 -n1 rm 14 | # Delete empty directories 15 | find . -type d -empty -delete 16 | fi 17 | 18 | echo "Finished cleaning files" -------------------------------------------------------------------------------- /kpref-activity/src/main/res/layout/kau_pref_text.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kpref-activity/build.gradle: -------------------------------------------------------------------------------- 1 | import kau.Dependencies 2 | 3 | ext.kauSubModuleMinSdk = kau.Versions.coreMinSdk 4 | 5 | ext.kauSubModuleResourcePrefix = "kau_pref_" 6 | 7 | apply from: '../android-lib.gradle' 8 | 9 | dependencies { 10 | implementation project(':core') 11 | implementation project(':colorpicker') 12 | implementation project(':fastadapter') 13 | 14 | implementation kau.Dependencies.materialDialog("color") 15 | } 16 | 17 | apply from: '../artifacts.gradle' 18 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/layout/kau_iitem_image.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /core/src/main/res-public/drawable/kau_selectable_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /about/src/main/res/layout/kau_iitem_cutout.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /favicon/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#ffffff", 17 | "background_color": "#ffffff", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /core/src/main/res/values/constraintLayout_attr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /adapter/README.md: -------------------------------------------------------------------------------- 1 | # KAU :adapter 2 | 3 | Helpers dealing with recyclerviews and adapters 4 | 5 | ## KauAnimator 6 | 7 | Abstract base that decouples the animations into three parts: `add`, `remove`, and `change`. 8 | Each component extends `KauAnimatorAdd`, `KauAnimatorRemove`, or `KauAnimatorChange` respectively. 9 | All the changes in the original animator are removed, so you have complete control over the transitions. 10 | There are a couple base animators, such as fade scale and slide, which can be mix and matched and added to `KauAnimator` -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-zh-rTW/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 什麼也沒有 4 | 什麼也沒選到 5 | 什麼也沒載入 6 | 找不到相機 7 | 請安裝相機應用程式然後重試 8 | 無法建立暫存檔 9 | 選取媒體 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-zh-rCN/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 未找到项目 4 | 没有选择任何项目 5 | 未载入任何项目 6 | 找不到摄像头 7 | 请安装一个摄像头应用程序,然后重试。 8 | 创建临时文件失败。 9 | 选择媒体 10 | 11 | -------------------------------------------------------------------------------- /kpref-activity/src/main/res/layout/kau_pref_seekbar_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/transition-v21/kau_image_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/transition-v21/kau_image_exit_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/transition-v21/kau_image_exit_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-ko-rKR/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 항목이 없습니다. 4 | 선택된 항목이 없습니다. 5 | 가져온 항목이 없습니다. 6 | 카메라를 찾을 수 없습니다. 7 | 카메라 앱을 설치하고 다시 시도하세요. 8 | 임시 파일을 만들지 못했습니다. 9 | 미디어 선택 10 | 11 | -------------------------------------------------------------------------------- /core/build.gradle: -------------------------------------------------------------------------------- 1 | ext.kauSubModuleMinSdk = kau.Versions.coreMinSdk 2 | 3 | apply from: '../android-lib.gradle' 4 | 5 | dependencies { 6 | api kau.Dependencies.kotlin 7 | 8 | api kau.Dependencies.appcompat 9 | api kau.Dependencies.recyclerView 10 | api kau.Dependencies.cardView 11 | api kau.Dependencies.constraintLayout 12 | api kau.Dependencies.googleMaterial 13 | 14 | api kau.Dependencies.coroutines 15 | 16 | api kau.Dependencies.iconics 17 | api kau.Dependencies.iconicsGoogle 18 | 19 | api kau.Dependencies.materialDialog 20 | } 21 | 22 | apply from: '../artifacts.gradle' 23 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-ja-rJP/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | アイテムが見つかりませんでした 4 | アイテムが選択されていません 5 | アイテムが読み込めませんでした 6 | カメラが見つかりません 7 | カメラのアプリをインストールして、もう一度やり直してください。 8 | 一時ファイルを作成できませんでした。 9 | メディアの選択 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/layout/kau_iitem_image_basic.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-th-rTH/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ไม่พบรายการ 4 | ยังไม่ได้เลือกรายการ 5 | ไม่มีรายการ 6 | ไม่พบกล้อง 7 | กรุณาติดตั้งแอพกล้องแล้วลองอีกครั้ง 8 | ไม่สามารถสร้างไฟล์ชั่วคราวได้ 9 | เลือกสื่อ 10 | 11 | -------------------------------------------------------------------------------- /colorpicker/README.md: -------------------------------------------------------------------------------- 1 | # KAU :colorpicker 2 | 3 | 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). 4 | The main difference is that it exposes an interface internal to KAU, which allows a greater level of consistency within other submodules. 5 | It also contains an extra palette for accent colors. 6 | 7 | To use it, call `MaterialDialog.kauColorChooser` and specify the configs. 8 | 9 | ![Color Picker Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_color_picker.gif) 10 | -------------------------------------------------------------------------------- /core/src/main/res/values/attr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | files: 2 | - source: /about/src/main/res/values/strings_about.xml 3 | translation: /about/src/main/res/values-%android_code%/strings_about.xml 4 | - source: /colorpicker/src/main/res/values/strings_colorpicker.xml 5 | translation: /colorpicker/src/main/res/values-%android_code%/strings_colorpicker.xml 6 | - source: /core/src/main/res-public/values/strings_commons.xml 7 | translation: /core/src/main/res-public/values-%android_code%/strings_commons.xml 8 | - source: /mediapicker/src/main/res/values/strings_mediapicker.xml 9 | translation: /mediapicker/src/main/res/values-%android_code%/strings_mediapicker.xml 10 | -------------------------------------------------------------------------------- /kpref-activity/src/main/res/layout/kau_pref_header.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/src/main/res-public/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | -------------------------------------------------------------------------------- /core-ui/src/main/res-public/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /spotless.license.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright $YEAR Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ -------------------------------------------------------------------------------- /core/src/main/res-public/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-ar-rSA/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | لم يتم العثور على أي عنصر 4 | لم يتم إختيار أي عنصر 5 | لم يتم تحميل أي عنصر 6 | لا توجد كاميرا 7 | يرجى تثبيت تطبيق كاميرا والمحاولة مجدداً. 8 | فشل في حفظ صورة مؤقتة. 9 | اختيار وسائط 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-vi-rVN/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Không tìm thấy mục nào 4 | Chưa chọn mục nào 5 | Không có mục nào 6 | Không tìm thấy máy ảnh 7 | Hãy cài một ứng dụng máy ảnh và thử lại. 8 | Không thể tạo tập tin tạm thời. 9 | Chọn kiểu 10 | 11 | -------------------------------------------------------------------------------- /core/src/main/res/layout/kau_changelog_title.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | -------------------------------------------------------------------------------- /files/images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-pl-rPL/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Brak pozycji 4 | Brak wybranych pozycji 5 | Brak załadowanych pozycji 6 | Brak aparatu 7 | Zainstaluj aplikację aparatu i spróbuj ponownie. 8 | Nie udało się utworzyć tymczasowego pliku. 9 | Wybierz media 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-sv-rSE/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inga objekt hittades 4 | Inga objekt har valts 5 | Inga objekt laddades 6 | Ingen kamera hittades 7 | Var snäll installera en kameraapp och försök igen. 8 | Kunde inte skapa en tillfällig fil. 9 | Välj Media 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-fi-rFI/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Kohteita ei löytynyt 4 | Ei valittua kohdetta 5 | Ei ladattuja kohteita 6 | Kameraa ei löytynyt 7 | Asenna kamerasovellus ja yritä uudelleen. 8 | Väliaikaisen tiedoston luominen epäonnistui. 9 | Valitse media 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-in-rID/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Item tidak ditemukan 4 | Tidak ada item yang dipilih 5 | Tidak ada item yang dimuat 6 | Kamera tidak ditemukan 7 | Mohon pasang aplikasi kamera dan coba lagi. 8 | Gagal membuat file sementara. 9 | Pilih Media 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-tr-rTR/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hiç bir öge bulunamadı 4 | Hiç bir öge seçilmemişti 5 | Hiç bir öge yüklenmedi 6 | Kamera bulunamadı 7 | Lütfen bir kamera uygulaması yükleyin ve tekrar deneyin. 8 | Geçici bir dosya oluşturulamadı. 9 | Medya Seç 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-da-rDK/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ingen elementer fundet 4 | Ingen elementer er valgt 5 | Ingen elementer er indlæst 6 | Intet kamera fundet 7 | Installer venligst en kamera-app og prøv igen. 8 | Kunne ikke oprette en midlertidig fil. 9 | Vælg medie 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-tl-rPH/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Walang nakitang item 4 | Walang item na sinelect 5 | Walang nakaload na item 6 | Walang nakitang camera 7 | Paki-install ng isang camera app at subukang muli. 8 | Nabigong gumawa ng temporary file. 9 | Magselect ng Media 10 | 11 | -------------------------------------------------------------------------------- /core-ui/src/main/res-public/values/public.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-gl-rES/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ningún elemento atopado 4 | Ningún elemento seleccionado 5 | Ningún elemento cargado 6 | Non se atopou a cámara 7 | Instala unha app da cámara e téntao de novo. 8 | Erro ao crear un ficheiro temporal. 9 | Seleccionar multimedia 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-hu-rHU/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nem található elem 4 | Nincs kijelölt elem 5 | Nincs betöltött elem 6 | Kamera nem található 7 | Kérem telepítse a kamera alkalmazást, majd próbálja újra. 8 | Nem sikerült létrehozni az ideiglenes fájlt. 9 | Média kiválasztása 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-no-rNO/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ingen elementer funnet 4 | Ingen elementer har blitt valgt 5 | Ingen elementer lastet 6 | Ingen kameraer funnet 7 | Vennligst installér en kameraapp og prøv på nytt. 8 | Kunne ikke opprette en midlertidig fil. 9 | Velg media 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-pt-rBR/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nenhum item encontrado 4 | Nenhum item foi selecionado 5 | Nenhum item carregado 6 | Nenhuma câmera encontrada 7 | Instale um aplicativo da câmera e tente novamente. 8 | Falha ao criar um arquivo temporário. 9 | Selecione mídia 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-ru-rRU/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Элементы не найдены 4 | Нет выбранных элементов 5 | Нет загруженных элементов 6 | Камера не найдена 7 | Пожалуйста, установите приложение камеры и попробуйте еще раз. 8 | Не удалось создать временный файл. 9 | Выбрать медиа 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-de-rDE/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Keine Elemente gefunden 4 | Keine Datei ausgewählt 5 | Keine Datei geladen 6 | Keine Kamera gefunden 7 | Bitte installieren Sie eine Kamera App und versuchen es erneut. 8 | Temporäre Datei konnte nicht erstellt werden. 9 | Wähle Mediendatei 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-fr-rFR/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aucun élément trouvé 4 | Aucun élément n\'a été sélectionné 5 | Aucun élément chargé 6 | Aucune caméra trouvée 7 | Veuillez installer un application photo et ré-essayez. 8 | Impossible de créer un fichier temporaire. 9 | Sélectionner un média 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-it-rIT/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nessun elemento trovato 4 | Non è stato selezionato alcun elemento 5 | Nessun elemento caricato 6 | Nessuna fotocamera è stata trovata 7 | Reinstalla l\'app fotocamera e riprova. 8 | Impossibile creare file temporaneo. 9 | Seleziona media 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-nl-rNL/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Geen items gevonden 4 | Er zijn geen items geselecteerd 5 | Er zijn geen items ingeladen 6 | Geen camera gevonden 7 | Installeer een camera-app en probeer het opnieuw. 8 | Kan tijdelijk bestand niet aanmaken. 9 | Kies een afbeelding of video 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-uk-rUA/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Нічого не знайдено 4 | Жодного елементу не обрано 5 | Немає елементів для завантаження 6 | Камери не знайдено 7 | Будь ласка, встановіть додаток для камери та повторіть спробу. 8 | Не вдалося створити тимчасовий файл. 9 | Оберіть медіафайл 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-ca-rES/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | No s\'han trobat ítems 4 | No s\'ha seleccionat cap ítem 5 | No s\'ha carregat cap ítem 6 | No s\'ha trobat cap càmera 7 | Instal·leu una aplicació Càmera i torneu-ho a provar. 8 | No s\'ha pogut crear el fitxer temporal. 9 | Seleccioneu mitjans 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-pt-rPT/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nenhum item encontrado 4 | Não foi selecionado nenhum item 5 | Nenhum item carregado 6 | Nenhuma câmara encontrada 7 | Por favor instale um aplicação de câmara e tente novamente. 8 | Falha ao criar um ficheiro temporário. 9 | Selecionar multimédia 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-sr-rSP/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Није пронађена ниједна ставка 4 | Ниједна ставка није одабрана 5 | Нема учитаних ставки 6 | Камера није пронађена 7 | Инсталирајте апликацију за камеру и покушајте поново. 8 | Креирање привремене датотеке није успело. 9 | Одаберите мултимедију 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-cs-rCZ/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nebyly nalezeny žádné položky 4 | Nebyly vybrány žádné položky 5 | Nebyly načteny žádné položky 6 | Nebyl nalezen žádný fotoaparát 7 | Nainstalujte si aplikaci Fotoaparát a zkuste to znovu. 8 | Vytvoření dočasného souboru se nezdařilo. 9 | Výběr médií 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-el-rGR/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Δεν βρέθηκαν στοιχεία 4 | Κανένα στοιχείο δεν έχει επιλεγεί 5 | Κανένα στοιχείο δεν έχει φορτώσει 6 | Δεν βρέθηκε κάμερα 7 | Παρακαλώ εγκαταστήστε μια εφαρμογή κάμερας και προσπαθήστε ξανά. 8 | Αποτυχία δημιουργίας προσωρινού αρχείου. 9 | Επιλογή ενός πολυμέσου 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-es-rES/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | No se encontraron elementos 4 | No se han seleccionado elementos 5 | No hay elementos cargados 6 | No se ha encontrado ninguna cámara 7 | Por favor, instala una app de la cámara y vuelve a intentarlo. 8 | Error al crear archivo temporal. 9 | Seleccionar medios 10 | 11 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-ml-rIN/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ഇനങ്ങളൊന്നും കണ്ടെത്തിയില്ല 4 | ഒരിനവും തിരഞ്ഞെടുക്കപ്പെട്ടിട്ടില്ല 5 | ഒരിനവും ലോഡായിട്ടില്ല 6 | ക്യാമറയൊന്നും കണ്ടെത്തിയില്ല 7 | ഒരു ക്യാമറ ആപ്ലിക്കേഷൻ ഇൻസ്റ്റാൾ ചെയ്‌തശേഷം വീണ്ടും ശ്രമിക്കുക. 8 | ഒരു താൽക്കാലിക ഫയൽ സൃഷ്ടിക്കുന്നതിൽ പരാജയപ്പെട്ടു. 9 | മീഡിയ തിരഞ്ഞെടുക്കുക 10 | 11 | -------------------------------------------------------------------------------- /adapter/src/main/res/layout/kau_iitem_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values-ta-rIN/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | உருப்படிகள் எதுவும் கிடைக்கவில்லை 4 | உருப்படிகள் எதுவும் தேர்ந்தெடுக்கப்படவில்லை 5 | உருப்படிகள் எதுவும் ஏற்றப்படவில்லை 6 | கேமரா எதுவும் கிடைக்கவில்லை 7 | கேமரா பயன்பாட்டை நிறுவி மீண்டும் முயற்சிக்கவும். 8 | தற்காலிக கோப்பை உருவாக்குவதில் தோல்வி. 9 | மீடியாவைத் தேர்ந்தெடுக்கவும் 10 | 11 | -------------------------------------------------------------------------------- /sample/src/main/res/xml/kau_faq.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This is a FAQ question 5 | This is a FAQ answer 6 | HTML tags]]> 7 | 8 | questions and answers are automatically parsed with HTML]]> 9 | Links 10 | 11 |
  • Github
  • 12 |
  • Page
  • 13 |
  • Play Store
  • 14 | ]]> 15 | -------------------------------------------------------------------------------- /fastadapter/src/main/res/layout/kau_iitem_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/values/strings_mediapicker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | No items found 4 | No items have been selected 5 | Blurrable ImageView 6 | No items loaded 7 | 8 | No camera found 9 | Please install a camera app and try again. 10 | 11 | Failed to create a temporary file. 12 | 13 | Select Media 14 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: allanwang # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /searchview/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /searchview/README.md: -------------------------------------------------------------------------------- 1 | # KAU :searchview 2 | 3 | KAU contains a fully functional SearchView that can be added programmatically with one line. 4 | It contains a `bindSearchView` extension functions for both activities and viewgroups. 5 | 6 | ![Search View Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_search_view.gif) 7 | 8 | The searchview is: 9 | * Fully themable - set the foreground or background color to style every portion, from text colors to backgrounds to ripples 10 | * Complete - binding the search view to a menu id will set the menu icon (if not previously set) and attach all the necessary listeners 11 | * Configurable - modify any portion of the inner Config class when binding the search view 12 | * Debouncable - specify a time interval to throttle your queries; see [debouncing](../core#debounce) 13 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelperExtras.java: -------------------------------------------------------------------------------- 1 | package ca.allanwang.kau.swipe; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * Created by Allan Wang on 2017-07-05. 7 | *

    8 | * Collection of addition methods added into ViewDragHelper that weren't in the original 9 | */ 10 | 11 | interface ViewDragHelperExtras { 12 | 13 | /** 14 | * Sets the new size of a given edge 15 | * Any touch within this range will be defined to have started from an edge 16 | * 17 | * @param size the new size in px 18 | */ 19 | void setEdgeSize(int size); 20 | 21 | void setMaxVelocity(float maxVel); 22 | 23 | float getMaxVelocity(); 24 | 25 | void setSensitivity(Context context, float sensitivity); 26 | 27 | float getSensitivity(); 28 | 29 | int STATE_JUDGING = 3; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /.idea/copyright/Apache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/kotlin/Utils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kotlin 17 | 18 | /** Created by Allan Wang on 07/04/18. */ 19 | inline fun javaClass(): Class = T::class.java 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /crowdin.properties 3 | /local.properties 4 | .DS_Store 5 | /build 6 | /captures 7 | .externalNativeBuild 8 | **/public.xml 9 | 10 | # Intellij 11 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 12 | *.iml 13 | .idea/**/workspace.xml 14 | .idea/**/tasks.xml 15 | .idea/**/usage.statistics.xml 16 | .idea/**/dictionaries 17 | .idea/**/shelf 18 | .idea/**/contentModel.xml 19 | .idea/**/dataSources/ 20 | .idea/**/dataSources.ids 21 | .idea/**/dataSources.local.xml 22 | .idea/**/sqlDataSources.xml 23 | .idea/**/dynamic.xml 24 | .idea/**/uiDesigner.xml 25 | .idea/**/dbnavigator.xml 26 | .idea/**/gradle.xml 27 | .idea/**/libraries 28 | .idea/**/assetWizardSettings.xml 29 | .idea/**/caches 30 | .idea/modules.xml 31 | .idea/modules 32 | .idea/vcs.xml 33 | .idea/compiler.xml 34 | .idea/misc.xml 35 | .idea/codeStyles/Project.xml -------------------------------------------------------------------------------- /fastadapter-viewbinding/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyUi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kotlin 17 | 18 | /** Shortcut for unsynchronized lazy block */ 19 | fun lazyUi(initializer: () -> T): Lazy = lazy(LazyThreadSafetyMode.NONE, initializer) 20 | -------------------------------------------------------------------------------- /favicon/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by potrace 1.11, written by Peter Selinger 2001-2013 9 | 10 | 12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /core-ui/src/main/res-public/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 16 | 17 | 18 | 19 | 11 | 12 | 16 | 17 | 21 | 22 | 25 | 26 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /mediapicker/src/main/res/layout/kau_blurred_imageview.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 20 | 21 | 30 | 31 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/utils/AnimHolder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.utils 17 | 18 | import android.os.Build 19 | import androidx.annotation.RequiresApi 20 | import ca.allanwang.kau.kotlin.lazyInterpolator 21 | 22 | /** 23 | * Created by Allan Wang on 2017-06-28. 24 | * 25 | * Holder for a bunch of common animators/interpolators used throughout this library 26 | */ 27 | object AnimHolder { 28 | 29 | @RequiresApi(Build.VERSION_CODES.LOLLIPOP) 30 | val fastOutSlowInInterpolator = lazyInterpolator(android.R.interpolator.fast_out_linear_in) 31 | val decelerateInterpolator = lazyInterpolator(android.R.interpolator.decelerate_cubic) 32 | } 33 | -------------------------------------------------------------------------------- /sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/PrefFactoryTestModule.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.sample.test 17 | 18 | import ca.allanwang.kau.kpref.KPrefFactory 19 | import ca.allanwang.kau.kpref.KPrefFactoryInMemory 20 | import ca.allanwang.kau.sample.PrefFactoryModule 21 | import dagger.Module 22 | import dagger.Provides 23 | import dagger.hilt.components.SingletonComponent 24 | import dagger.hilt.testing.TestInstallIn 25 | 26 | @Module 27 | @TestInstallIn(components = [SingletonComponent::class], replaces = [PrefFactoryModule::class]) 28 | object PrefFactoryTestModule { 29 | @Provides fun factory(): KPrefFactory = KPrefFactoryInMemory 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/res/layout/kau_changelog_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 21 | 22 | 29 | 30 | -------------------------------------------------------------------------------- /mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/GlideHelper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.mediapicker 17 | 18 | import android.view.View 19 | import com.bumptech.glide.Glide 20 | import com.bumptech.glide.RequestManager 21 | 22 | /** 23 | * Created by Allan Wang on 29/08/2017. 24 | * 25 | * Basic helper to fetch the [RequestManager] from the activity if it exists, before creating 26 | * another one 27 | */ 28 | internal interface GlideContract { 29 | fun glide(v: View): RequestManager 30 | } 31 | 32 | internal class GlideDelegate : GlideContract { 33 | override fun glide(v: View) = ((v.context as? MediaPickerCore<*>)?.glide ?: Glide.with(v))!! 34 | } 35 | -------------------------------------------------------------------------------- /core-ui/src/main/res-public/layout/kau_recycler_detached_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 15 | 16 | 17 | 18 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/utils/DrawableUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.utils 17 | 18 | import android.content.res.ColorStateList 19 | import android.graphics.drawable.Drawable 20 | import androidx.annotation.ColorInt 21 | import androidx.core.graphics.drawable.DrawableCompat 22 | 23 | /** Wrap the color into a state and tint the drawable */ 24 | fun Drawable.tint(@ColorInt color: Int): Drawable = tint(ColorStateList.valueOf(color)) 25 | 26 | /** Tint the drawable with a given color state list */ 27 | fun Drawable.tint(state: ColorStateList): Drawable { 28 | val drawable = DrawableCompat.wrap(mutate()) 29 | DrawableCompat.setTintList(drawable, state) 30 | return drawable 31 | } 32 | -------------------------------------------------------------------------------- /about/src/main/res/layout/kau_activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 16 | 17 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /about/src/main/res/layout/kau_about_section_libraries.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /sample/src/androidTest/kotlin/ca/allanwang/kau/sample/utils/EspressoUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.sample.utils 17 | 18 | import org.hamcrest.BaseMatcher 19 | import org.hamcrest.Description 20 | import org.hamcrest.Matcher 21 | 22 | fun index(index: Int, matcher: Matcher): Matcher = 23 | object : BaseMatcher() { 24 | 25 | var current = 0 26 | 27 | override fun describeTo(description: Description) { 28 | description.appendText("Should return item at index $index") 29 | } 30 | 31 | override fun matches(item: Any?): Boolean { 32 | println("AA") 33 | return matcher.matches(item) && current++ == index 34 | } 35 | } 36 | 37 | fun first(matcher: Matcher): Matcher = index(0, matcher) 38 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefFactory.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kpref 17 | 18 | import android.content.Context 19 | 20 | interface KPrefFactory { 21 | fun createBuilder(preferenceName: String): KPrefBuilder 22 | } 23 | 24 | /** Default factory for Android preferences */ 25 | class KPrefFactoryAndroid(context: Context) : KPrefFactory { 26 | 27 | val context: Context = context.applicationContext 28 | 29 | override fun createBuilder(preferenceName: String): KPrefBuilder = 30 | KPrefBuilderAndroid(context.getSharedPreferences(preferenceName, Context.MODE_PRIVATE)) 31 | } 32 | 33 | object KPrefFactoryInMemory : KPrefFactory { 34 | override fun createBuilder(preferenceName: String): KPrefBuilder = KPrefBuilderInMemory 35 | } 36 | -------------------------------------------------------------------------------- /searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchViewHolder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.searchview 17 | 18 | import android.view.MenuItem 19 | 20 | /** 21 | * Created by Allan Wang on 2017-11-12. 22 | * 23 | * Interface to help facilitate searchview binding and actions 24 | */ 25 | interface SearchViewHolder { 26 | 27 | var searchView: SearchView? 28 | 29 | fun searchViewBindIfNull(binder: () -> SearchView) { 30 | if (searchView == null) searchView = binder() 31 | } 32 | 33 | fun searchViewOnBackPress() = searchView?.onBackPressed() ?: false 34 | 35 | fun searchViewUnBind(replacementMenuItemClickListener: ((item: MenuItem) -> Boolean)? = null) { 36 | searchView?.unBind(replacementMenuItemClickListener) 37 | searchView = null 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefHeader.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kpref.activity.items 17 | 18 | import ca.allanwang.kau.kpref.activity.R 19 | 20 | /** 21 | * Created by Allan Wang on 2017-06-07. 22 | * 23 | * Header preference This view just holds a title and is not clickable. It is styled using the 24 | * accent color 25 | */ 26 | open class KPrefHeader(builder: CoreContract) : KPrefItemCore(builder) { 27 | 28 | override val layoutRes: Int 29 | get() = R.layout.kau_pref_header 30 | 31 | override fun bindView(holder: ViewHolder, payloads: List) { 32 | super.bindView(holder, payloads) 33 | withAccentColor(holder.title::setTextColor) 34 | } 35 | 36 | override val type: Int 37 | get() = R.id.kau_item_pref_header 38 | } 39 | -------------------------------------------------------------------------------- /mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.mediapicker 17 | 18 | import android.net.Uri 19 | import android.provider.MediaStore 20 | import com.bumptech.glide.load.engine.DiskCacheStrategy 21 | 22 | /** Created by Allan Wang on 2017-07-30. */ 23 | enum class MediaType( 24 | val cacheStrategy: DiskCacheStrategy, 25 | val mimeType: String, 26 | val captureType: String, 27 | val contentUri: Uri 28 | ) { 29 | IMAGE( 30 | DiskCacheStrategy.AUTOMATIC, 31 | "image/*", 32 | MediaStore.ACTION_IMAGE_CAPTURE, 33 | MediaStore.Images.Media.EXTERNAL_CONTENT_URI 34 | ), 35 | VIDEO( 36 | DiskCacheStrategy.AUTOMATIC, 37 | "video/*", 38 | MediaStore.ACTION_VIDEO_CAPTURE, 39 | MediaStore.Video.Media.EXTERNAL_CONTENT_URI 40 | ) 41 | } 42 | -------------------------------------------------------------------------------- /core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.ui.views 17 | 18 | import android.content.Context 19 | import android.util.AttributeSet 20 | import androidx.appcompat.widget.AppCompatImageView 21 | 22 | /** Created by Allan Wang on 2017-07-14. */ 23 | class MeasuredImageView 24 | @JvmOverloads 25 | constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : 26 | AppCompatImageView(context, attrs, defStyleAttr), MeasureSpecContract by MeasureSpecDelegate() { 27 | 28 | init { 29 | initAttrs(context, attrs) 30 | } 31 | 32 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { 33 | val result = onMeasure(this, widthMeasureSpec, heightMeasureSpec) 34 | super.onMeasure(result.first, result.second) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /about/src/main/res/layout/kau_iitem_faq.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 21 | 22 | 27 | 28 | 29 | 30 | 36 | 37 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/utils/Const.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.utils 17 | 18 | import androidx.customview.widget.ViewDragHelper 19 | 20 | /** Created by Allan Wang on 2017-06-08. */ 21 | const val ANDROID_NAMESPACE = "http://schemas.android.com/apk/res/android" 22 | 23 | const val KAU_LEFT = ViewDragHelper.EDGE_LEFT 24 | const val KAU_RIGHT = ViewDragHelper.EDGE_RIGHT 25 | const val KAU_TOP = ViewDragHelper.EDGE_TOP 26 | const val KAU_BOTTOM = ViewDragHelper.EDGE_BOTTOM 27 | const val KAU_HORIZONTAL = KAU_LEFT or KAU_RIGHT 28 | const val KAU_VERTICAL = KAU_TOP or KAU_BOTTOM 29 | const val KAU_ALL = KAU_HORIZONTAL or KAU_VERTICAL 30 | 31 | const val KAU_COLLAPSED = 0 32 | const val KAU_COLLAPSING = 1 33 | const val KAU_EXPANDING = 2 34 | const val KAU_EXPANDED = 3 35 | 36 | const val KAU_ELLIPSIS = '\u2026' 37 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.utils 17 | 18 | import android.content.Context 19 | import android.graphics.Color 20 | import android.graphics.drawable.Drawable 21 | import androidx.annotation.ColorInt 22 | import com.mikepenz.iconics.IconicsDrawable 23 | import com.mikepenz.iconics.dsl.iconicsDrawable 24 | import com.mikepenz.iconics.typeface.IIcon 25 | 26 | /** Created by Allan Wang on 2017-05-29. */ 27 | @KauUtils 28 | fun IIcon.toDrawable( 29 | c: Context, 30 | sizeDp: Int = 24, 31 | @ColorInt color: Int = Color.WHITE, 32 | builder: IconicsDrawable.() -> Unit = {} 33 | ): Drawable = 34 | c.iconicsDrawable(this) { 35 | this.color = colorInt(color) 36 | if (sizeDp > 0) { 37 | size = sizeDp(sizeDp) 38 | } 39 | } 40 | .apply(builder) 41 | -------------------------------------------------------------------------------- /core-ui/README.md: -------------------------------------------------------------------------------- 1 | # KAU :core-ui 2 | 3 | Holds a collection of generic UIs. 4 | This submodule takes heavy influence from [Plaid](https://github.com/nickbutcher/plaid), a beautiful showcase for Material Design. 5 | 6 | ## BoundedCardView 7 | 8 | Extends a CardView and provides `maxHeight` and `maxHeightPercentage` attributes. 9 | These values are judged once the view it attached and can be helpful to limit the size with respect to its parent. 10 | 11 | One example is in KAU's `:searchview`, where the search results will always allow some space below it for the user to tap and exit. 12 | 13 | ## CutoutView 14 | 15 | > Courtesy of Plaid 16 | 17 | Given a background and a text/vector, will "erase" the text/vector from the background. 18 | This can be seen in effect in KAU's `:about` submodule. 19 | 20 | ## ElasticDragDismissFrameLayout 21 | 22 | > Courtesy of Plaid 23 | 24 | When scrolling vertically, this frame will allow for overscrolling and will pull the layout out of view and exit if a threshold is reached. 25 | Note that Activities with this frame must be translucent. `@style/Kau.Translucent` can be used as a base. 26 | 27 | ## InkPageIndicator 28 | 29 | > Courtesy of Plaid 30 | 31 | A beautiful viewpager indicator 32 | 33 | ![Ink Indicator Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_ink_indicator.gif) 34 | 35 | ## TextSlider 36 | 37 | An animated and themable Text Switcher. Specify its direction and set a new text value and it will slide it into view. -------------------------------------------------------------------------------- /fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/KauIItem.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.iitems 17 | 18 | import android.view.View 19 | import androidx.annotation.LayoutRes 20 | import androidx.recyclerview.widget.RecyclerView 21 | import com.mikepenz.fastadapter.items.AbstractItem 22 | 23 | /** 24 | * Created by Allan Wang on 2017-07-03. 25 | * 26 | * Kotlin implementation of the [AbstractItem] to make things shorter If only one iitem type extends 27 | * the given [layoutRes], you may use it as the type and not worry about another id 28 | */ 29 | open class KauIItem( 30 | @param:LayoutRes override val layoutRes: Int, 31 | private val viewHolder: (v: View) -> VH, 32 | override val type: Int = layoutRes 33 | ) : AbstractItem() { 34 | final override fun getViewHolder(v: View): VH = viewHolder(v) 35 | } 36 | -------------------------------------------------------------------------------- /about/src/main/res/values/strings_about_kau.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Allan Wang 4 | https://www.allanwang.ca/dev/ 5 | @string/kau_version_code 6 | KAU 7 | 8 |
    11 | KAU aims to make many common functions executable in one line. It adds numerous extensions to match Kotlin\'s DSL, 12 | and supports completely customizable view groups that are usable in any app project. 13 | ]]> 14 |
    15 | https://allanwang.github.io/KAU/ 16 | true 17 | https://github.com/AllanWang/KAU 18 | ca.allanwang.kau 19 | apache_2_0 20 |
    -------------------------------------------------------------------------------- /core-ui/src/main/res-public/layout/kau_recycler_textslider.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 22 | 23 | 24 | 25 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/kotlin/Streams.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kotlin 17 | 18 | /** Created by Allan Wang on 2017-08-05. */ 19 | 20 | /** 21 | * Replica of [java.util.Vector.removeIf] in Java Since we don't have access to the internals of our 22 | * extended class, We will simply iterate and remove when the filter returns {@code false} 23 | */ 24 | inline fun > C.kauRemoveIf(filter: (item: T) -> Boolean): C { 25 | val iter = iterator() 26 | while (iter.hasNext()) { 27 | if (filter(iter.next())) { 28 | iter.remove() 29 | } 30 | } 31 | return this 32 | } 33 | 34 | /** Returns the first element tha matches the predicate, or null if no match is found */ 35 | inline fun Iterator.firstOrNull(predicate: (T) -> Boolean): T? { 36 | while (hasNext()) { 37 | val data = next() 38 | if (predicate(data)) { 39 | return data 40 | } 41 | } 42 | return null 43 | } 44 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | -------------------------------------------------------------------------------- /fastadapter/src/main/kotlin/ca/allanwang/kau/adapters/AdapterUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.adapters 17 | 18 | import com.mikepenz.fastadapter.FastAdapter 19 | import com.mikepenz.fastadapter.GenericItem 20 | import com.mikepenz.fastadapter.IAdapter 21 | import com.mikepenz.fastadapter.select.SelectExtension 22 | 23 | /** Created by Allan Wang on 2017-11-08. */ 24 | 25 | /** Add kotlin's generic syntax to better support out types */ 26 | fun fastAdapter(vararg adapter: IAdapter): FastAdapter = 27 | FastAdapter.with(adapter.toList()) 28 | 29 | /** Returns selection size, or -1 if selection is disabled */ 30 | inline val IAdapter.selectionSize: Int 31 | get() = fastAdapter?.getExtension>()?.selections?.size ?: -1 32 | 33 | inline val IAdapter.selectedItems: Set 34 | get() = fastAdapter?.getExtension>()?.selectedItems ?: emptySet() 35 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/ui/SimpleRippleDrawable.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.ui 17 | 18 | import android.content.res.ColorStateList 19 | import android.graphics.drawable.ColorDrawable 20 | import android.graphics.drawable.RippleDrawable 21 | import android.os.Build 22 | import androidx.annotation.ColorInt 23 | import androidx.annotation.RequiresApi 24 | import ca.allanwang.kau.utils.adjustAlpha 25 | 26 | /** 27 | * Created by Allan Wang on 2017-06-24. 28 | * 29 | * Tries to mimic a standard ripple, given the foreground and background colors 30 | */ 31 | @RequiresApi(Build.VERSION_CODES.LOLLIPOP) 32 | fun createSimpleRippleDrawable( 33 | @ColorInt foregroundColor: Int, 34 | @ColorInt backgroundColor: Int 35 | ): RippleDrawable { 36 | val states = ColorStateList(arrayOf(intArrayOf()), intArrayOf(foregroundColor)) 37 | val content = ColorDrawable(backgroundColor) 38 | val mask = ColorDrawable(foregroundColor.adjustAlpha(0.16f)) 39 | return RippleDrawable(states, content, mask) 40 | } 41 | -------------------------------------------------------------------------------- /sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.sample 17 | 18 | import ca.allanwang.kau.about.AboutActivityBase 19 | import ca.allanwang.kau.adapters.FastItemThemedAdapter 20 | import ca.allanwang.kau.iitems.CardIItem 21 | import com.mikepenz.fastadapter.GenericItem 22 | 23 | /** Created by Allan Wang on 2017-06-27. */ 24 | class AboutActivity : AboutActivityBase(R.string::class.java) { 25 | 26 | override fun Configs.buildConfigs() { 27 | cutoutDrawableRes = R.drawable.kau 28 | textColor = 0xde000000.toInt() 29 | backgroundColor = 0xfffafafa.toInt() 30 | accentColor = 0xff00838F.toInt() 31 | cutoutForeground = 0xff18FFFF.toInt() 32 | faqXmlRes = R.xml.kau_faq 33 | faqParseNewLine = false 34 | } 35 | 36 | override fun postInflateMainPage(adapter: FastItemThemedAdapter) { 37 | adapter.add( 38 | CardIItem { 39 | title = "About KAU" 40 | descRes = R.string.about_kau 41 | } 42 | ) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.permissions 17 | 18 | import android.content.pm.PackageManager 19 | 20 | /** 21 | * Created by Allan Wang on 2017-07-03. 22 | * 23 | * Pending permission collector 24 | */ 25 | class PermissionResult( 26 | permissions: Array, 27 | val callback: (granted: Boolean, deniedPerm: String?) -> Unit 28 | ) { 29 | val permissions = mutableSetOf(*permissions) 30 | 31 | /** 32 | * Called from the manager whenever a permission has changed Returns true if result is completed, 33 | * false otherwise 34 | */ 35 | fun onResult(permission: String, result: Int): Boolean { 36 | if (result != PackageManager.PERMISSION_GRANTED) { 37 | callback(false, permission) 38 | permissions.clear() 39 | return true 40 | } 41 | permissions.remove(permission) 42 | if (permissions.isNotEmpty()) { 43 | return false 44 | } 45 | callback(true, null) 46 | return true 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefPlainText.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kpref.activity.items 17 | 18 | import ca.allanwang.kau.kpref.activity.GlobalOptions 19 | import ca.allanwang.kau.kpref.activity.KClick 20 | import ca.allanwang.kau.kpref.activity.R 21 | 22 | /** 23 | * Created by Allan Wang on 2017-06-14. 24 | * 25 | * Just text with the core options. Extends base preference but has an empty getter and setter 26 | * Useful replacement of [KPrefText] when nothing is displayed on the right side, and when the 27 | * preference is completely handled by the click 28 | */ 29 | open class KPrefPlainText(open val builder: KPrefPlainTextBuilder) : KPrefItemBase(builder) { 30 | 31 | override fun KClick.defaultOnClick() = Unit 32 | 33 | class KPrefPlainTextBuilder(globalOptions: GlobalOptions, titleId: Int) : 34 | BaseContract by BaseBuilder(globalOptions, titleId, {}, {}) 35 | 36 | override val type: Int 37 | get() = R.id.kau_item_pref_plain_text 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/utils/RecyclerUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.utils 17 | 18 | import android.graphics.Rect 19 | import android.view.View 20 | import androidx.recyclerview.widget.RecyclerView 21 | 22 | /** Created by Allan Wang on 2017-07-11. */ 23 | fun RecyclerView.withMarginDecoration(sizeDp: Int, edgeFlags: Int) { 24 | addItemDecoration(MarginItemDecoration(sizeDp, edgeFlags)) 25 | } 26 | 27 | class MarginItemDecoration(sizeDp: Int, val edgeFlags: Int) : RecyclerView.ItemDecoration() { 28 | 29 | private val sizePx = sizeDp.dpToPx 30 | 31 | override fun getItemOffsets( 32 | outRect: Rect, 33 | view: View, 34 | parent: RecyclerView, 35 | state: RecyclerView.State 36 | ) { 37 | super.getItemOffsets(outRect, view, parent, state) 38 | if (edgeFlags and KAU_LEFT > 0) outRect.left += sizePx 39 | if (edgeFlags and KAU_TOP > 0) outRect.top += sizePx 40 | if (edgeFlags and KAU_RIGHT > 0) outRect.right += sizePx 41 | if (edgeFlags and KAU_BOTTOM > 0) outRect.bottom += sizePx 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /core/src/test/kotlin/ca/allanwang/kau/kotlin/LazyResettableTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kotlin 17 | 18 | import kotlin.test.assertEquals 19 | import kotlin.test.assertNotEquals 20 | import org.junit.Before 21 | import org.junit.Test 22 | 23 | /** 24 | * Created by Allan Wang on 2017-07-29. 25 | * 26 | * Test code for [LazyResettable] 27 | */ 28 | class LazyResettableTest { 29 | 30 | lateinit var registry: LazyResettableRegistry 31 | 32 | @Before 33 | fun init() { 34 | registry = LazyResettableRegistry() 35 | } 36 | 37 | @Test 38 | fun basic() { 39 | val timeDelegate = lazyResettable { System.currentTimeMillis() } 40 | val time: Long by timeDelegate 41 | registry.add(timeDelegate) 42 | val t1 = time 43 | Thread.sleep(5) 44 | val t2 = time 45 | registry.invalidateAll() 46 | Thread.sleep(5) 47 | val t3 = time 48 | assertEquals(t1, t2, "Lazy resettable not returning same value after second call") 49 | assertNotEquals(t1, t3, "Lazy resettable not invalidated by registry") 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Android CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | - '!l10n_dev' 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v2 17 | with: 18 | fetch-depth: 100 19 | 20 | - name: Fetch all tags 21 | run: git fetch origin +refs/tags/*:refs/tags/* 22 | 23 | - name: Set up JDK 11 24 | uses: actions/setup-java@v2 25 | with: 26 | java-version: '11' 27 | java-package: jdk 28 | distribution: 'adopt' 29 | cache: gradle 30 | 31 | - name: Validate gradle wrapper 32 | uses: gradle/wrapper-validation-action@v1 33 | 34 | - name: Decrypt secret 35 | if: ${{ false }} 36 | run: | 37 | gpg -d --passphrase "${{ secrets.KAU_TAR_SECRET }}" --batch "files/kau_github.tar.gpg" > "files/kau_github.tar" 38 | tar xvf files/kau_github.tar -C files 39 | 40 | - name: Checkout Gradle Build Cache 41 | if: ${{ steps.self_hosted.outputs.FLAG != 'self-hosted' }} 42 | uses: actions/cache@v2 43 | with: 44 | path: | 45 | ~/.gradle/caches 46 | ~/.gradle/wrapper 47 | !~/.gradle/wrapper/dists/**/gradle*.zip 48 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} 49 | restore-keys: | 50 | gradle-${{ runner.os }}- 51 | 52 | - name: Grant execute permission for gradlew 53 | run: chmod +x gradlew 54 | 55 | - name: Android Git Version 56 | run: ./gradlew --quiet androidGitVersion 57 | 58 | - name: Check and Test 59 | run: ./gradlew spotlessCheck lintRelease testReleaseUnitTest 60 | -------------------------------------------------------------------------------- /core/src/main/kotlin/ca/allanwang/kau/utils/FontUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.utils 17 | 18 | import android.content.Context 19 | import android.graphics.Typeface 20 | 21 | /** Created by Allan Wang on 2017-06-28. */ 22 | object FontUtils { 23 | 24 | private val sTypefaceCache: MutableMap = mutableMapOf() 25 | 26 | fun get(context: Context, font: String): Typeface { 27 | synchronized(sTypefaceCache) { 28 | if (!sTypefaceCache.containsKey(font)) { 29 | val tf = Typeface.createFromAsset(context.applicationContext.assets, "fonts/$font.ttf") 30 | sTypefaceCache.put(font, tf) 31 | } 32 | return sTypefaceCache.get(font) 33 | ?: throw IllegalArgumentException( 34 | "Font error; typeface does not exist at assets/fonts$font.ttf" 35 | ) 36 | } 37 | } 38 | 39 | fun getName(typeface: Typeface): String? = 40 | sTypefaceCache.entries.firstOrNull { it.value == typeface }?.key 41 | } 42 | 43 | fun Context.getFont(font: String) = FontUtils.get(this, font) 44 | 45 | fun Context.getFontName(typeface: Typeface) = FontUtils.getName(typeface) 46 | -------------------------------------------------------------------------------- /about/src/main/kotlin/ca/allanwang/kau/about/CollapsibleTextView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.about 17 | 18 | import android.content.Context 19 | import android.content.res.Configuration 20 | import android.util.AttributeSet 21 | import androidx.appcompat.widget.AppCompatTextView 22 | import ca.allanwang.kau.ui.views.CollapsibleView 23 | import ca.allanwang.kau.ui.views.CollapsibleViewDelegate 24 | 25 | /** Created by Allan Wang on 2017-08-02. */ 26 | class CollapsibleTextView 27 | @JvmOverloads 28 | constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : 29 | AppCompatTextView(context, attrs, defStyleAttr), CollapsibleView by CollapsibleViewDelegate() { 30 | 31 | init { 32 | initCollapsible(this) 33 | } 34 | 35 | override fun onConfigurationChanged(newConfig: Configuration?) { 36 | resetCollapsibleAnimation() 37 | super.onConfigurationChanged(newConfig) 38 | } 39 | 40 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { 41 | super.onMeasure(widthMeasureSpec, heightMeasureSpec) 42 | val result = getCollapsibleDimension() 43 | setMeasuredDimension(result.first, result.second) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /core-ui/src/main/res/values/attr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /about/README.md: -------------------------------------------------------------------------------- 1 | # KAU :about 2 | 3 | Most apps could not be possible without the collective efforts of other developers and their libraries. 4 | It's always nice to give credit where credit is due, but it's not always at the top of ones agenda. 5 | About Activity aims to fix that by preparing a beautiful overlay activity that does just that. 6 | 7 | ![About Activity Gif](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/kau/kau_about_activity.gif) 8 | 9 | The overlay is heavily based off of the about section in [Plaid](https://github.com/nickbutcher/plaid), 10 | and adds on the power of [About Libraries](https://github.com/mikepenz/AboutLibraries) to automatically find the dependencies. 11 | 12 | This activity can be easily added by extending `AboutActivityBase`. 13 | Everything is already prepared, but you can modify the theme or other components through the config DSL or through the open functions. 14 | 15 | If you wish to add custom panels, you will need to implement `AboutPanelContract`. 16 | The most common usage is with a recyclerview, so there is a simplified class `AboutPanelRecycler` that you may extend as well. 17 | Note that the viewpager by default will keep all panels in memory, so it's best to not have too many pages with expensive interactions. 18 | 19 | You may easily launch the activity through the binder: 20 | ``` 21 | Activity.kauLaunchAbout() 22 | ``` 23 | where `T` extends `AboutActivityBase` 24 | 25 | Be sure to include the activity in your Manifest and have it extend `Kau.About`, or any other style that achieves the same look. 26 | 27 | ## Proguard 28 | 29 | Without auto detection, KAU about will retain the classes containing the lib strings by default. 30 | If you use proguard with auto detect, make sure to retain all R classes to make it possible 31 | 32 | ``` 33 | -keep class .R 34 | -keep class **.R$* { 35 | ; 36 | } 37 | ``` -------------------------------------------------------------------------------- /kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kpref.activity.items 17 | 18 | import android.widget.CheckBox 19 | import androidx.appcompat.widget.AppCompatCheckBox 20 | import ca.allanwang.kau.kpref.activity.KClick 21 | import ca.allanwang.kau.kpref.activity.R 22 | import ca.allanwang.kau.utils.tint 23 | 24 | /** 25 | * Created by Allan Wang on 2017-06-07. 26 | * 27 | * Checkbox preference When clicked, will toggle the preference and the apply the result to the 28 | * checkbox 29 | */ 30 | open class KPrefCheckbox(builder: BaseContract) : KPrefItemBase(builder) { 31 | 32 | override fun KClick.defaultOnClick() { 33 | pref = !pref 34 | (innerView as AppCompatCheckBox).isChecked = pref 35 | } 36 | 37 | override fun bindView(holder: ViewHolder, payloads: List) { 38 | super.bindView(holder, payloads) 39 | val checkbox = holder.bindInnerView(R.layout.kau_pref_checkbox) 40 | withAccentColor(checkbox::tint) 41 | checkbox.isChecked = pref 42 | checkbox.jumpDrawablesToCurrentState() // Cancel the animation 43 | } 44 | 45 | override val type: Int 46 | get() = R.id.kau_item_pref_checkbox 47 | } 48 | -------------------------------------------------------------------------------- /core/src/main/res-public/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 24dp 6 | 16dp 7 | 8 | 16dp 9 | 8dp 10 | 16dp 11 | 1dip 12 | 100dp 13 | 14 | 112dp 15 | 168dp 16 | 17 | 8dp 18 | 4dp 19 | 32dp 20 | 48dp 21 | 64dp 22 | 8dp 23 | 16dp 24 | 24dp 25 | 56dp 26 | 28dp 27 | 112sp 28 | 29 | 30 | 40dp 31 | 48dp 32 | 4dp 33 | 12dp 34 | 20dp 35 | 36 | -------------------------------------------------------------------------------- /core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.xml 17 | 18 | import android.content.Context 19 | import androidx.test.core.app.ApplicationProvider 20 | import androidx.test.ext.junit.runners.AndroidJUnit4 21 | import androidx.test.filters.MediumTest 22 | import ca.allanwang.kau.test.R 23 | import kotlin.test.assertEquals 24 | import org.junit.Test 25 | import org.junit.runner.RunWith 26 | 27 | /** Created by Allan Wang on 2017-08-01. */ 28 | @RunWith(AndroidJUnit4::class) 29 | @MediumTest 30 | class FaqTest { 31 | 32 | val context: Context 33 | get() = ApplicationProvider.getApplicationContext() 34 | 35 | @Test 36 | fun simpleTest() { 37 | val data = context.kauParseFaq(R.xml.test_faq, false) 38 | assertEquals(2, data.size, "FAQ size is incorrect") 39 | assertEquals( 40 | "This is a question", 41 | data.first().question.toString(), 42 | "First question does not match" 43 | ) 44 | assertEquals("This is an answer", data.first().answer.toString(), "First answer does not match") 45 | assertEquals( 46 | "This is another question", 47 | data.last().question.toString(), 48 | "Second question does not match" 49 | ) 50 | assertEquals( 51 | "This is another answer", 52 | data.last().answer.toString(), 53 | "Second answer does not match" 54 | ) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /core/src/test/kotlin/ca/allanwang/kau/kotlin/StreamsTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kotlin 17 | 18 | import kotlin.test.assertEquals 19 | import org.junit.Test 20 | 21 | /** 22 | * Created by Allan Wang on 2017-08-05. 23 | * 24 | * Test code for [kauRemoveIf] 25 | */ 26 | class StreamsTest { 27 | 28 | @Test 29 | fun basic() { 30 | val items = mutableListOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) 31 | items.kauRemoveIf { it % 2 == 0 } 32 | assertEquals(listOf(1, 3, 5, 7, 9), items) 33 | } 34 | 35 | @Test 36 | fun objectReference() { 37 | data class Potato(val id: Int) 38 | 39 | val thePotato = Potato(9) 40 | val items = mutableListOf() 41 | val result = mutableListOf() 42 | for (i in 0..11) { 43 | val potato = Potato(i) 44 | items.add(potato) 45 | result.add(potato) 46 | } 47 | items.add(3, thePotato) 48 | assertEquals(result.size + 1, items.size, "Invalid list addition") 49 | assertEquals(2, items.filter { it.id == 9 }.size, "Invalid number of potatoes with id 9") 50 | items.kauRemoveIf { it === thePotato } // removal by reference 51 | assertEquals(result.size, items.size, "Invalid list size after removal") 52 | assertEquals(result, items) 53 | items.kauRemoveIf { it == thePotato } // removal by equality 54 | assertEquals(result.size - 1, items.size, "Invalid list removal based on equality") 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSubItems.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kpref.activity.items 17 | 18 | import android.view.View 19 | import ca.allanwang.kau.kpref.activity.GlobalOptions 20 | import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder 21 | import ca.allanwang.kau.kpref.activity.R 22 | 23 | /** 24 | * Created by Allan Wang on 2017-06-14. 25 | * 26 | * Sub item preference When clicked, will navigate to a new set of preferences and add the old list 27 | * to a stack 28 | */ 29 | open class KPrefSubItems(open val builder: KPrefSubItemsContract) : KPrefItemCore(builder) { 30 | 31 | override fun onClick(itemView: View) { 32 | builder.globalOptions.showNextPrefs(builder.titleFun(), builder.itemBuilder) 33 | } 34 | 35 | override val layoutRes: Int 36 | get() = R.layout.kau_pref_core 37 | 38 | /** Extension of the base contract with an optional text getter */ 39 | interface KPrefSubItemsContract : CoreContract { 40 | val itemBuilder: KPrefAdapterBuilder.() -> Unit 41 | } 42 | 43 | /** Default implementation of [KPrefTextContract] */ 44 | class KPrefSubItemsBuilder( 45 | globalOptions: GlobalOptions, 46 | titleId: Int, 47 | override val itemBuilder: KPrefAdapterBuilder.() -> Unit 48 | ) : KPrefSubItemsContract, CoreContract by CoreBuilder(globalOptions, titleId) 49 | 50 | override val type: Int 51 | get() = R.id.kau_item_pref_sub_item 52 | } 53 | -------------------------------------------------------------------------------- /adapter/src/main/kotlin/ca/allanwang/kau/animators/AnimatorInterfaces.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.animators 17 | 18 | import android.view.View 19 | import android.view.ViewPropertyAnimator 20 | import androidx.recyclerview.widget.RecyclerView 21 | 22 | /** Created by Allan Wang on 2017-07-11. */ 23 | class KauAnimatorException(message: String) : RuntimeException(message) 24 | 25 | interface KauAnimatorAdd { 26 | fun animationPrepare(holder: RecyclerView.ViewHolder): View.() -> Unit 27 | fun animation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator.() -> Unit 28 | fun animationCleanup(holder: RecyclerView.ViewHolder): View.() -> Unit 29 | fun getDelay(remove: Long, move: Long, change: Long): Long 30 | var itemDelayFactor: Float 31 | } 32 | 33 | interface KauAnimatorRemove { 34 | fun animation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator.() -> Unit 35 | fun animationCleanup(holder: RecyclerView.ViewHolder): View.() -> Unit 36 | fun getDelay(remove: Long, move: Long, change: Long): Long 37 | var itemDelayFactor: Float 38 | } 39 | 40 | interface KauAnimatorChange { 41 | fun changeOldAnimation( 42 | holder: RecyclerView.ViewHolder, 43 | changeInfo: BaseItemAnimator.ChangeInfo 44 | ): ViewPropertyAnimator.() -> Unit 45 | 46 | fun changeNewAnimation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator.() -> Unit 47 | fun changeAnimationCleanup(holder: RecyclerView.ViewHolder): View.() -> Unit 48 | } 49 | -------------------------------------------------------------------------------- /sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.sample 17 | 18 | import android.content.Context 19 | import android.net.Uri 20 | import androidx.core.content.FileProvider 21 | import ca.allanwang.kau.mediapicker.MediaActionCamera 22 | import ca.allanwang.kau.mediapicker.MediaActionGallery 23 | import ca.allanwang.kau.mediapicker.MediaPickerActivityBase 24 | import ca.allanwang.kau.mediapicker.MediaPickerActivityOverlayBase 25 | import ca.allanwang.kau.mediapicker.MediaType 26 | import ca.allanwang.kau.mediapicker.createMediaFile 27 | import java.io.File 28 | 29 | /** Created by Allan Wang on 2017-07-23. */ 30 | private fun actions(multiple: Boolean) = 31 | listOf( 32 | object : MediaActionCamera() { 33 | 34 | override fun createFile(context: Context): File = createMediaFile("KAU", ".jpg") 35 | 36 | override fun createUri(context: Context, file: File): Uri = 37 | FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", file) 38 | }, 39 | MediaActionGallery(multiple) 40 | ) 41 | 42 | class ImagePickerActivity : MediaPickerActivityBase(MediaType.IMAGE, actions(true)) 43 | 44 | class ImagePickerActivityOverlay : MediaPickerActivityOverlayBase(MediaType.IMAGE, actions(false)) 45 | 46 | class VideoPickerActivity : MediaPickerActivityBase(MediaType.VIDEO, actions(true)) 47 | 48 | class VideoPickerActivityOverlay : MediaPickerActivityOverlayBase(MediaType.VIDEO, actions(false)) 49 | -------------------------------------------------------------------------------- /sample/src/main/res/values/strings_sample.xml: -------------------------------------------------------------------------------- 1 | 2 | This is a header 3 | This is a description 4 | Checkbox 1 5 | Checkbox 2 6 | Checkbox 3 7 | I am dependent on checkbox 2 8 | Text Color 9 | Accent Color 10 | Background Color 11 | This selector allows custom colors 12 | This selector does not allow custom colors 13 | This selector allows for custom colors with alpha values 14 | Text Pref 15 | Saves the text 16 | Seekbar 17 | Time Pref 18 | AM PM version 19 | 24h version 20 | Sub Item Pref 21 | Press this to view the next subset of preferences 22 | your.email@here.com 23 | Your subject 24 | Swipe Showcase 25 | Image Showcase 26 | Video Overlay Showcase 27 | Adapter Showcase 28 | KAU (Kotlin Android Utils) is a collection of common extension functions and complex UIs that can be used in almost all apps. It is meant to implement the shared components, so you can focus on what makes your app unique. 29 | Long Prefs 30 | 31 | -------------------------------------------------------------------------------- /about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.about 17 | 18 | import android.view.View 19 | import androidx.recyclerview.widget.RecyclerView 20 | import ca.allanwang.kau.adapters.ThemableIItem 21 | import ca.allanwang.kau.adapters.ThemableIItemDelegate 22 | import ca.allanwang.kau.iitems.KauIItem 23 | import ca.allanwang.kau.ui.views.CutoutView 24 | 25 | /** 26 | * Created by Allan Wang on 2017-06-28. 27 | * 28 | * Just a cutout item with some defaults in [R.layout.kau_iitem_cutout] 29 | */ 30 | class CutoutIItem(val config: CutoutView.() -> Unit = {}) : 31 | KauIItem(R.layout.kau_iitem_cutout, ::ViewHolder, R.id.kau_item_cutout), 32 | ThemableIItem by ThemableIItemDelegate() { 33 | 34 | override var isSelectable: Boolean 35 | get() = false 36 | set(_) {} 37 | 38 | override fun bindView(holder: ViewHolder, payloads: List) { 39 | super.bindView(holder, payloads) 40 | with(holder) { 41 | if (accentColor != null && themeEnabled) cutout.foregroundColor = accentColor!! 42 | cutout.config() 43 | } 44 | } 45 | 46 | override fun unbindView(holder: ViewHolder) { 47 | super.unbindView(holder) 48 | with(holder) { 49 | cutout.drawable = null 50 | cutout.text = "Text" // back to default 51 | } 52 | } 53 | 54 | class ViewHolder(v: View) : RecyclerView.ViewHolder(v) { 55 | val cutout: CutoutView = v.findViewById(R.id.kau_cutout) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /kpref-activity/src/main/res/layout/kau_pref_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 17 | 25 | 26 | 34 | 35 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /core/src/test/kotlin/ca/allanwang/kau/kotlin/DebounceTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kotlin 17 | 18 | import kotlin.test.assertEquals 19 | import org.junit.Ignore 20 | import org.junit.Test 21 | 22 | /** Created by Allan Wang on 2017-08-05. */ 23 | class DebounceTest { 24 | 25 | @Test 26 | fun basic() { 27 | var i = 0 28 | val debounce = debounce(20) { i++ } 29 | assertEquals(0, i, "i should start as 0") 30 | (1..5).forEach { debounce() } 31 | Thread.sleep(50) 32 | assertEquals(1, i, "Debouncing did not cancel previous requests") 33 | } 34 | 35 | @Test 36 | fun basicExtension() { 37 | var i = 0 38 | val increment: () -> Unit = { i++ } 39 | (1..5).forEach { increment() } 40 | assertEquals(5, i, "i should be 5") 41 | val debounce = increment.debounce(50) 42 | (6..10).forEach { debounce() } 43 | assertEquals(5, i, "i should not have changed") 44 | Thread.sleep(100) 45 | assertEquals(6, i, "i should increment to 6") 46 | } 47 | 48 | @Test 49 | @Ignore("Pending fix") 50 | fun multipleDebounces() { 51 | var i = 0 52 | val debounce = debounce(20) { i += it } 53 | debounce(1) // ignore -> i = 0 54 | Thread.sleep(10) 55 | assertEquals(0, i) 56 | debounce(2) // accept -> i = 2 57 | Thread.sleep(30) 58 | assertEquals(2, i) 59 | debounce(4) // ignore -> i = 2 60 | Thread.sleep(10) 61 | assertEquals(2, i) 62 | debounce(8) // accept -> i = 10 63 | Thread.sleep(30) 64 | assertEquals(10, i) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /core/src/test/kotlin/ca/allanwang/kau/kotlin/CoroutineTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Allan Wang 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ca.allanwang.kau.kotlin 17 | 18 | import kotlin.test.assertEquals 19 | import kotlin.test.fail 20 | import kotlinx.coroutines.CancellationException 21 | import kotlinx.coroutines.Dispatchers 22 | import kotlinx.coroutines.Job 23 | import kotlinx.coroutines.runBlocking 24 | import kotlinx.coroutines.withContext 25 | import org.junit.Test 26 | 27 | /** Tests geared towards coroutines */ 28 | class CoroutineTest { 29 | 30 | /** If a job is cancelled, then a switch to a new context will not run */ 31 | @Test 32 | fun implicitCancellationBefore() { 33 | val job = Job() 34 | var id = 0 35 | try { 36 | runBlocking(job) { 37 | id++ 38 | job.cancel() 39 | withContext(Dispatchers.IO) { fail("Context switch should not be reached") } 40 | } 41 | } catch (ignore: CancellationException) {} finally { 42 | assertEquals(1, id, "Launcher never executed") 43 | } 44 | } 45 | 46 | /** If a job is cancelled, then a switch from a new context will not run */ 47 | @Test 48 | fun implicitCancellationAfter() { 49 | val job = Job() 50 | var id = 0 51 | try { 52 | runBlocking(job) { 53 | withContext(Dispatchers.IO) { 54 | id++ 55 | job.cancel() 56 | } 57 | fail("Post context switch should not be reached") 58 | } 59 | } catch (ignore: CancellationException) {} finally { 60 | assertEquals(1, id, "Context switch never executed") 61 | } 62 | } 63 | } 64 | --------------------------------------------------------------------------------