From fe27e511c652b210e4380f078c969688858c88ac Mon Sep 17 00:00:00 2001 From: Sergey Polohach Date: Fri, 23 Aug 2019 18:10:19 +0300 Subject: [PATCH] initial commit --- .gitignore | 9 + README.md | 105 + app/.gitignore | 8 + app/build.gradle | 82 + app/credentials.json | 10 + app/proguard-rules.pro | 29 + app/src/main/AndroidManifest.xml | 74 + .../main/java/com/cleveroad/MainActivity.kt | 35 + .../cleveroad/auth_example/AuthFragment.kt | 116 ++ .../java/com/cleveroad/auth_example/AuthVM.kt | 6 + .../auth_example/SampleAuthActivity.kt | 37 + .../cleveroad/auth_example/SampleAuthVM.kt | 6 + .../compress_image/CompressImageActivity.kt | 57 + .../ffmpeg_example/FFMpegActivity.kt | 175 ++ .../cleveroad/ffmpeg_example/PhotosAdapter.kt | 33 + .../com/cleveroad/gps_example/GpsActivity.kt | 88 + .../gps_example/NotificationUtils.kt | 60 + .../cleveroad/phone_example/BaseFragment.kt | 26 + .../phone_example/BaseTextWatcher.kt | 26 + .../phone_example/ChooseCountryActivity.kt | 43 + .../phone_example/ChooseCountryVM.kt | 6 + .../phone_example/PhoneViewCallback.kt | 7 + .../phone_example/PhoneViewFragment.kt | 101 + .../cleveroad/phone_example/PhoneViewVM.kt | 22 + .../cleveroad/phone_example/RequestCodes.kt | 7 + .../phone_example/ValidatorFactory.kt | 13 + .../cleveroad/validator_example/EditText.kt | 17 + .../validator_example/SimpleTextWatcher.kt | 18 + .../validator_example/ValidatorActivity.kt | 99 + .../res/drawable/background_social_button.xml | 6 + app/src/main/res/layout/activity_auth.xml | 10 + .../res/layout/activity_choose_country.xml | 11 + .../res/layout/activity_compress_image.xml | 18 + .../res/layout/activity_ffmpeg_thumbnails.xml | 68 + app/src/main/res/layout/activity_gps.xml | 19 + app/src/main/res/layout/activity_main.xml | 56 + .../main/res/layout/activity_validator.xml | 133 ++ app/src/main/res/layout/fragment_auth.xml | 33 + .../res/layout/fragment_choose_country.xml | 11 + .../main/res/layout/fragment_phone_view.xml | 86 + app/src/main/res/layout/include_progress.xml | 33 + app/src/main/res/layout/item_photo.xml | 13 + app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3358 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5084 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2386 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 3179 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4648 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7381 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7008 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 11545 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9442 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 16109 bytes app/src/main/res/values/colors.xml | 10 + app/src/main/res/values/strings.xml | 38 + app/src/main/res/values/styles.xml | 48 + build.gradle | 39 + dependencies.gradle | 119 ++ gradle.properties | 15 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 53636 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 160 ++ gradlew.bat | 90 + images/social/facebook.png | Bin 0 -> 955 bytes images/social/google.png | Bin 0 -> 1295 bytes images/social/linkedin.png | Bin 0 -> 1356 bytes images/social/twitter.png | Bin 0 -> 1580 bytes images/social/youtube.png | Bin 0 -> 1158 bytes kotlin-auth/.gitignore | 1 + kotlin-auth/README.md | 154 ++ kotlin-auth/build.gradle | 65 + kotlin-auth/proguard-rules.pro | 21 + kotlin-auth/src/main/AndroidManifest.xml | 10 + .../bootstrap/kotlin_auth/base/AuthHelper.kt | 65 + .../bootstrap/kotlin_auth/base/AuthProxy.kt | 88 + .../bootstrap/kotlin_auth/base/AuthType.kt | 8 + .../facebook/FacebookAuthCallback.kt | 20 + .../facebook/FacebookAuthHelper.kt | 76 + .../facebook/FacebookPermission.kt | 14 + .../kotlin_auth/google/GoogleAuthCallback.kt | 22 + .../kotlin_auth/google/GoogleAuthHelper.kt | 104 + .../linkedin/LinkedInAuthCallback.kt | 15 + .../linkedin/LinkedInAuthHelper.kt | 48 + .../linkedin/LinkedInPermissionContract.kt | 9 + .../linkedin/client/AuthCallback.kt | 10 + .../linkedin/client/AuthHandler.kt | 43 + .../linkedin/client/LinkedInAuthClient.kt | 51 + .../linkedin/client/LinkedInAuthState.kt | 17 + .../linkedin/client/data/RequestCodes.kt | 3 + .../client/errors/LinkedInAuthException.kt | 3 + .../linkedin/client/oauth/OAuthContract.kt | 18 + .../linkedin/client/oauth/OAuthHandler.kt | 16 + .../client/oauth/network/NetworkModule.kt | 8 + .../oauth/network/api/LinkedInAuthApi.kt | 20 + .../oauth/network/beans/AccessTokenBean.kt | 8 + .../oauth/network/clients/LinkedInClient.kt | 52 + .../oauth/network/modules/OAuthModule.kt | 39 + .../client/oauth/screen/OAuthActivity.kt | 134 ++ .../linkedin/client/oauth/screen/OAuthVM.kt | 52 + .../twitter/TwitterAuthCallback.kt | 20 + .../kotlin_auth/twitter/TwitterAuthHelper.kt | 57 + .../twitter/client/AuthCallback.kt | 12 + .../kotlin_auth/twitter/client/AuthHandler.kt | 37 + .../twitter/client/ConfigProvider.kt | 7 + .../twitter/client/TwitterAuthClient.kt | 55 + .../twitter/client/TwitterAuthState.kt | 17 + .../twitter/client/data/AuthConfig.kt | 12 + .../twitter/client/data/RequestCodes.kt | 3 + .../client/errors/TwitterAuthException.kt | 5 + .../twitter/client/oauth/OAuthContract.kt | 16 + .../twitter/client/oauth/OAuthHandler.kt | 16 + .../client/oauth/network/NetworkModule.kt | 8 + .../oauth/network/api/TwitterOAuthApi.kt | 14 + .../network/beans/RequestTokenResponse.kt | 4 + .../oauth/network/clients/TwitterClient.kt | 54 + .../OAuth1SigningInterceptor.java | 211 ++ .../network/interceptors/UrlEscapeUtils.java | 349 ++++ .../network/modules/TwitterOAuthModule.kt | 36 + .../client/oauth/screen/OAuthActivity.kt | 123 ++ .../twitter/client/oauth/screen/OAuthVM.kt | 40 + .../twitter/client/sso/SSOAuthContract.kt | 55 + .../twitter/client/sso/SSOAuthHandler.kt | 39 + .../twitter/client/utils/IntentUtils.kt | 9 + .../twitter/client/utils/SignatureUtils.kt | 56 + .../bootstrap/kotlin_auth/utils/Constants.kt | 3 + .../bootstrap/kotlin_auth/utils/OAuthExt.kt | 20 + .../src/main/res/layout/activity_oauth.xml | 6 + kotlin-auth/src/main/res/values/strings.xml | 3 + kotlin-core/.gitignore | 1 + kotlin-core/README.md | 136 ++ kotlin-core/build.gradle | 59 + kotlin-core/proguard-rules.pro | 21 + .../kotlin_core/ExampleInstrumentedTest.java | 27 + kotlin-core/src/main/AndroidManifest.xml | 1 + .../kotlin_core/adapters/BaseArrayAdapter.kt | 86 + .../kotlin_core/adapters/BaseFilter.kt | 137 ++ .../app_focus/AppFocusLifecycleObserver.kt | 70 + .../kotlin_core/network/ApiException.kt | 34 + .../receivers/SmsBroadcastReceiver.kt | 53 + .../bootstrap/kotlin_core/ui/BackPressable.kt | 8 + .../kotlin_core/ui/BackPressedCallback.kt | 5 + .../bootstrap/kotlin_core/ui/BaseContract.kt | 11 + .../kotlin_core/ui/BaseDialogFragment.kt | 50 + .../kotlin_core/ui/BaseLifecycleActivity.kt | 308 +++ .../ui/BaseLifecycleDialogFragment.kt | 154 ++ .../kotlin_core/ui/BaseLifecycleFragment.kt | 430 +++++ .../kotlin_core/ui/BaseLifecycleViewModel.kt | 133 ++ .../bootstrap/kotlin_core/ui/BaseView.kt | 57 + .../kotlin_core/ui/BlockedCallback.kt | 6 + .../ui/BottomNavigationCallback.kt | 5 + .../kotlin_core/ui/DividerItemDecorator.kt | 28 + .../ui/NotImplementedInterfaceException.kt | 9 + .../bootstrap/kotlin_core/ui/ProgressView.kt | 14 + .../ui/adapter/BaseDiffUtilCallback.kt | 14 + .../ui/adapter/BaseListFragment.kt | 182 ++ .../ui/adapter/BaseRecyclerViewAdapter.kt | 134 ++ .../ui/adapter/BaseSortedListFragment.kt | 181 ++ .../adapter/BaseSortedRecyclerViewAdapter.kt | 120 ++ .../ui/adapter/EndlessScrollListener.kt | 115 ++ .../ui/adapter/NpaLinearLayoutManager.kt | 22 + .../ui/adapter/PaginationListView.kt | 5 + .../listeners/ClickItemTouchListener.kt | 138 ++ .../ui/adapter/listeners/ItemClickSupport.kt | 130 ++ .../adapter/multiselect/BaseSelectAdapter.kt | 92 + .../adapter/multiselect/BaseSelectHolder.kt | 87 + .../multiselect/MultiSelectCallback.kt | 8 + .../ui/adapter/multiselect/Selectable.kt | 5 + .../BaseFragmentPagerAdapter.kt | 52 + .../BaseFragmentStatePagerAdapter.kt | 52 + .../FragmentInfoContainer.kt | 12 + .../kotlin_core/utils/IntentUtils.kt | 51 + .../bootstrap/kotlin_core/utils/LogUtils.kt | 101 + .../bootstrap/kotlin_core/utils/RxUtils.kt | 31 + .../kotlin_core/utils/misc/AssertionExt.kt | 20 + .../utils/misc/GooglePlayServicesHelper.kt | 97 + .../utils/misc/MiscellaneousUtils.kt | 23 + .../utils/misc/PerformanceChecker.kt | 66 + .../kotlin_core/utils/storage/FileExt.kt | 18 + .../kotlin_core/utils/storage/FileUtils.kt | 215 +++ .../utils/storage/FileUtilsCommon.kt | 171 ++ .../kotlin_core/utils/storage/ImageUtils.kt | 313 +++ .../utils/storage/StorageContract.kt | 43 + .../kotlin_core/utils/storage/TypeDirPath.kt | 15 + .../utils/storage/TypeMediaFile.kt | 13 + .../kotlin_core/utils/storage/UriUtils.kt | 59 + .../src/main/res/anim/enter_from_left.xml | 10 + .../src/main/res/anim/enter_from_right.xml | 10 + .../src/main/res/anim/exit_to_left.xml | 10 + .../src/main/res/anim/exit_to_right.xml | 10 + .../src/main/res/drawable/divider_item.xml | 8 + kotlin-core/src/main/res/values/ids.xml | 4 + kotlin-core/src/main/res/values/strings.xml | 7 + .../src/main/res/values/theme_colors.xml | 10 + .../kotlin_core/ExampleUnitTest.java | 17 + kotlin-ext/.gitignore | 1 + kotlin-ext/README.md | 170 ++ kotlin-ext/build.gradle | 55 + kotlin-ext/proguard-rules.pro | 21 + kotlin-ext/src/main/AndroidManifest.xml | 1 + .../bootstrap/kotlin_ext/ActivityExt.kt | 47 + .../cleveroad/bootstrap/kotlin_ext/AnyExt.kt | 7 + .../bootstrap/kotlin_ext/AssertionExt.kt | 41 + .../bootstrap/kotlin_ext/BitmapExt.kt | 13 + .../bootstrap/kotlin_ext/ByteArrayExt.kt | 9 + .../bootstrap/kotlin_ext/CommonExt.kt | 75 + .../bootstrap/kotlin_ext/ContextExt.kt | 69 + .../bootstrap/kotlin_ext/EditTextExt.kt | 70 + .../cleveroad/bootstrap/kotlin_ext/FileExt.kt | 17 + .../bootstrap/kotlin_ext/ImageView.kt | 9 + .../bootstrap/kotlin_ext/KeyboardExt.kt | 43 + .../cleveroad/bootstrap/kotlin_ext/ListExt.kt | 3 + .../cleveroad/bootstrap/kotlin_ext/RxExt.kt | 137 ++ .../bootstrap/kotlin_ext/ScreenExt.kt | 40 + .../bootstrap/kotlin_ext/StringExt.kt | 50 + .../bootstrap/kotlin_ext/TextViewExt.kt | 87 + .../cleveroad/bootstrap/kotlin_ext/UriExt.kt | 11 + .../cleveroad/bootstrap/kotlin_ext/ViewExt.kt | 99 + kotlin-ext/src/main/res/values/strings.xml | 3 + kotlin-ffmpeg-thumbnails/.gitignore | 1 + kotlin-ffmpeg-thumbnails/README.md | 115 ++ kotlin-ffmpeg-thumbnails/build.gradle | 43 + kotlin-ffmpeg-thumbnails/proguard-rules.pro | 27 + .../src/main/AndroidManifest.xml | 1 + .../kotlin_ffmpeg_thumbnails/FFmpegHelper.kt | 85 + .../ThumbnailsFFMpegBuilder.kt | 255 +++ .../cache/ResultCache.kt | 15 + .../kotlin_ffmpeg_thumbnails/model/Result.kt | 4 + .../model/Thumbnail.kt | 9 + .../model/VideoOptions.kt | 8 + .../types/ExtractFrequency.kt | 12 + .../types/ImageType.kt | 11 + .../types/VideoSync.kt | 16 + .../src/main/res/values/strings.xml | 3 + kotlin-ffmpeg-video-compress/.gitignore | 1 + kotlin-ffmpeg-video-compress/README.md | 104 + kotlin-ffmpeg-video-compress/build.gradle | 42 + .../proguard-rules.pro | 21 + .../src/main/AndroidManifest.xml | 1 + .../CompressVideoBuilder.kt | 236 +++ .../kotlin_ffmpeg_video_compress/Constants.kt | 30 + .../FFmpegHelper.kt | 60 + .../kotlin_ffmpeg_video_compress/TimeUtils.kt | 32 + .../types/PresetType.kt | 26 + .../types/StrictType.kt | 29 + .../src/main/res/values/strings.xml | 3 + kotlin-gps/.gitignore | 1 + kotlin-gps/README.md | 123 ++ kotlin-gps/build.gradle | 47 + kotlin-gps/proguard-rules.pro | 21 + kotlin-gps/src/main/AndroidManifest.xml | 16 + .../bootstrap/kotlin_gps/GpsProvider.kt | 99 + .../bootstrap/kotlin_gps/GpsProviderImpl.kt | 145 ++ .../kotlin_gps/GpsProviderTracker.kt | 20 + .../kotlin_gps/GpsProviderTrackerImpl.kt | 46 + .../bootstrap/kotlin_gps/GpsUiDelegate.kt | 23 + .../bootstrap/kotlin_gps/GpsUiDelegateImpl.kt | 114 ++ .../bootstrap/kotlin_gps/LocationProcessor.kt | 18 + .../kotlin_gps/LocationProcessorImpl.kt | 15 + .../bootstrap/kotlin_gps/LocationProvider.kt | 17 + .../dialog/AllowPermissionDialog.kt | 68 + .../kotlin_gps/dialog/GpsConfirmDialog.kt | 59 + .../receiver/GpsProviderReceiver.kt | 29 + .../kotlin_gps/service/GpsTrackerService.kt | 324 ++++ .../kotlin_gps/service/TrackerState.kt | 5 + kotlin-gps/src/main/res/values/strings.xml | 8 + kotlin-permissionrequest/.gitignore | 1 + kotlin-permissionrequest/README.md | 101 + kotlin-permissionrequest/build.gradle | 57 + kotlin-permissionrequest/proguard-rules.pro | 21 + .../src/main/AndroidManifest.xml | 1 + .../BasePermissionRequest.kt | 115 ++ .../PermissionActivityRequest.kt | 24 + .../PermissionFragmentRequest.kt | 23 + .../PermissionProviderResult.kt | 19 + .../PermissionRequest.kt | 118 ++ .../PermissionResult.kt | 15 + .../src/main/res/values/strings.xml | 3 + kotlin-phone-input/.gitignore | 1 + kotlin-phone-input/README.md | 166 ++ kotlin-phone-input/build.gradle | 60 + .../src/main/AndroidManifest.xml | 1 + .../src/main/assets/country_codes.json | 1689 +++++++++++++++++ .../bootstrap/kotlin_phone_input/Constants.kt | 9 + .../kotlin_phone_input/assets/AssetsModule.kt | 27 + .../assets/AssetsProvider.kt | 18 + .../converters/CountryAssetsConverter.kt | 32 + .../choose_country/ChooseCountryFragment.kt | 129 ++ .../choose_country/ChooseCountryViewModel.kt | 31 + .../choose_country/CountriesAdapter.kt | 73 + .../data/converter/BaseConverter.kt | 87 + .../data/converter/Converter.kt | 51 + .../data/models/CountryAsset.kt | 29 + .../data/models/KParcelable.kt | 19 + .../kotlin_phone_input/utils/BitmapUtils.kt | 90 + .../kotlin_phone_input/utils/CountryFlag.kt | 29 + .../utils/DetectCountryUtil.kt | 61 + .../kotlin_phone_input/utils/EnumUtil.kt | 55 + .../utils/PhoneFormatUtils.kt | 49 + .../utils/PhoneMaskUtils.kt | 76 + .../view/PhoneInputLayout.kt | 226 +++ ...background_gradient_view_under_toolbar.xml | 9 + .../main/res/drawable/background_invalid.xml | 28 + .../main/res/drawable/background_valid.xml | 28 + .../src/main/res/drawable/divider_item.xml | 8 + .../res/drawable/ic_arrow_gray_back_24dp.xml | 10 + .../ic_check_green_highlight_24dp.xml | 9 + .../main/res/drawable/ic_list_abkhazia.xml | 19 + .../src/main/res/drawable/ic_list_ad.xml | 50 + .../src/main/res/drawable/ic_list_ae.xml | 7 + .../src/main/res/drawable/ic_list_af.xml | 35 + .../src/main/res/drawable/ic_list_ag.xml | 9 + .../src/main/res/drawable/ic_list_ai.xml | 16 + .../src/main/res/drawable/ic_list_al.xml | 5 + .../src/main/res/drawable/ic_list_am.xml | 6 + .../src/main/res/drawable/ic_list_an.xml | 162 ++ .../src/main/res/drawable/ic_list_ao.xml | 10 + .../src/main/res/drawable/ic_list_aq.xml | 21 + .../src/main/res/drawable/ic_list_ar.xml | 8 + .../src/main/res/drawable/ic_list_as.xml | 18 + .../src/main/res/drawable/ic_list_at.xml | 6 + .../src/main/res/drawable/ic_list_au.xml | 16 + .../src/main/res/drawable/ic_list_aw.xml | 8 + .../src/main/res/drawable/ic_list_ax.xml | 6 + .../src/main/res/drawable/ic_list_az.xml | 8 + .../res/drawable/ic_list_azores_islands.xml | 29 + .../src/main/res/drawable/ic_list_ba.xml | 15 + .../src/main/res/drawable/ic_list_bb.xml | 7 + .../src/main/res/drawable/ic_list_bc.xml | 19 + .../src/main/res/drawable/ic_list_bd.xml | 5 + .../src/main/res/drawable/ic_list_be.xml | 6 + .../src/main/res/drawable/ic_list_bf.xml | 6 + .../src/main/res/drawable/ic_list_bg.xml | 6 + .../src/main/res/drawable/ic_list_bh.xml | 5 + .../src/main/res/drawable/ic_list_bi.xml | 13 + .../src/main/res/drawable/ic_list_bj.xml | 6 + .../src/main/res/drawable/ic_list_bm.xml | 46 + .../src/main/res/drawable/ic_list_bn.xml | 12 + .../src/main/res/drawable/ic_list_bo.xml | 62 + .../src/main/res/drawable/ic_list_bonaire.xml | 8 + .../src/main/res/drawable/ic_list_bq.xml | 7 + .../src/main/res/drawable/ic_list_br.xml | 18 + .../src/main/res/drawable/ic_list_bs.xml | 7 + .../src/main/res/drawable/ic_list_bt.xml | 30 + .../src/main/res/drawable/ic_list_bv.xml | 18 + .../src/main/res/drawable/ic_list_bw.xml | 7 + .../src/main/res/drawable/ic_list_by.xml | 7 + .../src/main/res/drawable/ic_list_bz.xml | 139 ++ .../src/main/res/drawable/ic_list_ca.xml | 8 + .../res/drawable/ic_list_canary_islands.xml | 26 + .../src/main/res/drawable/ic_list_cc.xml | 13 + .../src/main/res/drawable/ic_list_cd.xml | 8 + .../src/main/res/drawable/ic_list_ce.xml | 39 + .../src/main/res/drawable/ic_list_cf.xml | 9 + .../src/main/res/drawable/ic_list_cg.xml | 6 + .../src/main/res/drawable/ic_list_ch.xml | 5 + .../src/main/res/drawable/ic_list_ci.xml | 6 + .../src/main/res/drawable/ic_list_ck.xml | 26 + .../src/main/res/drawable/ic_list_cl.xml | 7 + .../src/main/res/drawable/ic_list_cm.xml | 7 + .../src/main/res/drawable/ic_list_cn.xml | 9 + .../src/main/res/drawable/ic_list_cn_xz.xml | 139 ++ .../src/main/res/drawable/ic_list_co.xml | 6 + .../src/main/res/drawable/ic_list_corsica.xml | 5 + .../src/main/res/drawable/ic_list_cr.xml | 64 + .../src/main/res/drawable/ic_list_cs.xml | 12 + .../src/main/res/drawable/ic_list_cu.xml | 10 + .../src/main/res/drawable/ic_list_cv.xml | 17 + .../src/main/res/drawable/ic_list_cw.xml | 7 + .../src/main/res/drawable/ic_list_cx.xml | 13 + .../src/main/res/drawable/ic_list_cy.xml | 8 + .../src/main/res/drawable/ic_list_cz.xml | 6 + .../src/main/res/drawable/ic_list_de.xml | 6 + .../src/main/res/drawable/ic_list_dj.xml | 7 + .../src/main/res/drawable/ic_list_dk.xml | 5 + .../src/main/res/drawable/ic_list_dm.xml | 32 + .../src/main/res/drawable/ic_list_do.xml | 58 + .../src/main/res/drawable/ic_list_dz.xml | 7 + .../src/main/res/drawable/ic_list_ec.xml | 46 + .../src/main/res/drawable/ic_list_ee.xml | 6 + .../src/main/res/drawable/ic_list_eg.xml | 7 + .../src/main/res/drawable/ic_list_eh.xml | 24 + .../src/main/res/drawable/ic_list_england.xml | 5 + .../src/main/res/drawable/ic_list_er.xml | 7 + .../src/main/res/drawable/ic_list_es.xml | 42 + .../src/main/res/drawable/ic_list_es_ib.xml | 14 + .../src/main/res/drawable/ic_list_es_ml.xml | 74 + .../src/main/res/drawable/ic_list_es_pv.xml | 6 + .../src/main/res/drawable/ic_list_et.xml | 9 + .../src/main/res/drawable/ic_list_eu.xml | 16 + .../src/main/res/drawable/ic_list_fi.xml | 5 + .../src/main/res/drawable/ic_list_fj.xml | 42 + .../src/main/res/drawable/ic_list_fk.xml | 40 + .../src/main/res/drawable/ic_list_fm.xml | 8 + .../src/main/res/drawable/ic_list_fo.xml | 18 + .../src/main/res/drawable/ic_list_fr.xml | 6 + .../src/main/res/drawable/ic_list_ga.xml | 6 + .../drawable/ic_list_galapagos_islands.xml | 6 + .../src/main/res/drawable/ic_list_gb.xml | 10 + .../src/main/res/drawable/ic_list_gd.xml | 17 + .../src/main/res/drawable/ic_list_ge.xml | 9 + .../src/main/res/drawable/ic_list_gf.xml | 15 + .../src/main/res/drawable/ic_list_gg.xml | 7 + .../src/main/res/drawable/ic_list_gh.xml | 7 + .../src/main/res/drawable/ic_list_gi.xml | 13 + .../src/main/res/drawable/ic_list_gl.xml | 7 + .../src/main/res/drawable/ic_list_gm.xml | 8 + .../src/main/res/drawable/ic_list_gn.xml | 6 + .../src/main/res/drawable/ic_list_gp.xml | 15 + .../src/main/res/drawable/ic_list_gq.xml | 17 + .../src/main/res/drawable/ic_list_gr.xml | 11 + .../src/main/res/drawable/ic_list_gs.xml | 760 ++++++++ .../src/main/res/drawable/ic_list_gt.xml | 72 + .../src/main/res/drawable/ic_list_gu.xml | 14 + .../src/main/res/drawable/ic_list_gw.xml | 7 + .../src/main/res/drawable/ic_list_gy.xml | 18 + .../src/main/res/drawable/ic_list_hk.xml | 9 + .../src/main/res/drawable/ic_list_hn.xml | 11 + .../src/main/res/drawable/ic_list_hr.xml | 46 + .../src/main/res/drawable/ic_list_ht.xml | 5 + .../src/main/res/drawable/ic_list_hu.xml | 6 + .../src/main/res/drawable/ic_list_id.xml | 5 + .../src/main/res/drawable/ic_list_ie.xml | 6 + .../src/main/res/drawable/ic_list_il.xml | 6 + .../src/main/res/drawable/ic_list_im.xml | 54 + .../src/main/res/drawable/ic_list_in.xml | 26 + .../src/main/res/drawable/ic_list_io.xml | 20 + .../src/main/res/drawable/ic_list_iq.xml | 13 + .../src/main/res/drawable/ic_list_ir.xml | 46 + .../src/main/res/drawable/ic_list_is.xml | 6 + .../src/main/res/drawable/ic_list_it.xml | 6 + .../src/main/res/drawable/ic_list_itg.xml | 58 + .../src/main/res/drawable/ic_list_je.xml | 52 + .../src/main/res/drawable/ic_list_jm.xml | 7 + .../src/main/res/drawable/ic_list_jo.xml | 8 + .../src/main/res/drawable/ic_list_jp.xml | 5 + .../src/main/res/drawable/ic_list_ke.xml | 18 + .../src/main/res/drawable/ic_list_kg.xml | 21 + .../src/main/res/drawable/ic_list_kh.xml | 6 + .../src/main/res/drawable/ic_list_ki.xml | 14 + .../src/main/res/drawable/ic_list_km.xml | 13 + .../src/main/res/drawable/ic_list_kn.xml | 10 + .../src/main/res/drawable/ic_list_kp.xml | 9 + .../src/main/res/drawable/ic_list_kr.xml | 24 + .../src/main/res/drawable/ic_list_kw.xml | 7 + .../src/main/res/drawable/ic_list_ky.xml | 76 + .../src/main/res/drawable/ic_list_kz.xml | 39 + .../src/main/res/drawable/ic_list_la.xml | 7 + .../src/main/res/drawable/ic_list_lb.xml | 7 + .../src/main/res/drawable/ic_list_lc.xml | 7 + .../src/main/res/drawable/ic_list_li.xml | 12 + .../src/main/res/drawable/ic_list_lk.xml | 26 + .../src/main/res/drawable/ic_list_lr.xml | 16 + .../src/main/res/drawable/ic_list_ls.xml | 7 + .../src/main/res/drawable/ic_list_lt.xml | 6 + .../src/main/res/drawable/ic_list_lu.xml | 6 + .../src/main/res/drawable/ic_list_lv.xml | 5 + .../src/main/res/drawable/ic_list_ly.xml | 8 + .../src/main/res/drawable/ic_list_ma.xml | 5 + .../src/main/res/drawable/ic_list_madeira.xml | 8 + .../src/main/res/drawable/ic_list_mc.xml | 5 + .../src/main/res/drawable/ic_list_md.xml | 48 + .../src/main/res/drawable/ic_list_me.xml | 14 + .../src/main/res/drawable/ic_list_mg.xml | 6 + .../src/main/res/drawable/ic_list_mh.xml | 7 + .../src/main/res/drawable/ic_list_mk.xml | 13 + .../src/main/res/drawable/ic_list_ml.xml | 6 + .../src/main/res/drawable/ic_list_mm.xml | 7 + .../src/main/res/drawable/ic_list_mn.xml | 17 + .../src/main/res/drawable/ic_list_mo.xml | 15 + .../src/main/res/drawable/ic_list_mp.xml | 27 + .../src/main/res/drawable/ic_list_mq.xml | 9 + .../src/main/res/drawable/ic_list_mr.xml | 6 + .../src/main/res/drawable/ic_list_ms.xml | 28 + .../src/main/res/drawable/ic_list_mt.xml | 13 + .../src/main/res/drawable/ic_list_mu.xml | 7 + .../src/main/res/drawable/ic_list_mv.xml | 6 + .../src/main/res/drawable/ic_list_mw.xml | 30 + .../src/main/res/drawable/ic_list_mx.xml | 25 + .../src/main/res/drawable/ic_list_my.xml | 20 + .../src/main/res/drawable/ic_list_mz.xml | 18 + .../src/main/res/drawable/ic_list_na.xml | 12 + .../src/main/res/drawable/ic_list_nato.xml | 9 + .../src/main/res/drawable/ic_list_nc.xml | 51 + .../src/main/res/drawable/ic_list_ne.xml | 7 + .../src/main/res/drawable/ic_list_nf.xml | 7 + .../src/main/res/drawable/ic_list_ng.xml | 6 + .../src/main/res/drawable/ic_list_ni.xml | 43 + .../src/main/res/drawable/ic_list_nl.xml | 6 + .../src/main/res/drawable/ic_list_no.xml | 6 + .../src/main/res/drawable/ic_list_np.xml | 8 + .../src/main/res/drawable/ic_list_nr.xml | 6 + .../src/main/res/drawable/ic_list_nu.xml | 17 + .../src/main/res/drawable/ic_list_nz.xml | 18 + .../src/main/res/drawable/ic_list_om.xml | 35 + .../src/main/res/drawable/ic_list_ossetia.xml | 6 + .../src/main/res/drawable/ic_list_pa.xml | 8 + .../src/main/res/drawable/ic_list_pe.xml | 6 + .../src/main/res/drawable/ic_list_pf.xml | 24 + .../src/main/res/drawable/ic_list_pg.xml | 11 + .../src/main/res/drawable/ic_list_ph.xml | 18 + .../src/main/res/drawable/ic_list_pk.xml | 7 + .../src/main/res/drawable/ic_list_pl.xml | 5 + .../src/main/res/drawable/ic_list_pm.xml | 15 + .../src/main/res/drawable/ic_list_pn.xml | 60 + .../src/main/res/drawable/ic_list_pr.xml | 10 + .../src/main/res/drawable/ic_list_ps.xml | 7 + .../src/main/res/drawable/ic_list_pt.xml | 20 + .../src/main/res/drawable/ic_list_pv.xml | 10 + .../src/main/res/drawable/ic_list_pw.xml | 5 + .../src/main/res/drawable/ic_list_py.xml | 10 + .../src/main/res/drawable/ic_list_qa.xml | 5 + .../main/res/drawable/ic_list_rapa_nui.xml | 5 + .../src/main/res/drawable/ic_list_re.xml | 15 + .../src/main/res/drawable/ic_list_ro.xml | 6 + .../src/main/res/drawable/ic_list_rs.xml | 38 + .../src/main/res/drawable/ic_list_ru.xml | 6 + .../src/main/res/drawable/ic_list_rw.xml | 9 + .../src/main/res/drawable/ic_list_sa.xml | 29 + ..._list_sahrawi_arab_democratic_republic.xml | 9 + .../main/res/drawable/ic_list_sardinia.xml | 9 + .../src/main/res/drawable/ic_list_sb.xml | 11 + .../src/main/res/drawable/ic_list_sc.xml | 8 + .../src/main/res/drawable/ic_list_sd.xml | 7 + .../src/main/res/drawable/ic_list_se.xml | 5 + .../src/main/res/drawable/ic_list_sg.xml | 11 + .../src/main/res/drawable/ic_list_sh.xml | 19 + .../src/main/res/drawable/ic_list_si.xml | 14 + .../res/drawable/ic_list_sint_eustatius.xml | 8 + .../src/main/res/drawable/ic_list_sk.xml | 10 + .../src/main/res/drawable/ic_list_sl.xml | 6 + .../src/main/res/drawable/ic_list_sm.xml | 61 + .../src/main/res/drawable/ic_list_sn.xml | 7 + .../src/main/res/drawable/ic_list_so.xml | 5 + .../main/res/drawable/ic_list_somaliland.xml | 31 + .../src/main/res/drawable/ic_list_sr.xml | 8 + .../src/main/res/drawable/ic_list_ss.xml | 11 + .../src/main/res/drawable/ic_list_st.xml | 8 + .../main/res/drawable/ic_list_st_barts.xml | 31 + .../src/main/res/drawable/ic_list_sv.xml | 72 + .../src/main/res/drawable/ic_list_sx.xml | 27 + .../src/main/res/drawable/ic_list_sy.xml | 8 + .../src/main/res/drawable/ic_list_sz.xml | 51 + .../src/main/res/drawable/ic_list_tc.xml | 19 + .../src/main/res/drawable/ic_list_td.xml | 6 + .../src/main/res/drawable/ic_list_tf.xml | 33 + .../src/main/res/drawable/ic_list_tg.xml | 10 + .../src/main/res/drawable/ic_list_th.xml | 7 + .../src/main/res/drawable/ic_list_tj.xml | 18 + .../src/main/res/drawable/ic_list_tk.xml | 10 + .../src/main/res/drawable/ic_list_tl.xml | 7 + .../src/main/res/drawable/ic_list_tm.xml | 46 + .../src/main/res/drawable/ic_list_tn.xml | 7 + .../src/main/res/drawable/ic_list_to.xml | 6 + .../src/main/res/drawable/ic_list_tr.xml | 6 + .../res/drawable/ic_list_transnistria.xml | 5 + .../src/main/res/drawable/ic_list_tt.xml | 7 + .../src/main/res/drawable/ic_list_tv.xml | 19 + .../src/main/res/drawable/ic_list_tw.xml | 10 + .../src/main/res/drawable/ic_list_tz.xml | 7 + .../src/main/res/drawable/ic_list_ua.xml | 5 + .../src/main/res/drawable/ic_list_ug.xml | 18 + .../src/main/res/drawable/ic_list_uk.xml | 5 + .../res/drawable/ic_list_united_nations.xml | 25 + .../src/main/res/drawable/ic_list_us.xml | 53 + .../src/main/res/drawable/ic_list_us_hi.xml | 18 + .../src/main/res/drawable/ic_list_uy.xml | 44 + .../src/main/res/drawable/ic_list_uz.xml | 24 + .../src/main/res/drawable/ic_list_va.xml | 47 + .../src/main/res/drawable/ic_list_vc.xml | 9 + .../src/main/res/drawable/ic_list_ve.xml | 16 + .../src/main/res/drawable/ic_list_vg.xml | 44 + .../src/main/res/drawable/ic_list_vi.xml | 24 + .../src/main/res/drawable/ic_list_vn.xml | 5 + .../src/main/res/drawable/ic_list_vu.xml | 9 + .../src/main/res/drawable/ic_list_wales.xml | 10 + .../src/main/res/drawable/ic_list_wf.xml | 21 + .../src/main/res/drawable/ic_list_ws.xml | 10 + .../src/main/res/drawable/ic_list_xk.xml | 11 + .../src/main/res/drawable/ic_list_ye.xml | 6 + .../src/main/res/drawable/ic_list_yt.xml | 213 +++ .../src/main/res/drawable/ic_list_za.xml | 10 + .../src/main/res/drawable/ic_list_zm.xml | 9 + .../src/main/res/drawable/ic_list_zw.xml | 17 + .../main/res/drawable/ic_search_gray_24dp.xml | 10 + .../main/res/drawable/underline_active.xml | 8 + .../src/main/res/drawable/underline_error.xml | 8 + .../res/drawable/underline_error_inactive.xml | 8 + .../main/res/drawable/underline_inactive.xml | 8 + .../src/main/res/drawable/underline_valid.xml | 8 + .../src/main/res/font/aclonica.xml | 7 + .../src/main/res/font/aref_ruqaa.xml | 7 + .../res/layout/choose_country_fragment.xml | 27 + .../src/main/res/layout/country_item.xml | 32 + .../src/main/res/layout/include_toolbar.xml | 22 + .../src/main/res/menu/menu_country_search.xml | 12 + .../src/main/res/values/attrs.xml | 37 + .../src/main/res/values/colors.xml | 12 + .../src/main/res/values/dimens.xml | 10 + .../src/main/res/values/flag_path.xml | 108 ++ .../src/main/res/values/font_certs.xml | 17 + .../src/main/res/values/preloaded_fonts.xml | 7 + .../src/main/res/values/strings.xml | 9 + .../src/main/res/values/styles.xml | 30 + kotlin-rx-bus/.gitignore | 1 + kotlin-rx-bus/README.md | 94 + kotlin-rx-bus/build.gradle | 55 + kotlin-rx-bus/proguard-rules.pro | 21 + .../ExampleInstrumentedTest.java | 27 + kotlin-rx-bus/src/main/AndroidManifest.xml | 1 + .../bootstrap/kotlin_rx_bus/RxBus.kt | 31 + kotlin-rx-bus/src/main/res/values/strings.xml | 3 + .../kotlin_rx_bus/ExampleUnitTest.java | 17 + kotlin-validators/.gitignore | 1 + kotlin-validators/README.md | 141 ++ kotlin-validators/build.gradle | 55 + kotlin-validators/proguard-rules.pro | 25 + .../EmailValidationUnitTest.kt | 63 + .../ExampleInstrumentedTest.java | 27 + .../src/main/AndroidManifest.xml | 1 + .../kotlin_validators/DateValidator.kt | 28 + .../kotlin_validators/DateValidatorImpl.kt | 75 + .../kotlin_validators/EmailValidator.kt | 61 + .../bootstrap/kotlin_validators/Extensions.kt | 6 + .../kotlin_validators/InviteCodeValidator.kt | 65 + .../MatchPasswordValidator.kt | 155 ++ .../MatchValidationResponse.kt | 14 + .../MatchValidationResponseImpl.kt | 7 + .../kotlin_validators/MatchValidator.kt | 16 + .../kotlin_validators/NameValidator.kt | 91 + .../kotlin_validators/PasswordValidator.kt | 115 ++ .../kotlin_validators/PhoneValidator.kt | 17 + .../kotlin_validators/PhoneValidatorImpl.kt | 58 + .../kotlin_validators/ValidationResponse.kt | 20 + .../ValidationResponseImpl.kt | 5 + .../bootstrap/kotlin_validators/Validator.kt | 15 + .../kotlin_validators/ValidatorsFactory.kt | 66 + .../src/main/res/values/integers.xml | 10 + .../src/main/res/values/strings.xml | 30 + .../src/main/res/values/strings_tests.xml | 29 + .../kotlin_validators/ExampleUnitTest.java | 17 + main_jcenter.settings.gradle | 4 + settings.gradle | 11 + 641 files changed, 24078 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/credentials.json create mode 100644 app/proguard-rules.pro create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/com/cleveroad/MainActivity.kt create mode 100644 app/src/main/java/com/cleveroad/auth_example/AuthFragment.kt create mode 100644 app/src/main/java/com/cleveroad/auth_example/AuthVM.kt create mode 100644 app/src/main/java/com/cleveroad/auth_example/SampleAuthActivity.kt create mode 100644 app/src/main/java/com/cleveroad/auth_example/SampleAuthVM.kt create mode 100644 app/src/main/java/com/cleveroad/compress_image/CompressImageActivity.kt create mode 100644 app/src/main/java/com/cleveroad/ffmpeg_example/FFMpegActivity.kt create mode 100644 app/src/main/java/com/cleveroad/ffmpeg_example/PhotosAdapter.kt create mode 100644 app/src/main/java/com/cleveroad/gps_example/GpsActivity.kt create mode 100644 app/src/main/java/com/cleveroad/gps_example/NotificationUtils.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/BaseFragment.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/BaseTextWatcher.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/ChooseCountryActivity.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/ChooseCountryVM.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/PhoneViewCallback.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/PhoneViewFragment.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/PhoneViewVM.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/RequestCodes.kt create mode 100644 app/src/main/java/com/cleveroad/phone_example/ValidatorFactory.kt create mode 100644 app/src/main/java/com/cleveroad/validator_example/EditText.kt create mode 100644 app/src/main/java/com/cleveroad/validator_example/SimpleTextWatcher.kt create mode 100644 app/src/main/java/com/cleveroad/validator_example/ValidatorActivity.kt create mode 100644 app/src/main/res/drawable/background_social_button.xml create mode 100644 app/src/main/res/layout/activity_auth.xml create mode 100644 app/src/main/res/layout/activity_choose_country.xml create mode 100644 app/src/main/res/layout/activity_compress_image.xml create mode 100644 app/src/main/res/layout/activity_ffmpeg_thumbnails.xml create mode 100644 app/src/main/res/layout/activity_gps.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/layout/activity_validator.xml create mode 100644 app/src/main/res/layout/fragment_auth.xml create mode 100644 app/src/main/res/layout/fragment_choose_country.xml create mode 100644 app/src/main/res/layout/fragment_phone_view.xml create mode 100644 app/src/main/res/layout/include_progress.xml create mode 100644 app/src/main/res/layout/item_photo.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/styles.xml create mode 100644 build.gradle create mode 100644 dependencies.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 images/social/facebook.png create mode 100644 images/social/google.png create mode 100644 images/social/linkedin.png create mode 100644 images/social/twitter.png create mode 100644 images/social/youtube.png create mode 100644 kotlin-auth/.gitignore create mode 100644 kotlin-auth/README.md create mode 100644 kotlin-auth/build.gradle create mode 100644 kotlin-auth/proguard-rules.pro create mode 100644 kotlin-auth/src/main/AndroidManifest.xml create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/base/AuthHelper.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/base/AuthProxy.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/base/AuthType.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/facebook/FacebookAuthCallback.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/facebook/FacebookAuthHelper.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/facebook/FacebookPermission.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/google/GoogleAuthCallback.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/google/GoogleAuthHelper.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/LinkedInAuthCallback.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/LinkedInAuthHelper.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/LinkedInPermissionContract.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/AuthCallback.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/AuthHandler.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/LinkedInAuthClient.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/LinkedInAuthState.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/data/RequestCodes.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/errors/LinkedInAuthException.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/OAuthContract.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/OAuthHandler.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/network/NetworkModule.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/network/api/LinkedInAuthApi.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/network/beans/AccessTokenBean.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/network/clients/LinkedInClient.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/network/modules/OAuthModule.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/screen/OAuthActivity.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/linkedin/client/oauth/screen/OAuthVM.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/TwitterAuthCallback.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/TwitterAuthHelper.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/AuthCallback.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/AuthHandler.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/ConfigProvider.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/TwitterAuthClient.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/TwitterAuthState.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/data/AuthConfig.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/data/RequestCodes.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/errors/TwitterAuthException.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/OAuthContract.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/OAuthHandler.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/network/NetworkModule.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/network/api/TwitterOAuthApi.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/network/beans/RequestTokenResponse.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/network/clients/TwitterClient.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/network/interceptors/OAuth1SigningInterceptor.java create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/network/interceptors/UrlEscapeUtils.java create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/network/modules/TwitterOAuthModule.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/screen/OAuthActivity.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/oauth/screen/OAuthVM.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/sso/SSOAuthContract.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/sso/SSOAuthHandler.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/utils/IntentUtils.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/twitter/client/utils/SignatureUtils.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/utils/Constants.kt create mode 100644 kotlin-auth/src/main/java/com/cleveroad/bootstrap/kotlin_auth/utils/OAuthExt.kt create mode 100644 kotlin-auth/src/main/res/layout/activity_oauth.xml create mode 100644 kotlin-auth/src/main/res/values/strings.xml create mode 100644 kotlin-core/.gitignore create mode 100644 kotlin-core/README.md create mode 100644 kotlin-core/build.gradle create mode 100644 kotlin-core/proguard-rules.pro create mode 100644 kotlin-core/src/androidTest/java/com/cleveroad/bootstrap/kotlin_core/ExampleInstrumentedTest.java create mode 100644 kotlin-core/src/main/AndroidManifest.xml create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/adapters/BaseArrayAdapter.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/adapters/BaseFilter.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/app_focus/AppFocusLifecycleObserver.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/network/ApiException.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/receivers/SmsBroadcastReceiver.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BackPressable.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BackPressedCallback.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BaseContract.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BaseDialogFragment.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BaseLifecycleActivity.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BaseLifecycleDialogFragment.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BaseLifecycleFragment.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BaseLifecycleViewModel.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BaseView.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BlockedCallback.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/BottomNavigationCallback.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/DividerItemDecorator.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/NotImplementedInterfaceException.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/ProgressView.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/BaseDiffUtilCallback.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/BaseListFragment.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/BaseRecyclerViewAdapter.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/BaseSortedListFragment.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/BaseSortedRecyclerViewAdapter.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/EndlessScrollListener.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/NpaLinearLayoutManager.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/PaginationListView.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/listeners/ClickItemTouchListener.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/listeners/ItemClickSupport.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/multiselect/BaseSelectAdapter.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/multiselect/BaseSelectHolder.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/multiselect/MultiSelectCallback.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/adapter/multiselect/Selectable.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/view_pager_adapter/BaseFragmentPagerAdapter.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/view_pager_adapter/BaseFragmentStatePagerAdapter.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/ui/view_pager_adapter/FragmentInfoContainer.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/IntentUtils.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/LogUtils.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/RxUtils.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/misc/AssertionExt.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/misc/GooglePlayServicesHelper.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/misc/MiscellaneousUtils.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/misc/PerformanceChecker.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/storage/FileExt.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/storage/FileUtils.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/storage/FileUtilsCommon.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/storage/ImageUtils.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/storage/StorageContract.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/storage/TypeDirPath.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/storage/TypeMediaFile.kt create mode 100644 kotlin-core/src/main/kotlin/com/cleveroad/bootstrap/kotlin_core/utils/storage/UriUtils.kt create mode 100644 kotlin-core/src/main/res/anim/enter_from_left.xml create mode 100644 kotlin-core/src/main/res/anim/enter_from_right.xml create mode 100644 kotlin-core/src/main/res/anim/exit_to_left.xml create mode 100644 kotlin-core/src/main/res/anim/exit_to_right.xml create mode 100644 kotlin-core/src/main/res/drawable/divider_item.xml create mode 100644 kotlin-core/src/main/res/values/ids.xml create mode 100644 kotlin-core/src/main/res/values/strings.xml create mode 100644 kotlin-core/src/main/res/values/theme_colors.xml create mode 100644 kotlin-core/src/test/java/com/cleveroad/bootstrap/kotlin_core/ExampleUnitTest.java create mode 100644 kotlin-ext/.gitignore create mode 100644 kotlin-ext/README.md create mode 100644 kotlin-ext/build.gradle create mode 100644 kotlin-ext/proguard-rules.pro create mode 100644 kotlin-ext/src/main/AndroidManifest.xml create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/ActivityExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/AnyExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/AssertionExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/BitmapExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/ByteArrayExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/CommonExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/ContextExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/EditTextExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/FileExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/ImageView.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/KeyboardExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/ListExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/RxExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/ScreenExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/StringExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/TextViewExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/UriExt.kt create mode 100644 kotlin-ext/src/main/kotlin/com/cleveroad/bootstrap/kotlin_ext/ViewExt.kt create mode 100644 kotlin-ext/src/main/res/values/strings.xml create mode 100644 kotlin-ffmpeg-thumbnails/.gitignore create mode 100644 kotlin-ffmpeg-thumbnails/README.md create mode 100644 kotlin-ffmpeg-thumbnails/build.gradle create mode 100644 kotlin-ffmpeg-thumbnails/proguard-rules.pro create mode 100644 kotlin-ffmpeg-thumbnails/src/main/AndroidManifest.xml create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/FFmpegHelper.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/ThumbnailsFFMpegBuilder.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/cache/ResultCache.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/model/Result.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/model/Thumbnail.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/model/VideoOptions.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/types/ExtractFrequency.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/types/ImageType.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_thumbnails/types/VideoSync.kt create mode 100644 kotlin-ffmpeg-thumbnails/src/main/res/values/strings.xml create mode 100644 kotlin-ffmpeg-video-compress/.gitignore create mode 100644 kotlin-ffmpeg-video-compress/README.md create mode 100644 kotlin-ffmpeg-video-compress/build.gradle create mode 100644 kotlin-ffmpeg-video-compress/proguard-rules.pro create mode 100644 kotlin-ffmpeg-video-compress/src/main/AndroidManifest.xml create mode 100644 kotlin-ffmpeg-video-compress/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_video_compress/CompressVideoBuilder.kt create mode 100644 kotlin-ffmpeg-video-compress/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_video_compress/Constants.kt create mode 100644 kotlin-ffmpeg-video-compress/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_video_compress/FFmpegHelper.kt create mode 100644 kotlin-ffmpeg-video-compress/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_video_compress/TimeUtils.kt create mode 100644 kotlin-ffmpeg-video-compress/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_video_compress/types/PresetType.kt create mode 100644 kotlin-ffmpeg-video-compress/src/main/java/com/cleveroad/bootstrap/kotlin_ffmpeg_video_compress/types/StrictType.kt create mode 100644 kotlin-ffmpeg-video-compress/src/main/res/values/strings.xml create mode 100644 kotlin-gps/.gitignore create mode 100644 kotlin-gps/README.md create mode 100644 kotlin-gps/build.gradle create mode 100644 kotlin-gps/proguard-rules.pro create mode 100644 kotlin-gps/src/main/AndroidManifest.xml create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/GpsProvider.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/GpsProviderImpl.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/GpsProviderTracker.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/GpsProviderTrackerImpl.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/GpsUiDelegate.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/GpsUiDelegateImpl.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/LocationProcessor.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/LocationProcessorImpl.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/LocationProvider.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/dialog/AllowPermissionDialog.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/dialog/GpsConfirmDialog.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/receiver/GpsProviderReceiver.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/service/GpsTrackerService.kt create mode 100644 kotlin-gps/src/main/kotlin/com/cleveroad/bootstrap/kotlin_gps/service/TrackerState.kt create mode 100644 kotlin-gps/src/main/res/values/strings.xml create mode 100644 kotlin-permissionrequest/.gitignore create mode 100644 kotlin-permissionrequest/README.md create mode 100644 kotlin-permissionrequest/build.gradle create mode 100644 kotlin-permissionrequest/proguard-rules.pro create mode 100644 kotlin-permissionrequest/src/main/AndroidManifest.xml create mode 100644 kotlin-permissionrequest/src/main/kotlin/com/cleveroad/bootstrap/kotlin_permissionrequest/BasePermissionRequest.kt create mode 100644 kotlin-permissionrequest/src/main/kotlin/com/cleveroad/bootstrap/kotlin_permissionrequest/PermissionActivityRequest.kt create mode 100644 kotlin-permissionrequest/src/main/kotlin/com/cleveroad/bootstrap/kotlin_permissionrequest/PermissionFragmentRequest.kt create mode 100644 kotlin-permissionrequest/src/main/kotlin/com/cleveroad/bootstrap/kotlin_permissionrequest/PermissionProviderResult.kt create mode 100644 kotlin-permissionrequest/src/main/kotlin/com/cleveroad/bootstrap/kotlin_permissionrequest/PermissionRequest.kt create mode 100644 kotlin-permissionrequest/src/main/kotlin/com/cleveroad/bootstrap/kotlin_permissionrequest/PermissionResult.kt create mode 100644 kotlin-permissionrequest/src/main/res/values/strings.xml create mode 100644 kotlin-phone-input/.gitignore create mode 100644 kotlin-phone-input/README.md create mode 100644 kotlin-phone-input/build.gradle create mode 100644 kotlin-phone-input/src/main/AndroidManifest.xml create mode 100644 kotlin-phone-input/src/main/assets/country_codes.json create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/Constants.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/assets/AssetsModule.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/assets/AssetsProvider.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/assets/converters/CountryAssetsConverter.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/choose_country/ChooseCountryFragment.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/choose_country/ChooseCountryViewModel.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/choose_country/CountriesAdapter.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/data/converter/BaseConverter.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/data/converter/Converter.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/data/models/CountryAsset.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/data/models/KParcelable.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/utils/BitmapUtils.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/utils/CountryFlag.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/utils/DetectCountryUtil.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/utils/EnumUtil.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/utils/PhoneFormatUtils.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/utils/PhoneMaskUtils.kt create mode 100644 kotlin-phone-input/src/main/kotlin/com/cleveroad/bootstrap/kotlin_phone_input/view/PhoneInputLayout.kt create mode 100644 kotlin-phone-input/src/main/res/drawable/background_gradient_view_under_toolbar.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/background_invalid.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/background_valid.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/divider_item.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_arrow_gray_back_24dp.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_check_green_highlight_24dp.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_abkhazia.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ad.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ae.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_af.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ag.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ai.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_al.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_am.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_an.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ao.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_aq.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ar.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_as.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_at.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_au.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_aw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ax.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_az.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_azores_islands.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ba.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bb.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bc.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bd.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_be.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bf.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bh.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bi.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bj.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bo.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bonaire.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bq.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_br.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bs.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bt.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bv.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_by.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_bz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ca.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_canary_islands.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cc.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cd.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ce.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cf.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ch.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ci.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ck.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cl.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cn_xz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_co.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_corsica.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cs.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cu.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cv.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cx.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cy.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_cz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_de.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_dj.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_dk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_dm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_do.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_dz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ec.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ee.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_eg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_eh.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_england.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_er.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_es.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_es_ib.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_es_ml.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_es_pv.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_et.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_eu.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_fi.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_fj.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_fk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_fm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_fo.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_fr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ga.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_galapagos_islands.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gb.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gd.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ge.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gf.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gh.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gi.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gl.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gp.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gq.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gs.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gt.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gu.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_gy.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_hk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_hn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_hr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ht.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_hu.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_id.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ie.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_il.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_im.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_in.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_io.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_iq.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ir.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_is.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_it.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_itg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_je.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_jm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_jo.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_jp.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ke.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_kg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_kh.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ki.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_km.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_kn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_kp.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_kr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_kw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ky.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_kz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_la.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_lb.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_lc.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_li.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_lk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_lr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ls.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_lt.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_lu.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_lv.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ly.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ma.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_madeira.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mc.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_md.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_me.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mh.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ml.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mo.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mp.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mq.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ms.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mt.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mu.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mv.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mx.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_my.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_mz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_na.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_nato.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_nc.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ne.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_nf.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ng.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ni.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_nl.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_no.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_np.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_nr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_nu.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_nz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_om.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ossetia.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pa.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pe.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pf.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ph.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pl.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ps.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pt.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pv.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_pw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_py.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_qa.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_rapa_nui.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_re.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ro.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_rs.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ru.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_rw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sa.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sahrawi_arab_democratic_republic.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sardinia.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sb.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sc.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sd.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_se.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sh.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_si.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sint_eustatius.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sl.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_so.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_somaliland.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ss.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_st.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_st_barts.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sv.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sx.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sy.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_sz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tc.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_td.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tf.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_th.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tj.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tl.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_to.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tr.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_transnistria.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tt.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tv.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_tz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ua.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ug.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_uk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_united_nations.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_us.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_us_hi.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_uy.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_uz.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_va.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_vc.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ve.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_vg.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_vi.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_vn.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_vu.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_wales.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_wf.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ws.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_xk.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_ye.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_yt.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_za.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_zm.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_list_zw.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/ic_search_gray_24dp.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/underline_active.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/underline_error.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/underline_error_inactive.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/underline_inactive.xml create mode 100644 kotlin-phone-input/src/main/res/drawable/underline_valid.xml create mode 100644 kotlin-phone-input/src/main/res/font/aclonica.xml create mode 100644 kotlin-phone-input/src/main/res/font/aref_ruqaa.xml create mode 100644 kotlin-phone-input/src/main/res/layout/choose_country_fragment.xml create mode 100644 kotlin-phone-input/src/main/res/layout/country_item.xml create mode 100644 kotlin-phone-input/src/main/res/layout/include_toolbar.xml create mode 100644 kotlin-phone-input/src/main/res/menu/menu_country_search.xml create mode 100644 kotlin-phone-input/src/main/res/values/attrs.xml create mode 100644 kotlin-phone-input/src/main/res/values/colors.xml create mode 100644 kotlin-phone-input/src/main/res/values/dimens.xml create mode 100644 kotlin-phone-input/src/main/res/values/flag_path.xml create mode 100644 kotlin-phone-input/src/main/res/values/font_certs.xml create mode 100644 kotlin-phone-input/src/main/res/values/preloaded_fonts.xml create mode 100644 kotlin-phone-input/src/main/res/values/strings.xml create mode 100644 kotlin-phone-input/src/main/res/values/styles.xml create mode 100644 kotlin-rx-bus/.gitignore create mode 100644 kotlin-rx-bus/README.md create mode 100644 kotlin-rx-bus/build.gradle create mode 100644 kotlin-rx-bus/proguard-rules.pro create mode 100644 kotlin-rx-bus/src/androidTest/java/com/cleveroad/bootstrap/kotlin_rx_bus/ExampleInstrumentedTest.java create mode 100644 kotlin-rx-bus/src/main/AndroidManifest.xml create mode 100644 kotlin-rx-bus/src/main/kotlin/com/cleveroad/bootstrap/kotlin_rx_bus/RxBus.kt create mode 100644 kotlin-rx-bus/src/main/res/values/strings.xml create mode 100644 kotlin-rx-bus/src/test/java/com/cleveroad/bootstrap/kotlin_rx_bus/ExampleUnitTest.java create mode 100644 kotlin-validators/.gitignore create mode 100644 kotlin-validators/README.md create mode 100644 kotlin-validators/build.gradle create mode 100644 kotlin-validators/proguard-rules.pro create mode 100644 kotlin-validators/src/androidTest/java/com/cleveroad/bootstrap/kotlin_validators/EmailValidationUnitTest.kt create mode 100644 kotlin-validators/src/androidTest/java/com/cleveroad/bootstrap/kotlin_validators/ExampleInstrumentedTest.java create mode 100644 kotlin-validators/src/main/AndroidManifest.xml create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/DateValidator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/DateValidatorImpl.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/EmailValidator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/Extensions.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/InviteCodeValidator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/MatchPasswordValidator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/MatchValidationResponse.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/MatchValidationResponseImpl.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/MatchValidator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/NameValidator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/PasswordValidator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/PhoneValidator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/PhoneValidatorImpl.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/ValidationResponse.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/ValidationResponseImpl.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/Validator.kt create mode 100644 kotlin-validators/src/main/kotlin/com/cleveroad/bootstrap/kotlin_validators/ValidatorsFactory.kt create mode 100644 kotlin-validators/src/main/res/values/integers.xml create mode 100644 kotlin-validators/src/main/res/values/strings.xml create mode 100644 kotlin-validators/src/main/res/values/strings_tests.xml create mode 100644 kotlin-validators/src/test/java/com/cleveroad/bootstrap/kotlin_validators/ExampleUnitTest.java create mode 100644 main_jcenter.settings.gradle create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aed8724 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +*.iml +.idea +.gradle +#jcenter.settings.gradle +/local.properties +.DS_Store +/build +/captures +.externalNativeBuild \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2f4d471 --- /dev/null +++ b/README.md @@ -0,0 +1,105 @@ +# Kotlin Bootstrap [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) + +## Meet Kotlin Bootstrap by Cleveroad + +This is tutorial about android bootstrap library. + +## Setup and usage +### Installation +by project gradle : +```groovy +ext { + + bootstrapVersion = "2.0.0" + + bootstrapDependencies = [ + auth : "com.cleveroad.bootstrap:kotlin-auth:$bootstrapVersion", + core : "com.cleveroad.bootstrap:kotlin-core:$bootstrapVersion", + ext : "com.cleveroad.bootstrap:kotlin-ext:$bootstrapVersion" + thumbnails : "com.cleveroad.bootstrap:kotlin-ffmpeg-thumbnails:$bootstrapVersion" + video_compress: "com.cleveroad.bootstrap:kotlin-ffmpeg-video-compress:$bootstrapVersion" + gps : "com.cleveroad.bootstrap:kotlin-gps:$bootstrapVersion" + permission : "com.cleveroad.bootstrap:kotlin-permissionrequest:$bootstrapVersion" + phone_input : "com.cleveroad.bootstrap:kotlin-phone-input:$bootstrapVersion" + validators : "com.cleveroad.bootstrap:kotlin-validators:$bootstrapVersion", + rxBus : "com.cleveroad.bootstrap:kotlin-rx-bus:$bootstrapVersion", + ] +} +``` + +by app gradle : +```groovy + +dependencies { + + // Bootstrap + implementation bootstrapDependencies.auth + implementation bootstrapDependencies.core + implementation bootstrapDependencies.ext + implementation bootstrapDependencies.thumbnails + implementation bootstrapDependencies.video_compress + implementation bootstrapDependencies.gps + implementation bootstrapDependencies.permission + implementation bootstrapDependencies.phone_input + implementation bootstrapDependencies.validators + implementation bootstrapDependencies.rxBus +} +``` + +### Usage ### + +- [Kotlin Auth] +- [Kotlin Core] +- [Kotlin Extension] +- [Kotlin FFMpeg Thumbnails] +- [Kotlin FFMpeg Video Compress] +- [Kotlin GPS] +- [Kotlin Permission Request] +- [Kotlin Phone Input] +- [Kotlin RxBus] +- [Kotlin Validators] + +### Support ### +If you have any questions, issues or propositions, please create a new issue in this repository. + +If you want to hire us, send an email to sales@cleveroad.com or fill the form on contact page + +Follow us: + +[![Awesome](/images/social/facebook.png)](https://www.facebook.com/cleveroadinc/) [![Awesome](/images/social/twitter.png)](https://twitter.com/cleveroadinc) [![Awesome](/images/social/google.png)](https://plus.google.com/+CleveroadInc) [![Awesome](/images/social/linkedin.png)](https://www.linkedin.com/company/cleveroad-inc-) [![Awesome](/images/social/youtube.png)](https://www.youtube.com/channel/UCFNHnq1sEtLiy0YCRHG2Vaw) +
+ +### License ### +* * * + The MIT License (MIT) + + Copyright (c) 2016 Cleveroad Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +[Kotlin Auth]: /kotlin-auth +[Kotlin Core]: /kotlin-core +[Kotlin Extension]: /kotlin-ext +[Kotlin FFMpeg Thumbnails]: /kotlin-ffmpeg-thumbnails +[Kotlin FFMpeg Video Compress]: /kotlin-ffmpeg-video-compress +[Kotlin GPS]: /kotlin-gps +[Kotlin Permission Request]: /kotlin-permissionrequest +[Kotlin Phone Input]: /kotlin-phone-input +[Kotlin RxBus]: /kotlin-rx-bus +[Kotlin Validators]: /kotlin-validators \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..ddcd60b --- /dev/null +++ b/app/.gitignore @@ -0,0 +1,8 @@ +*.iml +.idea +.gradle +/local.properties +.DS_Store +/build +/captures +.externalNativeBuild \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..c065048 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,82 @@ +apply plugin: 'com.android.application' + +apply plugin: 'kotlin-android' + +apply plugin: 'kotlin-android-extensions' + +android { + compileSdkVersion rootProject.ext.compileSdkVersion as Integer + buildToolsVersion rootProject.ext.buildToolsVersion as String + defaultConfig { + applicationId "com.cleveroad.bootstrap.kotlin" + minSdkVersion 21 + targetSdkVersion rootProject.ext.compileSdkVersion as Integer + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + all { + buildConfigField "String", "GOOGLE_CLIENT_ID", '"YOUR_CLIENT_ID"' + buildConfigField "String", "TWITTER_CONSUMER_KEY", '"YOUR_CONSUMER_KEY"' + buildConfigField "String", "TWITTER_REDIRECT_URL", '"_REDIRECT_URL"' + buildConfigField "String", "TWITTER_CONSUMER_SECRET", '"YOUR_CONSUMER_SECRET"' + buildConfigField "String", "LINKEDIN_CLIENT_ID", '"YOUR_CLIENT_ID"' + buildConfigField "String", "LINKEDIN_CLIENT_SECRET", '"YOUR_CLIENT_SECRET"' + buildConfigField "String", "LINKEDIN_REDIRECT_URL", '"https://www.cleveroad.com/"' + } + + debug { + minifyEnabled false + debuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + + release { + minifyEnabled false + debuggable false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + // tests + testImplementation testsDependencies.junit + testImplementation testsDependencies.runner + testImplementation(testsDependencies.espresso_core) { + exclude group: 'com.android.support', module: 'support-annotations' + } + + // Google Auth + implementation playServiceDependencies.play_services_auth + + // Facebook Auth + implementation facebookDependencies.login + + // common + implementation supportDependencies.appCompat + implementation supportDependencies.design + implementation kotlinDependencies.jdk + + // rx + implementation rxjava2Dependencies.rxjava + + // bootstrap + implementation project(':kotlin-phone-input') + implementation project(':kotlin-validators') + implementation project(':kotlin-core') + implementation project(':kotlin-ext') + implementation project(':kotlin-gps') + implementation project(':kotlin-ffmpeg-thumbnails') + implementation project(':kotlin-ffmpeg-video-compress') + implementation project(':kotlin-permissionrequest') + implementation project(':kotlin-auth') + +} + +repositories { + mavenCentral() +} diff --git a/app/credentials.json b/app/credentials.json new file mode 100644 index 0000000..fa2ca13 --- /dev/null +++ b/app/credentials.json @@ -0,0 +1,10 @@ +{ + "web": { + "client_id": "YOUR_CLIENT_ID", + "project_id": "PROJECT_ID", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_secret": "CLIENT_SECRET" + } +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..58213ad --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,29 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /home/horobets_stanislav_cr/Android/Sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +## libphonenumber +#-keep class com.google.i18n.phonenumbers.repackaged.** +#-dontwarn com.google.i18n.phonenumbers.repackaged.** \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..8f6b842 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/com/cleveroad/MainActivity.kt b/app/src/main/java/com/cleveroad/MainActivity.kt new file mode 100644 index 0000000..a12304e --- /dev/null +++ b/app/src/main/java/com/cleveroad/MainActivity.kt @@ -0,0 +1,35 @@ +package com.cleveroad + +import android.os.Bundle +import android.view.View +import androidx.appcompat.app.AppCompatActivity +import com.cleveroad.auth_example.SampleAuthActivity +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_ext.setClickListenerWithDebounce +import com.cleveroad.compress_image.CompressImageActivity +import com.cleveroad.ffmpeg_example.FFMpegActivity +import com.cleveroad.gps_example.GpsActivity +import com.cleveroad.phone_example.ChooseCountryActivity +import com.cleveroad.validator_example.ValidatorActivity +import kotlinx.android.synthetic.main.activity_main.* + +class MainActivity : AppCompatActivity(), View.OnClickListener { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + setClickListenerWithDebounce(bValidationExample, bGpsExample, + bFfmpegExample, bCompressImage, bPhoneViewExample, bAuthExample) + } + + override fun onClick(v: View) { + when (v.id) { + R.id.bValidationExample -> ValidatorActivity.start(this) + R.id.bGpsExample -> GpsActivity.start(this) + R.id.bFfmpegExample -> FFMpegActivity.start(this) + R.id.bCompressImage -> CompressImageActivity.start(this) + R.id.bPhoneViewExample -> ChooseCountryActivity.start(this) + R.id.bAuthExample -> SampleAuthActivity.start(this) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/auth_example/AuthFragment.kt b/app/src/main/java/com/cleveroad/auth_example/AuthFragment.kt new file mode 100644 index 0000000..75d0174 --- /dev/null +++ b/app/src/main/java/com/cleveroad/auth_example/AuthFragment.kt @@ -0,0 +1,116 @@ +package com.cleveroad.auth_example + +import android.content.Intent +import android.os.Bundle +import android.view.View +import com.cleveroad.bootstrap.kotlin.BuildConfig +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_auth.base.AuthProxy +import com.cleveroad.bootstrap.kotlin_auth.base.AuthType +import com.cleveroad.bootstrap.kotlin_auth.base.AuthType.* +import com.cleveroad.bootstrap.kotlin_auth.facebook.FacebookAuthCallback +import com.cleveroad.bootstrap.kotlin_auth.facebook.FacebookPermission +import com.cleveroad.bootstrap.kotlin_auth.google.GoogleAuthCallback +import com.cleveroad.bootstrap.kotlin_auth.linkedin.LITE_PROFILE +import com.cleveroad.bootstrap.kotlin_auth.linkedin.LinkedInAuthCallback +import com.cleveroad.bootstrap.kotlin_auth.twitter.TwitterAuthCallback +import com.cleveroad.bootstrap.kotlin_core.ui.NO_TITLE +import com.cleveroad.bootstrap.kotlin_core.ui.NO_TOOLBAR +import com.cleveroad.bootstrap.kotlin_ext.setClickListeners +import com.cleveroad.phone_example.BaseFragment +import com.google.android.gms.common.Scopes +import kotlinx.android.synthetic.main.fragment_auth.* + +class AuthFragment : BaseFragment(), + View.OnClickListener, + GoogleAuthCallback, + FacebookAuthCallback, + TwitterAuthCallback, + LinkedInAuthCallback { + + companion object { + fun newInstance() = AuthFragment() + } + + override val viewModelClass = AuthVM::class.java + + override val layoutId = R.layout.fragment_auth + + private val authProxy = AuthProxy() + + override fun observeLiveData() = Unit + + override fun getScreenTitle() = NO_TITLE + + override fun hasToolbar() = false + + override fun getToolbarId() = NO_TOOLBAR + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + authProxy.run { + registerGoogleAuthHelper(BuildConfig.GOOGLE_CLIENT_ID, + requireContext(), + listOf(Scopes.PROFILE), + this@AuthFragment) + + registerFacebookAuthHelper(listOf(FacebookPermission.PUBLIC_PROFILE), + this@AuthFragment) + + registerTwitterAuthHelper(BuildConfig.TWITTER_CONSUMER_KEY, + BuildConfig.TWITTER_CONSUMER_SECRET, + BuildConfig.TWITTER_REDIRECT_URL, + this@AuthFragment) + + registerLinkedInAuthHelper(BuildConfig.LINKEDIN_CLIENT_ID, + BuildConfig.LINKEDIN_CLIENT_SECRET, + listOf(LITE_PROFILE), + BuildConfig.LINKEDIN_REDIRECT_URL, + this@AuthFragment) + } + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + setClickListeners(bGoogle, bFacebook, bTwitter, bLinkedIn) + } + + override fun onResume() { + super.onResume() + authProxy.connect() + } + + override fun onPause() { + authProxy.disconnect() + super.onPause() + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + authProxy.onActivityResult(requestCode, resultCode, data) + } + + override fun onClick(v: View?) = authProxy.run { + when (v?.id) { + R.id.bGoogle -> auth(GOOGLE_PLUS_AUTH) + R.id.bFacebook -> auth(FACEBOOK_AUTH) + R.id.bTwitter -> auth(TWITTER_AUTH) + R.id.bLinkedIn -> auth(LINKEDIN_AUTH) + else -> Unit + } + } + + override fun onSuccess(authType: AuthType, token: String) { + showSnackBar("Auth successful: $token") + } + + override fun onFail(authType: AuthType, throwable: Throwable?) { + showSnackBar("Auth fail: ${throwable?.message}") + } + + override fun onCancel() { + showSnackBar("Auth Cancelled") + } + + override fun getActivityForResult() = activity +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/auth_example/AuthVM.kt b/app/src/main/java/com/cleveroad/auth_example/AuthVM.kt new file mode 100644 index 0000000..1f39f3a --- /dev/null +++ b/app/src/main/java/com/cleveroad/auth_example/AuthVM.kt @@ -0,0 +1,6 @@ +package com.cleveroad.auth_example + +import android.app.Application +import com.cleveroad.bootstrap.kotlin_core.ui.BaseLifecycleViewModel + +class AuthVM(application: Application) : BaseLifecycleViewModel(application) \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/auth_example/SampleAuthActivity.kt b/app/src/main/java/com/cleveroad/auth_example/SampleAuthActivity.kt new file mode 100644 index 0000000..dc8de3d --- /dev/null +++ b/app/src/main/java/com/cleveroad/auth_example/SampleAuthActivity.kt @@ -0,0 +1,37 @@ +package com.cleveroad.auth_example + +import android.content.Context +import android.content.Intent +import android.os.Bundle +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_core.ui.BaseLifecycleActivity +import com.cleveroad.bootstrap.kotlin_core.ui.BlockedCallback +import com.google.android.material.snackbar.Snackbar + +class SampleAuthActivity : BaseLifecycleActivity(), + BlockedCallback { + + companion object { + fun start(context: Context) = + context.startActivity(Intent(context, SampleAuthActivity::class.java)) + } + + override val viewModelClass = SampleAuthVM::class.java + + override val containerId = R.id.flContainer + + override val layoutId = R.layout.activity_auth + + override fun getProgressBarId() = R.id.progressBar + + override fun getSnackBarDuration() = Snackbar.LENGTH_SHORT + + override fun observeLiveData() = Unit + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + replaceFragment(AuthFragment.newInstance()) + } + + override fun onBlocked() = Unit +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/auth_example/SampleAuthVM.kt b/app/src/main/java/com/cleveroad/auth_example/SampleAuthVM.kt new file mode 100644 index 0000000..e2361ab --- /dev/null +++ b/app/src/main/java/com/cleveroad/auth_example/SampleAuthVM.kt @@ -0,0 +1,6 @@ +package com.cleveroad.auth_example + +import android.app.Application +import com.cleveroad.bootstrap.kotlin_core.ui.BaseLifecycleViewModel + +class SampleAuthVM(application: Application) : BaseLifecycleViewModel(application) \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/compress_image/CompressImageActivity.kt b/app/src/main/java/com/cleveroad/compress_image/CompressImageActivity.kt new file mode 100644 index 0000000..761423e --- /dev/null +++ b/app/src/main/java/com/cleveroad/compress_image/CompressImageActivity.kt @@ -0,0 +1,57 @@ +package com.cleveroad.compress_image + +import android.Manifest +import android.app.Activity +import android.content.Context +import android.content.Intent +import android.net.Uri +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_core.utils.IntentUtils.Companion.createImagePickFromGallery +import com.cleveroad.bootstrap.kotlin_core.utils.storage.FileUtils +import com.cleveroad.bootstrap.kotlin_core.utils.storage.ImageUtils +import com.cleveroad.bootstrap.kotlin_permissionrequest.PermissionRequest +import com.cleveroad.bootstrap.kotlin_permissionrequest.PermissionResult +import kotlinx.android.synthetic.main.activity_compress_image.* + + +class CompressImageActivity : AppCompatActivity() { + + companion object { + private const val PICK_IMAGE_REQUEST_CODE = 10002 + private const val REQUEST_WRITE_EXTERNAL_STORAGE = 4 + fun start(context: Context) = context.startActivity(Intent(context, CompressImageActivity::class.java)) + } + + private val permissionRequest = PermissionRequest() + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_compress_image) + bPickImage.setOnClickListener { + permissionRequest.request(this, REQUEST_WRITE_EXTERNAL_STORAGE, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), + object : PermissionResult { + override fun onPermissionGranted() { + startActivityForResult(createImagePickFromGallery(this@CompressImageActivity), PICK_IMAGE_REQUEST_CODE) + } + }) + } + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + if (resultCode == Activity.RESULT_OK && requestCode == PICK_IMAGE_REQUEST_CODE) { + FileUtils.copyFileAndGetRealPath(this, data?.data)?.let { filePath -> + ImageUtils.compressImage(Uri.parse(filePath))?.let { + ivTestImage.setImageBitmap(it) + } + } + } + } + + override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) + permissionRequest.onRequestPermissionsResult(requestCode, permissions, grantResults) + } +} diff --git a/app/src/main/java/com/cleveroad/ffmpeg_example/FFMpegActivity.kt b/app/src/main/java/com/cleveroad/ffmpeg_example/FFMpegActivity.kt new file mode 100644 index 0000000..8edebd9 --- /dev/null +++ b/app/src/main/java/com/cleveroad/ffmpeg_example/FFMpegActivity.kt @@ -0,0 +1,175 @@ +package com.cleveroad.ffmpeg_example + +import android.Manifest +import android.app.Activity +import android.content.Context +import android.content.Intent +import android.os.Bundle +import android.util.Log +import android.view.View +import androidx.appcompat.app.AppCompatActivity +import androidx.recyclerview.widget.LinearLayoutManager +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_core.utils.storage.FileUtils +import com.cleveroad.bootstrap.kotlin_ext.setClickListeners +import com.cleveroad.bootstrap.kotlin_ffmpeg_thumbnails.ThumbnailsFFMpegBuilder +import com.cleveroad.bootstrap.kotlin_ffmpeg_thumbnails.model.Result +import com.cleveroad.bootstrap.kotlin_ffmpeg_video_compress.CompressVideoBuilder +import com.cleveroad.bootstrap.kotlin_permissionrequest.PermissionRequest +import com.cleveroad.bootstrap.kotlin_permissionrequest.PermissionResult +import kotlinx.android.synthetic.main.activity_ffmpeg_thumbnails.* +import kotlinx.android.synthetic.main.include_progress.* +import java.io.File + +class FFMpegActivity : AppCompatActivity(), View.OnClickListener { + + companion object { + private const val TAG = "FFMpegActivity" + private const val PICK_VIDEO = "video/*" + private const val PICK_IMAGE = "image/*" + + private const val THUMBNAILS_COUNT = 100 + private const val REQUEST_PICK_VIDEO = 10004 + private const val REQUEST_PICK_OVERLAY = 10006 + private const val REQUEST_WRITE_EXTERNAL_STORAGE = 4 + private const val DEFAULT_OUTPUT_VIDEO_EXTENSION = ".mp4" + + fun start(context: Context) = context.startActivity(Intent(context, FFMpegActivity::class.java)) + } + + private val permissionRequest = PermissionRequest() + private val photosAdapter by lazy { PhotosAdapter(applicationContext) } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_ffmpeg_thumbnails) + initPhotosRV() + setClickListeners(bPickFile, bPickOverlayFile, bCreateThumbnails, bCompressVideo) + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + if (resultCode == Activity.RESULT_OK) { + data?.data?.let { + when (requestCode) { + REQUEST_PICK_VIDEO -> tvPickedFile.text = FileUtils.getRealPath(this, it) + REQUEST_PICK_OVERLAY -> tvPickedOverlayFile.text = FileUtils.getRealPath(this, it) + } + } + } + } + + override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) + permissionRequest.onRequestPermissionsResult(requestCode, permissions, grantResults) + } + + override fun onClick(view: View) { + when (view.id) { + R.id.bPickFile -> { + requestWriteStoragePermission { + startActivityForResult(intentForPickVideo(), REQUEST_PICK_VIDEO) + } + } + R.id.bPickOverlayFile -> { + requestWriteStoragePermission { + startActivityForResult(intentForPickImage(), REQUEST_PICK_OVERLAY) + } + } + R.id.bCreateThumbnails -> { + requestWriteStoragePermission { + setProgressVisibility(true) + ThumbnailsFFMpegBuilder.with(this) + .setInput(tvPickedFile.text.toString()) + .setOutput(etFileName.text.toString()) + .setThumbnailsCount(THUMBNAILS_COUNT) + .execute({ result -> onResultThumbnails(result) }, + { error -> onError(error) }, + { progress -> onProgress(progress) }) + } + } + R.id.bCompressVideo -> { + requestWriteStoragePermission { + setProgressVisibility(true) + CompressVideoBuilder.with(this) + .setInput(tvPickedFile.text.toString()) + .setOutputPath(createTempVideoFile("temp").absolutePath) + .setApproximateVideoSizeMb(10) + .execute({ result -> onResultCompressVideo(result) }, + { error -> onError(error) }, + { progress -> onProgress(progress) }) + } + } + } + } + + private fun onResultThumbnails(result: Result) { + photosAdapter.apply { + clear() + addAll(result.thumbnails) + notifyDataSetChanged() + } + setProgressVisibility(false) + } + + private fun onResultCompressVideo(pathname: String) { + val inputSize = File(tvPickedFile.text.toString()).length() + val outputSize = File(pathname).length() + setProgressVisibility(false) + tvPickedOverlayFile.text = "Picked file size - $inputSize\n" + + "Output file size - $outputSize\n" + + "Reduce difference - ${inputSize / outputSize}" + } + + private fun onError(error: Throwable) { + setProgressVisibility(false) + error.message?.let { Log.e(TAG, it) } + } + + private fun onProgress(progress: Long) { + tvProgress.text = progress.toString() + } + + private fun intentForPickVideo() = Intent().apply { + type = PICK_VIDEO + action = Intent.ACTION_PICK + } + + private fun intentForPickImage() = Intent().apply { + type = PICK_IMAGE + action = Intent.ACTION_PICK + } + + private fun requestWriteStoragePermission(onGranted: () -> Unit) { + permissionRequest.request(this, REQUEST_WRITE_EXTERNAL_STORAGE, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), + object : PermissionResult { + override fun onPermissionGranted() { + onGranted.invoke() + } + }) + } + + private fun setProgressVisibility(isVisible: Boolean) { + progressView.visibility = if (isVisible) View.VISIBLE else View.INVISIBLE + } + + private fun initPhotosRV() { + with(rvPhotos) { + invalidate() + layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) + adapter = photosAdapter + } + } + + //For testing + private fun createTempVideoFile(name: String, extension: String = DEFAULT_OUTPUT_VIDEO_EXTENSION): File { + val filePath = "$name$extension" + var dest = File(cacheDir, filePath) + var fileNo = 0 + while (dest.exists()) { + fileNo++ + dest = File(cacheDir, fileNo.toString() + filePath) + } + return dest + } +} diff --git a/app/src/main/java/com/cleveroad/ffmpeg_example/PhotosAdapter.kt b/app/src/main/java/com/cleveroad/ffmpeg_example/PhotosAdapter.kt new file mode 100644 index 0000000..d57667a --- /dev/null +++ b/app/src/main/java/com/cleveroad/ffmpeg_example/PhotosAdapter.kt @@ -0,0 +1,33 @@ +package com.cleveroad.ffmpeg_example + +import android.content.Context +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import androidx.recyclerview.widget.RecyclerView +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_core.ui.adapter.BaseRecyclerViewAdapter +import com.cleveroad.bootstrap.kotlin_ffmpeg_thumbnails.model.Thumbnail + +class PhotosAdapter(context: Context, data: List = listOf()) : + BaseRecyclerViewAdapter(context, data) { + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = PhotosViewHolder.newInstance(inflater, parent, R.layout.item_photo) + + override fun onBindViewHolder(holder: PhotosViewHolder, position: Int) = holder.bind(getItem(position)) + + class PhotosViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + + companion object { + fun newInstance(inflater: LayoutInflater, parent: ViewGroup?, layout: Int) = + PhotosViewHolder(inflater.inflate(layout, parent, false)) + } + + private var ivPhoto = itemView.findViewById(R.id.ivPhoto) + + fun bind(thumbnail: Thumbnail) { + ivPhoto.setImageBitmap(thumbnail.bitmap) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/gps_example/GpsActivity.kt b/app/src/main/java/com/cleveroad/gps_example/GpsActivity.kt new file mode 100644 index 0000000..fd7fb5c --- /dev/null +++ b/app/src/main/java/com/cleveroad/gps_example/GpsActivity.kt @@ -0,0 +1,88 @@ +package com.cleveroad.gps_example + +import android.content.Context +import android.content.Intent +import android.location.Location +import android.os.Bundle +import android.widget.Toast +import androidx.appcompat.app.AppCompatActivity +import androidx.lifecycle.Observer +import com.cleveroad.bootstrap.kotlin.BuildConfig +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_gps.GpsProviderImpl +import com.cleveroad.bootstrap.kotlin_gps.GpsUiDelegate +import com.cleveroad.bootstrap.kotlin_gps.GpsUiDelegateImpl +import com.cleveroad.bootstrap.kotlin_gps.LocationProvider +import kotlinx.android.synthetic.main.activity_gps.* + +class GpsActivity : AppCompatActivity(), GpsUiDelegate.GpsUiCallback { + + companion object { + fun start(context: Context) = context.run { + startActivity(Intent(this, GpsActivity::class.java)) + } + } + + private val notification by lazy { + NotificationUtils(this).createNotification() + } + + private val gpsProvider by lazy { + GpsProviderImpl.Builder(BuildConfig.APPLICATION_ID, this, notification).apply { + dialogCallback = object : GpsProviderImpl.DialogCallback { + override fun showDialogGps(): Boolean { + Toast.makeText(this@GpsActivity, "Gps", Toast.LENGTH_LONG).show() + return false + } + + override fun showDialogPermission(): Boolean { + Toast.makeText(this@GpsActivity, "permission", Toast.LENGTH_LONG).show() + return false + } + } + }.build() + } + + private val gpsUiDelegate by lazy { + GpsUiDelegateImpl(this, gpsProvider) + } + + private val locationObserver = Observer { location -> + location?.run { tvText.text = "$latitude $longitude" } + } + + private val locationIsTracking = Observer { isTracking -> + isTracking?.let { tvIsTracking.text = it.toString() } + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_gps) + LocationProvider.run { + locationLiveData.observe(this@GpsActivity, locationObserver) + isTrackingLD.observe(this@GpsActivity, locationIsTracking) + } + } + + override fun getActivity(): AppCompatActivity = this + + override fun onPause() { + super.onPause() + gpsUiDelegate.onPause() + } + + override fun onResumeFragments() { + super.onResumeFragments() + gpsUiDelegate.onResumeFragments() + } + + override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) + gpsUiDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults) + } + + override fun onDestroy() { + gpsUiDelegate.onDestroy() + super.onDestroy() + } +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/gps_example/NotificationUtils.kt b/app/src/main/java/com/cleveroad/gps_example/NotificationUtils.kt new file mode 100644 index 0000000..de580c5 --- /dev/null +++ b/app/src/main/java/com/cleveroad/gps_example/NotificationUtils.kt @@ -0,0 +1,60 @@ +package com.cleveroad.gps_example + +import android.app.Notification +import android.app.Notification.VISIBILITY_PRIVATE +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.NotificationManager.IMPORTANCE_HIGH +import android.app.NotificationManager.IMPORTANCE_NONE +import android.app.PendingIntent.getActivity +import android.content.Context +import android.content.Context.NOTIFICATION_SERVICE +import android.content.Intent +import android.os.Build +import android.os.Build.VERSION.SDK_INT +import android.os.Build.VERSION_CODES.O +import androidx.annotation.RequiresApi +import androidx.core.app.NotificationCompat +import com.cleveroad.bootstrap.kotlin.R + +class NotificationUtils(val context: Context) { + + companion object { + private const val EMPTY_STRING = "" + } + + @RequiresApi(Build.VERSION_CODES.O) + private fun createNotificationChannel(): String { + val channelId = "${context.getString(R.string.app_name)} location" + NotificationChannel(channelId, + channelId, IMPORTANCE_HIGH).apply { + importance = IMPORTANCE_NONE + lockscreenVisibility = VISIBILITY_PRIVATE + (context.getSystemService(NOTIFICATION_SERVICE) as NotificationManager) + .createNotificationChannel(this) + } + return channelId + } + + /** + * Example create notification for foreground service + */ + @SuppressWarnings("unused") + fun createNotification(): Notification { + var channelId = EMPTY_STRING + if (SDK_INT >= O) channelId = createNotificationChannel() + return NotificationCompat.Builder(context, channelId).run { + setOngoing(true) + setSmallIcon(R.mipmap.ic_launcher) + priority = NotificationCompat.PRIORITY_MIN + setContentText(context.getString(R.string.track_location_notification)) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + setCategory(Notification.CATEGORY_SERVICE) + } + setContentIntent(getActivity(context, 0, + Intent(context, GpsActivity::class.java), 0)) + build() + } + } +} + diff --git a/app/src/main/java/com/cleveroad/phone_example/BaseFragment.kt b/app/src/main/java/com/cleveroad/phone_example/BaseFragment.kt new file mode 100644 index 0000000..f8daa61 --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/BaseFragment.kt @@ -0,0 +1,26 @@ +package com.cleveroad.phone_example + +import android.content.Context +import android.view.View +import com.cleveroad.bootstrap.kotlin.BuildConfig +import com.cleveroad.bootstrap.kotlin_core.ui.BaseLifecycleFragment +import com.cleveroad.bootstrap.kotlin_core.ui.BaseLifecycleViewModel + + +abstract class BaseFragment : BaseLifecycleFragment() { + + override var endpoint = "" + + override var versionName = "" + + override fun getVersionsLayoutId() = View.NO_ID + + override fun getEndPointTextViewId() = View.NO_ID + + override fun getVersionsTextViewId() = View.NO_ID + + override fun isDebug() = BuildConfig.DEBUG + + override fun showBlockBackAlert() = Unit + +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/phone_example/BaseTextWatcher.kt b/app/src/main/java/com/cleveroad/phone_example/BaseTextWatcher.kt new file mode 100644 index 0000000..d266d2a --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/BaseTextWatcher.kt @@ -0,0 +1,26 @@ +package com.cleveroad.phone_example + +import android.text.Editable +import android.text.TextWatcher + +/** + * Base class for implement [TextWatcher] + */ +open class BaseTextWatcher(private val actionAfterTextChanged: (text: String) -> Unit = {}, + private val actionBeforeTextChanged: (s: CharSequence?, start: Int, count: Int, after: Int) -> Unit = + { _: CharSequence?, _: Int, _: Int, _: Int -> }, + private val actionOnTextChanged: (s: CharSequence?, start: Int, before: Int, count: Int) -> Unit = + { _: CharSequence?, _: Int, _: Int, _: Int -> }) : TextWatcher { + + override fun afterTextChanged(s: Editable?) { + actionAfterTextChanged(s.toString()) + } + + override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { + actionBeforeTextChanged(s, start, count, after) + } + + override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { + actionOnTextChanged(s, start, before, count) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/phone_example/ChooseCountryActivity.kt b/app/src/main/java/com/cleveroad/phone_example/ChooseCountryActivity.kt new file mode 100644 index 0000000..93509f9 --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/ChooseCountryActivity.kt @@ -0,0 +1,43 @@ +package com.cleveroad.phone_example + +import android.content.Context +import android.content.Intent +import android.os.Bundle +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_core.ui.BaseLifecycleActivity +import com.cleveroad.bootstrap.kotlin_core.ui.BlockedCallback +import com.cleveroad.bootstrap.kotlin_core.ui.NO_ID +import com.cleveroad.bootstrap.kotlin_phone_input.choose_country.ChooseCountryFragment + +class ChooseCountryActivity : BaseLifecycleActivity(), PhoneViewCallback, BlockedCallback { + + companion object { + fun start(context: Context) = context.startActivity(Intent(context, ChooseCountryActivity::class.java)) + } + + override val containerId = R.id.flContainer + + override val layoutId = R.layout.activity_choose_country + + override val viewModelClass = ChooseCountryVM::class.java + + override fun onBlocked() = Unit + + override fun getProgressBarId() = NO_ID + + override fun getSnackBarDuration() = 1000 + + override fun observeLiveData() = Unit + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + replaceFragment(PhoneViewFragment.newInstance(), false) + } + + override fun showChooseCountry() { + supportFragmentManager.fragments.firstOrNull()?.let { + replaceFragment(ChooseCountryFragment.newInstance(it, RequestCode.REQUEST_CHOOSE_COUNTRY())) + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/phone_example/ChooseCountryVM.kt b/app/src/main/java/com/cleveroad/phone_example/ChooseCountryVM.kt new file mode 100644 index 0000000..47b4e21 --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/ChooseCountryVM.kt @@ -0,0 +1,6 @@ +package com.cleveroad.phone_example + +import android.app.Application +import com.cleveroad.bootstrap.kotlin_core.ui.BaseLifecycleViewModel + +class ChooseCountryVM(application: Application) : BaseLifecycleViewModel(application) \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/phone_example/PhoneViewCallback.kt b/app/src/main/java/com/cleveroad/phone_example/PhoneViewCallback.kt new file mode 100644 index 0000000..ac3a258 --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/PhoneViewCallback.kt @@ -0,0 +1,7 @@ +package com.cleveroad.phone_example + +interface PhoneViewCallback { + + fun showChooseCountry() + +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/phone_example/PhoneViewFragment.kt b/app/src/main/java/com/cleveroad/phone_example/PhoneViewFragment.kt new file mode 100644 index 0000000..196a560 --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/PhoneViewFragment.kt @@ -0,0 +1,101 @@ +package com.cleveroad.phone_example + +import android.app.Activity +import android.content.Context +import android.content.Intent +import android.os.Bundle +import android.view.View +import androidx.lifecycle.Observer +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_core.ui.NO_TOOLBAR +import com.cleveroad.bootstrap.kotlin_core.utils.misc.bindInterfaceOrThrow +import com.cleveroad.bootstrap.kotlin_ext.clickWithDebounce +import com.cleveroad.bootstrap.kotlin_phone_input.choose_country.ChooseCountryFragment +import com.cleveroad.bootstrap.kotlin_phone_input.data.models.CountryAsset +import kotlinx.android.synthetic.main.fragment_phone_view.* + +class PhoneViewFragment : BaseFragment() { + + companion object { + fun newInstance() = PhoneViewFragment().apply { + arguments = Bundle() + } + } + + private var flagViewVisibility: Boolean = true + + private var phoneViewCallback: PhoneViewCallback? = null + + override val viewModelClass = PhoneViewVM::class.java + + override fun hasToolbar() = false + override fun hasVersions() = true + override fun getToolbarId() = NO_TOOLBAR + + override fun observeLiveData() { + with(viewModel) { + countryLD.observe(this@PhoneViewFragment, Observer { countryAsset -> + countryAsset?.let { pvCodePicker?.setData(it) } + }) + validationLD.observe(this@PhoneViewFragment, Observer { response -> + response?.let { + tilPhone.error = it.errorMessage.takeIf { _ -> !it.isValid } + } + }) + } + } + + override fun getScreenTitle() = R.string.country + + override val layoutId = R.layout.fragment_phone_view + + override fun onAttach(context: Context) { + super.onAttach(context) + phoneViewCallback = bindInterfaceOrThrow(context) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + initTestButtons() + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + data?.takeIf { resultCode == Activity.RESULT_OK && requestCode == RequestCode.REQUEST_CHOOSE_COUNTRY() }?.let { + it.getParcelableExtra(ChooseCountryFragment.CHOOSE_COUNTRY_EXTRA)?.let { countryAsset -> + viewModel.countryLD.value = countryAsset + } + } + } + + override fun onDetach() { + phoneViewCallback = null + super.onDetach() + } + + private fun initTestButtons() { + tilPhone.editText?.addTextWatcher(BaseTextWatcher(actionOnTextChanged = { _, _, _, _ -> + tilPhone.error = null + })) + + tilCode.editText?.clickWithDebounce { + phoneViewCallback?.showChooseCountry() + } + + with(pvCodePicker) { + btFlagVisible.setOnClickListener { + flagViewVisibility = !flagViewVisibility + flagImageVisibility(flagViewVisibility) + } + btValidation.setOnClickListener { + val (code, phone) = getPhone() + viewModel.validatePhoneNumber(phone, code) + } + btIcon24.setOnClickListener { setIconSize(60) } + btIcon36.setOnClickListener { setIconSize(80) } + btIcon48.setOnClickListener { setIconSize(100) } + btIcon60.setOnClickListener { setIconSize(120) } + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/phone_example/PhoneViewVM.kt b/app/src/main/java/com/cleveroad/phone_example/PhoneViewVM.kt new file mode 100644 index 0000000..90971c4 --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/PhoneViewVM.kt @@ -0,0 +1,22 @@ +package com.cleveroad.phone_example + +import android.app.Application +import androidx.lifecycle.MutableLiveData +import com.cleveroad.bootstrap.kotlin_core.ui.BaseLifecycleViewModel +import com.cleveroad.bootstrap.kotlin_phone_input.data.models.CountryAsset +import com.cleveroad.bootstrap.kotlin_validators.ValidationResponse + +class PhoneViewVM(application: Application) : BaseLifecycleViewModel(application) { + + private val phoneValidator = getPhoneValidator(application) + + val countryLD = MutableLiveData() + val validationLD = MutableLiveData() + + fun validatePhoneNumber(phoneNumber: String, countryRegion: String): Boolean = + phoneValidator.validate(phoneNumber, countryRegion).run { + validationLD.value = this + isValid + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/phone_example/RequestCodes.kt b/app/src/main/java/com/cleveroad/phone_example/RequestCodes.kt new file mode 100644 index 0000000..f59bb17 --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/RequestCodes.kt @@ -0,0 +1,7 @@ +package com.cleveroad.phone_example + +enum class RequestCode { + REQUEST_CHOOSE_COUNTRY; + + operator fun invoke() = ordinal +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/phone_example/ValidatorFactory.kt b/app/src/main/java/com/cleveroad/phone_example/ValidatorFactory.kt new file mode 100644 index 0000000..1de28cb --- /dev/null +++ b/app/src/main/java/com/cleveroad/phone_example/ValidatorFactory.kt @@ -0,0 +1,13 @@ +package com.cleveroad.phone_example + +import android.content.Context +import com.cleveroad.bootstrap.kotlin_validators.PhoneValidatorImpl +import com.cleveroad.bootstrap.kotlin_validators.R + +fun getPhoneValidator(context: Context) = with(context) { + PhoneValidatorImpl + .builder(this) + .emptyErrorMessage(getString(R.string.phone_is_invalid)) + .invalidErrorMessage(getString(R.string.phone_is_invalid)) + .build() +} diff --git a/app/src/main/java/com/cleveroad/validator_example/EditText.kt b/app/src/main/java/com/cleveroad/validator_example/EditText.kt new file mode 100644 index 0000000..47afc8a --- /dev/null +++ b/app/src/main/java/com/cleveroad/validator_example/EditText.kt @@ -0,0 +1,17 @@ +package com.cleveroad.validator_example + +import android.widget.TextView + + +fun TextView.addSimpleTextChangedListener(listener: (text: String) -> Unit) = + object : SimpleTextWatcher(this) { + override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { + listener(s.toString()) + } + } + +fun TextView.getStringText() = this.text.toString() + +fun TextView.addFocusChangedListener(listener: (isHasFocus: Boolean) -> Unit) = this.setOnFocusChangeListener { _, hasFocus -> + listener(hasFocus) +} diff --git a/app/src/main/java/com/cleveroad/validator_example/SimpleTextWatcher.kt b/app/src/main/java/com/cleveroad/validator_example/SimpleTextWatcher.kt new file mode 100644 index 0000000..4795f58 --- /dev/null +++ b/app/src/main/java/com/cleveroad/validator_example/SimpleTextWatcher.kt @@ -0,0 +1,18 @@ +package com.cleveroad.validator_example + +import android.text.Editable +import android.text.TextWatcher +import android.widget.TextView + + +open class SimpleTextWatcher(textView: TextView) : TextWatcher { + init { + textView.addTextChangedListener(this) + } + + override fun afterTextChanged(s: Editable?) = Unit + + override fun beforeTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) = Unit + + override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) = Unit +} \ No newline at end of file diff --git a/app/src/main/java/com/cleveroad/validator_example/ValidatorActivity.kt b/app/src/main/java/com/cleveroad/validator_example/ValidatorActivity.kt new file mode 100644 index 0000000..405db5b --- /dev/null +++ b/app/src/main/java/com/cleveroad/validator_example/ValidatorActivity.kt @@ -0,0 +1,99 @@ +package com.cleveroad.validator_example + +import android.content.Context +import android.content.Intent +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import com.cleveroad.bootstrap.kotlin.R +import com.cleveroad.bootstrap.kotlin_validators.* +import com.google.android.material.snackbar.Snackbar +import com.google.android.material.textfield.TextInputLayout +import kotlinx.android.synthetic.main.activity_validator.* + + +class ValidatorActivity : AppCompatActivity() { + + private var nameValidator: Validator? = null + private var emailValidator: Validator? = null + private var phoneValidator: PhoneValidator? = null + private var passwordValidator: Validator? = null + private var matchPasswordValidator: MatchPasswordValidator? = null + private var nameWatcher: SimpleTextWatcher? = null + private var emailWatcher: SimpleTextWatcher? = null + private var countryRegion = "" + + companion object { + private const val EMPTY_MESSAGE = "" + + fun start(context: Context) = context.startActivity(Intent(context, ValidatorActivity::class.java)) + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_validator) + initValidators() + + nameWatcher = etName.addSimpleTextChangedListener { text -> + nameValidator?.validate(text)?.let { showTextInputLayoutError(tilName, it) } + } + + emailWatcher = etEmail.addSimpleTextChangedListener { _ -> hideError(tilEmail) } + + etEmail.addFocusChangedListener { hasFocus -> + if (!hasFocus) { + emailValidator?.validate(etEmail.getStringText()) + ?.let { showTextInputLayoutError(tilEmail, it) } + } + } + + bValidateName.setOnClickListener { + nameValidator?.validate(etName.getStringText())?.let { showValidateResponse(it) } + } + bValidateEmail.setOnClickListener { + emailValidator?.validate(etEmail.getStringText())?.let { showValidateResponse(it) } + } + bValidatePhone.setOnClickListener { + phoneValidator?.validate(etPhone.getStringText(), countryRegion) + ?.let { showValidateResponse(it) } + } + bValidatePassword.setOnClickListener { + passwordValidator?.validate(etPassword.getStringText())?.let { showValidateResponse(it) } + } + bValidateMatchPassword.setOnClickListener { + matchPasswordValidator?.validate(etFirstPassword.getStringText(), etSecondPassword.getStringText()) + ?.let { showValidateResponse(it) } + } + } + + private fun showTextInputLayoutError(til: TextInputLayout, validate: ValidationResponse) { + til.error = if (validate.isValid) EMPTY_MESSAGE else validate.errorMessage + ?: getString(R.string.error) + } + + private fun hideError(til: TextInputLayout) { + til.error = EMPTY_MESSAGE + } + + override fun onStop() { + etName.removeTextChangedListener(nameWatcher) + etEmail.removeTextChangedListener(emailWatcher) + etEmail.onFocusChangeListener = null + super.onStop() + } + + private fun initValidators() { + nameValidator = ValidatorsFactory.getNameValidator(this) + emailValidator = ValidatorsFactory.getEmailValidator(this) + phoneValidator = ValidatorsFactory.getPhoneValidator(this) + passwordValidator = ValidatorsFactory.getPasswordValidator(this) + matchPasswordValidator = ValidatorsFactory.getMatchPasswordValidator(this) + } + + private fun showValidateResponse(validate: ValidationResponse) { + if (validate.isValid) showMessage() else showMessage(validate.errorMessage + ?: getString(R.string.error)) + } + + private fun showMessage(message: String = getString(R.string.correct)) = + Snackbar.make(findViewById(android.R.id.content), message, Snackbar.LENGTH_SHORT).show() +} diff --git a/app/src/main/res/drawable/background_social_button.xml b/app/src/main/res/drawable/background_social_button.xml new file mode 100644 index 0000000..1eaa89b --- /dev/null +++ b/app/src/main/res/drawable/background_social_button.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_auth.xml b/app/src/main/res/layout/activity_auth.xml new file mode 100644 index 0000000..bfd16ae --- /dev/null +++ b/app/src/main/res/layout/activity_auth.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_choose_country.xml b/app/src/main/res/layout/activity_choose_country.xml new file mode 100644 index 0000000..1db1653 --- /dev/null +++ b/app/src/main/res/layout/activity_choose_country.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_compress_image.xml b/app/src/main/res/layout/activity_compress_image.xml new file mode 100644 index 0000000..478ca10 --- /dev/null +++ b/app/src/main/res/layout/activity_compress_image.xml @@ -0,0 +1,18 @@ + + + +