├── .gitignore ├── .idea ├── gradle.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── .travis.yml ├── License.txt ├── README.md ├── _config.yml ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── ExampleInstrumentedTest.kt │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ ├── MainActivity.kt │ │ ├── ProductFragment.kt │ │ ├── ProductListFragment.kt │ │ ├── db │ │ ├── AppDatabase.kt │ │ ├── DatabaseCreator.kt │ │ ├── DatabaseInitUtil.kt │ │ ├── converter │ │ │ └── DateConverter.kt │ │ ├── dao │ │ │ ├── CommentDao.kt │ │ │ └── ProductDao.kt │ │ └── entity │ │ │ ├── CommentEntity.kt │ │ │ └── ProductEntity.kt │ │ ├── model │ │ ├── Comment.kt │ │ └── Product.kt │ │ ├── ui │ │ ├── BindingAdapters.kt │ │ ├── CommentAdapter.kt │ │ ├── CommentClickCallback.kt │ │ ├── ProductAdapter.kt │ │ └── ProductClickCallback.kt │ │ └── viewmodel │ │ ├── ProductListViewModel.kt │ │ └── ProductViewModel.kt │ └── res │ ├── drawable-v21 │ ├── ic_menu_camera.xml │ ├── ic_menu_gallery.xml │ ├── ic_menu_manage.xml │ ├── ic_menu_send.xml │ ├── ic_menu_share.xml │ └── ic_menu_slideshow.xml │ ├── drawable │ ├── ic_add_24dp.xml │ └── ic_add_circle_outline_24dp.xml │ ├── layout │ ├── comment_item.xml │ ├── list_fragment.xml │ ├── main_activity.xml │ ├── product_fragment.xml │ └── product_item.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── values-v21 │ └── styles.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── product_app.xml │ ├── strings.xml │ └── styles.xml ├── audioplayer ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── audioplayer │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── talentica │ │ │ └── androidkotlin │ │ │ └── audioplayer │ │ │ ├── MainActivity.kt │ │ │ └── utils │ │ │ ├── LogHelper.kt │ │ │ └── SeekBarHandler.kt │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap │ │ └── music.png │ │ ├── raw │ │ └── simplerock.mp3 │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── talentica │ └── androidkotlin │ └── audioplayer │ └── ExampleUnitTest.java ├── build.gradle ├── customcamera ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── customcamera │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── talentica │ │ │ └── androidkotlin │ │ │ └── customcamera │ │ │ ├── BaseApplication.java │ │ │ ├── adapter │ │ │ └── landing │ │ │ │ └── LandingGalleryAdapter.kt │ │ │ ├── callbacks │ │ │ └── PhotoClickedCallback.kt │ │ │ ├── dagger │ │ │ ├── AndroidModule.java │ │ │ ├── ApplicationComponent.java │ │ │ ├── Components.java │ │ │ ├── HasComponent.kt │ │ │ ├── camera │ │ │ │ ├── CameraActivityComponent.java │ │ │ │ ├── CameraActivityComponentAssembler.java │ │ │ │ ├── CameraActivityScope.java │ │ │ │ └── CameraModule.java │ │ │ └── landing │ │ │ │ ├── LandingActivityComponent.java │ │ │ │ ├── LandingActivityComponentAssembler.java │ │ │ │ ├── LandingActivityScope.java │ │ │ │ └── LandingModule.java │ │ │ ├── model │ │ │ └── camera │ │ │ │ ├── CameraActivityModel.kt │ │ │ │ └── CameraAdapter.kt │ │ │ ├── presenter │ │ │ ├── ActivityPresenter.kt │ │ │ ├── camera │ │ │ │ ├── CameraActivityPresenter.kt │ │ │ │ └── CameraActivityPresenterImpl.kt │ │ │ └── landing │ │ │ │ ├── LandingActivityPresenter.kt │ │ │ │ └── LandingActivityPresenterImpl.kt │ │ │ ├── ui │ │ │ ├── SlowkaActivity.kt │ │ │ ├── camera │ │ │ │ ├── CameraActivity.kt │ │ │ │ ├── CameraActivityView.kt │ │ │ │ └── CameraView.kt │ │ │ └── landing │ │ │ │ ├── LandingActivity.kt │ │ │ │ └── LandingActivityView.kt │ │ │ └── utils │ │ │ ├── Ratio.kt │ │ │ ├── SquareLinearLayout.java │ │ │ └── Utils.kt │ └── res │ │ ├── drawable-v21 │ │ ├── ic_menu_camera.xml │ │ ├── ic_menu_gallery.xml │ │ ├── ic_menu_manage.xml │ │ ├── ic_menu_send.xml │ │ ├── ic_menu_share.xml │ │ └── ic_menu_slideshow.xml │ │ ├── drawable │ │ ├── ic_camera.png │ │ ├── ic_flash.png │ │ └── side_nav_bar.xml │ │ ├── layout │ │ ├── activity_landing.xml │ │ ├── activity_words_camera_view.xml │ │ ├── app_bar_landing.xml │ │ ├── application_toolbar.xml │ │ ├── content_landing.xml │ │ ├── item_grid.xml │ │ └── nav_header_landing.xml │ │ ├── menu │ │ ├── activity_landing_drawer.xml │ │ ├── activity_words_list_drawer.xml │ │ └── words_list.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── drawables.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── provider_paths.xml │ └── test │ └── java │ └── com │ └── talentica │ └── androidkotlin │ └── customcamera │ └── ExampleUnitTest.java ├── gifs ├── audioplayer.gif ├── compass.gif ├── customcamera.gif ├── database.gif ├── googleio2017.gif ├── location.gif ├── navbar.gif ├── networking_with_kotlin_003.gif ├── o_notification_003.gif └── videostreaming.gif ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── locationmanager ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── locationmanager │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── talentica │ │ │ └── androidkotlin │ │ │ └── locationmanager │ │ │ └── MainActivity.kt │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── talentica │ └── androidkotlin │ └── locationmanager │ └── ExampleUnitTest.java ├── networking ├── .gitignore ├── README.md ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── networking │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── repos.json │ ├── ic_fork-web.png │ ├── ic_forked-web.png │ ├── ic_mine-web.png │ ├── ic_stars-web.png │ ├── java │ │ └── com │ │ │ └── talentica │ │ │ └── androidkotlin │ │ │ └── networking │ │ │ ├── MainActivity.kt │ │ │ ├── dto │ │ │ └── DataClasses.kt │ │ │ ├── network │ │ │ ├── OkHttpService.kt │ │ │ ├── RetrofitService.kt │ │ │ └── VolleyService.kt │ │ │ └── repoui │ │ │ ├── RepoAdapter.kt │ │ │ ├── RepoPresenter.kt │ │ │ ├── RepositoryContract.kt │ │ │ ├── UserRepositories.kt │ │ │ └── test.java │ └── res │ │ ├── drawable-hdpi │ │ └── ic_repo_stars.png │ │ ├── drawable-mdpi │ │ └── ic_repo_stars.png │ │ ├── drawable-xhdpi │ │ └── ic_repo_stars.png │ │ ├── drawable-xxhdpi │ │ └── ic_repo_stars.png │ │ ├── drawable │ │ ├── circ_bg.xml │ │ ├── circ_bg_green.xml │ │ ├── circ_bg_other.xml │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_user_repositories.xml │ │ └── repo_item.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_fork.xml │ │ ├── ic_fork_round.xml │ │ ├── ic_forked.xml │ │ ├── ic_forked_round.xml │ │ ├── ic_launcher.xml │ │ ├── ic_launcher_round.xml │ │ ├── ic_mine.xml │ │ ├── ic_mine_round.xml │ │ ├── ic_stars.xml │ │ └── ic_stars_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_fork.png │ │ ├── ic_fork_background.png │ │ ├── ic_fork_foreground.png │ │ ├── ic_fork_round.png │ │ ├── ic_forked.png │ │ ├── ic_forked_background.png │ │ ├── ic_forked_foreground.png │ │ ├── ic_forked_round.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ ├── ic_launcher_round.png │ │ ├── ic_mine.png │ │ ├── ic_mine_background.png │ │ ├── ic_mine_foreground.png │ │ ├── ic_mine_round.png │ │ ├── ic_stars.png │ │ ├── ic_stars_background.png │ │ ├── ic_stars_foreground.png │ │ └── ic_stars_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_fork.png │ │ ├── ic_fork_background.png │ │ ├── ic_fork_foreground.png │ │ ├── ic_fork_round.png │ │ ├── ic_forked.png │ │ ├── ic_forked_background.png │ │ ├── ic_forked_foreground.png │ │ ├── ic_forked_round.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ ├── ic_launcher_round.png │ │ ├── ic_mine.png │ │ ├── ic_mine_background.png │ │ ├── ic_mine_foreground.png │ │ ├── ic_mine_round.png │ │ ├── ic_stars.png │ │ ├── ic_stars_background.png │ │ ├── ic_stars_foreground.png │ │ └── ic_stars_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_fork.png │ │ ├── ic_fork_background.png │ │ ├── ic_fork_foreground.png │ │ ├── ic_fork_round.png │ │ ├── ic_forked.png │ │ ├── ic_forked_background.png │ │ ├── ic_forked_foreground.png │ │ ├── ic_forked_round.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ ├── ic_launcher_round.png │ │ ├── ic_mine.png │ │ ├── ic_mine_background.png │ │ ├── ic_mine_foreground.png │ │ ├── ic_mine_round.png │ │ ├── ic_stars.png │ │ ├── ic_stars_background.png │ │ ├── ic_stars_foreground.png │ │ └── ic_stars_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_fork.png │ │ ├── ic_fork_background.png │ │ ├── ic_fork_foreground.png │ │ ├── ic_fork_round.png │ │ ├── ic_forked.png │ │ ├── ic_forked_background.png │ │ ├── ic_forked_foreground.png │ │ ├── ic_forked_round.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ ├── ic_launcher_round.png │ │ ├── ic_mine.png │ │ ├── ic_mine_background.png │ │ ├── ic_mine_foreground.png │ │ ├── ic_mine_round.png │ │ ├── ic_stars.png │ │ ├── ic_stars_background.png │ │ ├── ic_stars_foreground.png │ │ └── ic_stars_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_fork.png │ │ ├── ic_fork_background.png │ │ ├── ic_fork_foreground.png │ │ ├── ic_fork_round.png │ │ ├── ic_forked.png │ │ ├── ic_forked_background.png │ │ ├── ic_forked_foreground.png │ │ ├── ic_forked_round.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ ├── ic_launcher_round.png │ │ ├── ic_mine.png │ │ ├── ic_mine_background.png │ │ ├── ic_mine_foreground.png │ │ ├── ic_mine_round.png │ │ ├── ic_stars.png │ │ ├── ic_stars_background.png │ │ ├── ic_stars_foreground.png │ │ └── ic_stars_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── talentica │ └── androidkotlin │ └── networking │ └── ExampleUnitTest.kt ├── o_notifications ├── .gitignore ├── README.md ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── onotifications │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── talentica │ │ │ └── androidkotlin │ │ │ └── onotifications │ │ │ ├── BasePresenter.kt │ │ │ ├── BaseView.kt │ │ │ ├── notifications │ │ │ ├── MainActivity.kt │ │ │ ├── NotificationContract.kt │ │ │ └── NotificationPresenter.kt │ │ │ └── utils │ │ │ └── NotificationHelper.kt │ └── res │ │ ├── drawable │ │ ├── ic_color_lens_black_24dp.xml │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── talentica │ └── androidkotlin │ └── onotifications │ └── ExampleUnitTest.java ├── sensors ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── sensors │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── talentica │ │ │ └── androidkotlin │ │ │ └── sensors │ │ │ ├── Compass.kt │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable │ │ ├── dial.png │ │ └── hands.png │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── talentica │ └── androidkotlin │ └── sensors │ └── ExampleUnitTest.kt ├── settings.gradle ├── sqlitedatabase ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── sqlitedatabase │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── talentica │ │ │ └── androidkotlin │ │ │ └── sqlitedatabase │ │ │ ├── MainApplication.kt │ │ │ ├── adapter │ │ │ └── LogCursorAdapter.kt │ │ │ ├── helpers │ │ │ └── DbHelper.kt │ │ │ ├── model │ │ │ └── User.kt │ │ │ ├── server │ │ │ ├── MockUserService.kt │ │ │ └── UserService.kt │ │ │ └── ui │ │ │ └── SearchActivity.kt │ └── res │ │ ├── layout │ │ ├── activity_search.xml │ │ └── item_log.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── talentica │ └── androidkotlin │ └── sqlitedatabase │ └── ExampleUnitTest.java └── videostreaming ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src ├── androidTest └── java │ └── com │ └── talentica │ └── androidkotlin │ └── videostreaming │ └── ExampleInstrumentedTest.java ├── main ├── AndroidManifest.xml ├── java │ └── com │ │ └── talentica │ │ └── androidkotlin │ │ └── videostreaming │ │ └── MainActivity.kt └── res │ ├── layout │ └── activity_main.xml │ ├── menu │ └── menu_main.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap │ ├── pause_button.png │ ├── play_button.png │ └── stop_button.png │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── test └── java └── com └── talentica └── androidkotlin └── videostreaming └── ExampleUnitTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | /.idea/ 11 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | env: 4 | global: 5 | - ANDROID_TARGET=android-25 6 | - ANDROID_ABI=armeabi-v7a 7 | android: 8 | components: 9 | - tools 10 | - platform-tools 11 | - build-tools-26.0.0 12 | - tools 13 | - 'android-26' 14 | - extra-android-support 15 | - extra-google-google_play_services 16 | - extra-android-m2repository 17 | - extra-google-m2repository 18 | - sys-img-${ANDROID_ABI}-${ANDROID_TARGET} 19 | licenses: 20 | - 'android-sdk-preview-license-.+' 21 | - 'android-sdk-license-.+' 22 | - '.+' 23 | install: [ 24 | "echo yes | ${ANDROID_HOME}tools/bin/sdkmanager \"platforms;android-26\" --channel=3"] 25 | script: 26 | - ./gradlew build 27 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/suyashg/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/talentica/androidkotlin/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin 2 | 3 | import androidx.test.ext.junit.runners.AndroidJUnit4 4 | import androidx.test.platform.app.InstrumentationRegistry 5 | import org.junit.Assert.assertEquals 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | /** 10 | * Instrumentation test, which will execute on an Android device. 11 | * 12 | * @see [Testing documentation](http://d.android.com/tools/testing) 13 | */ 14 | @RunWith(AndroidJUnit4::class) 15 | class ExampleInstrumentedTest { 16 | @Test 17 | @Throws(Exception::class) 18 | fun useAppContext() { 19 | // Context of the app under test. 20 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 21 | assertEquals("com.talentica.androidkotlin", appContext.packageName) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/db/converter/DateConverter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.db.converter 17 | 18 | import androidx.room.TypeConverter 19 | import java.util.* 20 | 21 | object DateConverter { 22 | @kotlin.jvm.JvmStatic 23 | @TypeConverter 24 | fun toDate(timestamp: Long?): Date? { 25 | return if (timestamp == null) null else Date(timestamp) 26 | } 27 | 28 | @kotlin.jvm.JvmStatic 29 | @TypeConverter 30 | fun toTimestamp(date: Date?): Long? { 31 | return date?.time 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/db/dao/CommentDao.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.db.dao 17 | 18 | import androidx.lifecycle.LiveData 19 | import androidx.room.Dao 20 | import androidx.room.Insert 21 | import androidx.room.OnConflictStrategy 22 | import androidx.room.Query 23 | import com.talentica.androidkotlin.db.entity.CommentEntity 24 | 25 | @Dao 26 | interface CommentDao { 27 | @Query("SELECT * FROM comments where productId = :productId") 28 | fun loadComments(productId: Int): LiveData?>? 29 | 30 | @Query("SELECT * FROM comments where productId = :productId") 31 | fun loadCommentsSync(productId: Int): List? 32 | 33 | @Insert(onConflict = OnConflictStrategy.REPLACE) 34 | fun insertAll(products: List?) 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/db/dao/ProductDao.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.db.dao 17 | 18 | import androidx.lifecycle.LiveData 19 | import androidx.room.Dao 20 | import androidx.room.Insert 21 | import androidx.room.OnConflictStrategy 22 | import androidx.room.Query 23 | import com.talentica.androidkotlin.db.entity.ProductEntity 24 | 25 | @Dao 26 | interface ProductDao { 27 | @Query("SELECT * FROM products") 28 | fun loadAllProducts(): LiveData?>? 29 | 30 | @Insert(onConflict = OnConflictStrategy.REPLACE) 31 | fun insertAll(products: List?) 32 | 33 | @Query("select * from products where id = :productId") 34 | fun loadProduct(productId: Int): LiveData? 35 | 36 | @Query("select * from products where id = :productId") 37 | fun loadProductSync(productId: Int): ProductEntity? 38 | } -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/db/entity/ProductEntity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.db.entity 17 | 18 | import androidx.room.Entity 19 | import androidx.room.PrimaryKey 20 | import com.talentica.androidkotlin.model.Product 21 | 22 | @Entity(tableName = "products") 23 | class ProductEntity : Product { 24 | @PrimaryKey 25 | override var id = 0 26 | override var name: String? = null 27 | override var description: String? = null 28 | override var price = 0 29 | 30 | constructor() {} 31 | constructor(product: Product) { 32 | id = product.id 33 | name = product.name 34 | description = product.description 35 | price = product.price 36 | } 37 | } -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/model/Comment.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.model 17 | 18 | import java.util.* 19 | 20 | interface Comment { 21 | val id: Int 22 | val productId: Int 23 | val text: String? 24 | val postedAt: Date? 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/model/Product.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.model 17 | 18 | interface Product { 19 | val id: Int 20 | val name: String? 21 | val description: String? 22 | val price: Int 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/ui/BindingAdapters.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.ui 17 | 18 | import android.view.View 19 | import androidx.databinding.BindingAdapter 20 | 21 | object BindingAdapters { 22 | @kotlin.jvm.JvmStatic 23 | @BindingAdapter("visibleGone") 24 | fun showHide(view: View, show: Boolean) { 25 | view.visibility = if (show) View.VISIBLE else View.GONE 26 | } 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/ui/CommentClickCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.ui 17 | 18 | import com.talentica.androidkotlin.model.Comment 19 | 20 | interface CommentClickCallback { 21 | fun onClick(comment: Comment?) 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/talentica/androidkotlin/ui/ProductClickCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.talentica.androidkotlin.ui 17 | 18 | import com.talentica.androidkotlin.model.Product 19 | 20 | interface ProductClickCallback { 21 | fun onClick(product: Product) 22 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_manage.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_send.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_slideshow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_circle_outline_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | #3F51B5 20 | #303F9F 21 | #FF4081 22 | 23 | #d6d6d6 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 16dp 20 | 8dp 21 | 16dp 22 | 16dp 23 | 8dp 24 | 64dp 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/product_app.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Price: $%d 20 | 100dp 21 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | Persistence sample 19 | No comments 20 | Loading comments... 21 | Loading products... 22 | Products list 23 | Comments list 24 | Name of the product 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /audioplayer/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /audioplayer/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | 5 | android { 6 | compileSdkVersion 30 7 | 8 | 9 | defaultConfig { 10 | applicationId "com.talentica.androidkotlin.audioplayer" 11 | minSdkVersion 21 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 17 | 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | lintOptions { 26 | abortOnError false 27 | } 28 | compileOptions { 29 | sourceCompatibility JavaVersion.VERSION_1_8 30 | targetCompatibility JavaVersion.VERSION_1_8 31 | } 32 | kotlinOptions { 33 | jvmTarget = '1.8' 34 | } 35 | } 36 | 37 | dependencies { 38 | implementation fileTree(dir: 'libs', include: ['*.jar']) 39 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { 40 | exclude group: 'com.android.support', module: 'support-annotations' 41 | }) 42 | 43 | implementation 'androidx.appcompat:appcompat:1.3.0' 44 | testImplementation 'junit:junit:4.13.2' 45 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 46 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 47 | } 48 | repositories { 49 | mavenCentral() 50 | } 51 | -------------------------------------------------------------------------------- /audioplayer/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/suyashg/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /audioplayer/src/androidTest/java/com/talentica/androidkotlin/audioplayer/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.audioplayer; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.runner.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | /** 14 | * Instrumentation test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() throws Exception { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.talentica.androidkotlin.audioplayer", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /audioplayer/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/mipmap/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/mipmap/music.png -------------------------------------------------------------------------------- /audioplayer/src/main/res/raw/simplerock.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/audioplayer/src/main/res/raw/simplerock.mp3 -------------------------------------------------------------------------------- /audioplayer/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /audioplayer/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 60dp 3 | 12dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /audioplayer/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | audioplayer 3 | 4 | -------------------------------------------------------------------------------- /audioplayer/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /audioplayer/src/test/java/com/talentica/androidkotlin/audioplayer/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.audioplayer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.5.0' 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:4.2.2' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } 22 | jcenter() 23 | mavenCentral() 24 | } 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /customcamera/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /customcamera/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/suyashg/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /customcamera/src/androidTest/java/com/talentica/androidkotlin/customcamera/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.runner.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | /** 14 | * Instrumentation test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() throws Exception { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.talentica.androidkotlin.customcamera", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/callbacks/PhotoClickedCallback.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.callbacks 2 | 3 | /** 4 | * Created by suyashg on 03/06/17. 5 | */ 6 | interface PhotoClickedCallback { 7 | fun photoClickSuccess() 8 | fun photoClickFilure() 9 | } -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/AndroidModule.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import javax.inject.Singleton; 6 | import dagger.Module; 7 | import dagger.Provides; 8 | 9 | import com.talentica.androidkotlin.customcamera.BaseApplication; 10 | 11 | @Module 12 | public class AndroidModule { 13 | 14 | @Provides 15 | @Singleton 16 | Application provideApplication() { 17 | return BaseApplication.getInstance(); 18 | } 19 | 20 | @Provides 21 | @Singleton 22 | Context provideContext() { 23 | return provideApplication(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/ApplicationComponent.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger; 2 | 3 | import android.content.Context; 4 | import javax.inject.Singleton; 5 | import dagger.Component; 6 | 7 | @Singleton 8 | @Component( 9 | modules = { 10 | AndroidModule.class, 11 | } 12 | ) 13 | public interface ApplicationComponent { 14 | Context providesContext(); 15 | } 16 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/Components.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger; 2 | 3 | import android.app.Activity; 4 | import android.app.Application; 5 | import androidx.annotation.NonNull; 6 | 7 | import com.talentica.androidkotlin.customcamera.BaseApplication; 8 | 9 | public class Components { 10 | 11 | private Components() { 12 | throw new AssertionError("No instances."); 13 | } 14 | 15 | public static T from(@NonNull Activity activity) { 16 | return ((HasComponent) activity).getComponent(); 17 | } 18 | 19 | public static ApplicationComponent from(@NonNull Application application) { 20 | return ((BaseApplication) application).getComponent(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/HasComponent.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger 2 | 3 | interface HasComponent { 4 | val component: T 5 | } 6 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/camera/CameraActivityComponent.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger.camera; 2 | 3 | import dagger.Component; 4 | import com.talentica.androidkotlin.customcamera.dagger.ApplicationComponent; 5 | import com.talentica.androidkotlin.customcamera.ui.camera.CameraActivity; 6 | 7 | @CameraActivityScope 8 | @Component ( 9 | dependencies = ApplicationComponent.class, 10 | modules = CameraModule.class 11 | ) 12 | public interface CameraActivityComponent { 13 | void inject(CameraActivity activity); 14 | } 15 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/camera/CameraActivityComponentAssembler.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger.camera; 2 | 3 | import android.app.Application; 4 | 5 | import com.talentica.androidkotlin.customcamera.dagger.Components; 6 | 7 | public class CameraActivityComponentAssembler { 8 | 9 | private CameraActivityComponentAssembler() { 10 | throw new AssertionError("No instances."); 11 | } 12 | 13 | public static CameraActivityComponent assemble(Application application) { 14 | return DaggerCameraActivityComponent.builder() 15 | .applicationComponent(Components.from(application)) 16 | .cameraModule(new CameraModule()) 17 | .build(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/camera/CameraActivityScope.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger.camera; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Scope; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Scope 10 | public @interface CameraActivityScope { 11 | } 12 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/camera/CameraModule.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger.camera; 2 | 3 | import dagger.Module; 4 | import dagger.Provides; 5 | import com.talentica.androidkotlin.customcamera.model.camera.CameraActivityModel; 6 | import com.talentica.androidkotlin.customcamera.model.camera.CameraAdapter; 7 | import com.talentica.androidkotlin.customcamera.presenter.camera.CameraActivityPresenter; 8 | import com.talentica.androidkotlin.customcamera.presenter.camera.CameraActivityPresenterImpl; 9 | 10 | @Module 11 | public class CameraModule { 12 | 13 | @CameraActivityScope 14 | @Provides 15 | CameraActivityPresenter provideCameraActivityPresenter(CameraActivityModel cameraActivityModel) { 16 | return new CameraActivityPresenterImpl( 17 | cameraActivityModel 18 | ); 19 | } 20 | 21 | @CameraActivityScope 22 | @Provides 23 | CameraActivityModel provideCameraActivityModel(CameraAdapter cameraAdapter) { 24 | return new CameraActivityModel( 25 | cameraAdapter 26 | ); 27 | } 28 | 29 | @CameraActivityScope 30 | @Provides 31 | CameraAdapter provideCameraAdapter() { 32 | return new CameraAdapter(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/landing/LandingActivityComponent.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger.landing; 2 | 3 | import dagger.Component; 4 | import com.talentica.androidkotlin.customcamera.dagger.ApplicationComponent; 5 | import com.talentica.androidkotlin.customcamera.ui.landing.LandingActivity; 6 | 7 | @LandingActivityScope 8 | @Component ( 9 | dependencies = ApplicationComponent.class, 10 | modules = LandingModule.class 11 | ) 12 | public interface LandingActivityComponent { 13 | void inject(LandingActivity activity); 14 | } 15 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/landing/LandingActivityComponentAssembler.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger.landing; 2 | 3 | import android.app.Application; 4 | import com.talentica.androidkotlin.customcamera.dagger.Components; 5 | 6 | public class LandingActivityComponentAssembler { 7 | 8 | private LandingActivityComponentAssembler() { 9 | throw new AssertionError("No instances."); 10 | } 11 | 12 | public static LandingActivityComponent assemble(Application application) { 13 | return DaggerLandingActivityComponent.builder() 14 | .applicationComponent(Components.from(application)) 15 | .build(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/landing/LandingActivityScope.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger.landing; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Scope; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Scope 10 | public @interface LandingActivityScope { 11 | } 12 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/dagger/landing/LandingModule.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.dagger.landing; 2 | 3 | import dagger.Module; 4 | import dagger.Provides; 5 | import com.talentica.androidkotlin.customcamera.presenter.landing.LandingActivityPresenter; 6 | import com.talentica.androidkotlin.customcamera.presenter.landing.LandingActivityPresenterImpl; 7 | 8 | @Module 9 | public class LandingModule { 10 | 11 | @LandingActivityScope 12 | @Provides 13 | LandingActivityPresenter provideLandingActivityPresenter() { 14 | 15 | return new LandingActivityPresenterImpl(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/presenter/ActivityPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.presenter 2 | 3 | import android.app.Activity 4 | import android.os.Bundle 5 | 6 | interface ActivityPresenter { 7 | 8 | fun attach(activityView: T, 9 | activity: Activity, 10 | savedInstanceState: Bundle?) 11 | fun resume() 12 | fun pause() 13 | } 14 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/presenter/camera/CameraActivityPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.presenter.camera 2 | 3 | import android.hardware.Camera 4 | import android.view.SurfaceHolder 5 | import com.talentica.androidkotlin.customcamera.presenter.ActivityPresenter 6 | import com.talentica.androidkotlin.customcamera.ui.camera.CameraActivityView 7 | 8 | interface CameraActivityPresenter : ActivityPresenter { 9 | 10 | fun cameraSurfaceReady(holder: SurfaceHolder) 11 | fun cameraSurfaceRefresh() 12 | fun onRequestPermissionsResult(requestCode: Int, grantResults: IntArray) 13 | fun switchOnFlash() 14 | fun switchOffFlash() 15 | fun clickPhoto() 16 | } 17 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/presenter/landing/LandingActivityPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.presenter.landing 2 | 3 | import com.google.android.material.navigation.NavigationView 4 | import android.widget.GridView 5 | import com.talentica.androidkotlin.customcamera.presenter.ActivityPresenter 6 | import com.talentica.androidkotlin.customcamera.ui.landing.LandingActivityView 7 | 8 | interface LandingActivityPresenter : ActivityPresenter, NavigationView.OnNavigationItemSelectedListener { 9 | 10 | fun addListOfPicsToAdapter(gridView: GridView) 11 | fun onRequestPermissionsResult(requestCode: Int, grantResults: IntArray) 12 | fun lauchPhotoPreview(position:Int) 13 | } -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/ui/camera/CameraActivityView.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.ui.camera 2 | 3 | import com.talentica.androidkotlin.customcamera.utils.Ratio 4 | 5 | interface CameraActivityView { 6 | 7 | fun setupCameraPreviewRatio(ratio: Ratio) 8 | 9 | fun setupSurfaceForCameraAndUnblock() 10 | 11 | } -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/ui/camera/CameraView.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.ui.camera 2 | 3 | import android.content.Context 4 | import android.view.SurfaceHolder 5 | import android.view.SurfaceView 6 | import com.talentica.androidkotlin.customcamera.presenter.camera.CameraActivityPresenter 7 | 8 | class CameraView : SurfaceView, SurfaceHolder.Callback { 9 | 10 | val cameraActivityPresenter: CameraActivityPresenter 11 | 12 | override fun surfaceCreated(holder: SurfaceHolder) { 13 | cameraActivityPresenter.cameraSurfaceReady(holder) 14 | } 15 | 16 | override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) { 17 | cameraActivityPresenter.cameraSurfaceRefresh() 18 | } 19 | 20 | override fun surfaceDestroyed(holder: SurfaceHolder) { 21 | holder.removeCallback(this) 22 | } 23 | 24 | constructor(context: Context, presenter: CameraActivityPresenter) : super(context) { 25 | this.cameraActivityPresenter = presenter 26 | holder.addCallback(this) 27 | holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/ui/landing/LandingActivityView.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.ui.landing 2 | 3 | import com.talentica.androidkotlin.customcamera.adapter.landing.LandingGalleryAdapter 4 | 5 | interface LandingActivityView { 6 | open fun closeDrawer() 7 | fun setAdapter(adapter:LandingGalleryAdapter) 8 | } -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/utils/Ratio.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.utils 2 | 3 | import android.hardware.Camera 4 | 5 | enum class Ratio(private val ratio: Float) { 6 | FOUR_TO_THREE(4f / 3f); 7 | 8 | fun getWidthInPortrait(width: Int, height: Int): Int { 9 | if (ratio * width <= height) { 10 | return width.toInt() 11 | } else { 12 | return (1f / ratio * width).toInt() 13 | } 14 | } 15 | 16 | fun getHeightInPortrait(width: Int): Int { 17 | return (ratio * width).toInt() 18 | } 19 | 20 | fun extractFourByThreeSize(sizes: List) : Camera.Size { 21 | val betterSizes = sizes.filter { size -> 22 | val sizeRatio = (size.width).toFloat() / (size.height).toFloat() 23 | Math.abs(sizeRatio - ratio) < 0.001 24 | }.sortedBy { size -> size.width } 25 | if (betterSizes.isEmpty()) 26 | throw AssertionError("could not pick 3/4 camera") 27 | 28 | return betterSizes.find { it.width > 2000 } ?: betterSizes.last() 29 | } 30 | } -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/utils/SquareLinearLayout.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.utils; 2 | 3 | import android.content.Context; 4 | import androidx.annotation.Nullable; 5 | import android.util.AttributeSet; 6 | import android.widget.LinearLayout; 7 | 8 | /** 9 | * Created by suyashg on 03/06/17. 10 | */ 11 | 12 | public class SquareLinearLayout extends LinearLayout { 13 | 14 | public SquareLinearLayout(Context context) { 15 | super(context); 16 | } 17 | 18 | public SquareLinearLayout(Context context, @Nullable AttributeSet attrs) { 19 | super(context, attrs); 20 | } 21 | 22 | public SquareLinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 23 | super(context, attrs, defStyleAttr); 24 | } 25 | 26 | @Override 27 | public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 28 | super.onMeasure(widthMeasureSpec, widthMeasureSpec); // This is the key that will make the height equivalent to its width 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /customcamera/src/main/java/com/talentica/androidkotlin/customcamera/utils/Utils.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.customcamera.utils 2 | 3 | import android.os.Environment 4 | import android.util.Log 5 | import java.io.File 6 | 7 | /** 8 | * Created by suyashg on 03/06/17. 9 | */ 10 | class Utils { 11 | val storageDir = File(Environment 12 | .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "CustomCamera") 13 | 14 | fun checkAndMakeDir():File? { 15 | val mediaStorageDir = storageDir 16 | if (!mediaStorageDir.exists()) { 17 | if (!mediaStorageDir.mkdirs()) { 18 | Log.d("CustomCameraApp", "failed to create directory") 19 | return null 20 | } 21 | } 22 | return mediaStorageDir 23 | } 24 | } -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable-v21/ic_menu_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable-v21/ic_menu_gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable-v21/ic_menu_manage.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable-v21/ic_menu_send.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable-v21/ic_menu_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable-v21/ic_menu_slideshow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable/ic_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/drawable/ic_camera.png -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable/ic_flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/drawable/ic_flash.png -------------------------------------------------------------------------------- /customcamera/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /customcamera/src/main/res/layout/activity_landing.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /customcamera/src/main/res/layout/app_bar_landing.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /customcamera/src/main/res/layout/application_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /customcamera/src/main/res/layout/content_landing.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 22 | 23 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /customcamera/src/main/res/layout/item_grid.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /customcamera/src/main/res/layout/nav_header_landing.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /customcamera/src/main/res/menu/activity_landing_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /customcamera/src/main/res/menu/activity_words_list_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 13 | 17 | 21 | 22 | 23 | 24 | 25 | 29 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /customcamera/src/main/res/menu/words_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /customcamera/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/customcamera/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /customcamera/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /customcamera/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /customcamera/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /customcamera/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 160dp 5 | 6 | 16dp 7 | 16dp 8 | 16dp 9 | 8dp 10 | 11 | -------------------------------------------------------------------------------- /customcamera/src/main/res/values/drawables.xml: -------------------------------------------------------------------------------- 1 | 2 | @android:drawable/ic_menu_camera 3 | @android:drawable/ic_menu_gallery 4 | @android:drawable/ic_menu_slideshow 5 | @android:drawable/ic_menu_manage 6 | @android:drawable/ic_menu_share 7 | @android:drawable/ic_menu_send 8 | 9 | -------------------------------------------------------------------------------- /customcamera/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | CustomCamera 3 | 4 | Open navigation drawer 5 | Close navigation drawer 6 | 7 | Settings 8 | LandingActivity 9 | 10 | Flash light required 11 | Please provide permission to use flash light 12 | 13 | -------------------------------------------------------------------------------- /customcamera/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 10 | 11 | 15 | 16 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /networking/src/test/java/com/talentica/androidkotlin/networking/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.networking 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /o_notifications/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /o_notifications/README.md: -------------------------------------------------------------------------------- 1 | # Android-O Notifications With Kotlin 2 | 3 | This project is written in kotlin to display usage new notification manager features to support android-O. 4 | 5 | MVP has been used in this app, usage of dependency injection framework like dagger2 is highly recommended: 6 | 7 | This creates 2 notification channel groups when presenter (NotificationPresenter) starts: “Personal” and “Business” 8 | 9 | 10 | ## Minimum Requirements 11 | 12 | * Android Studio 3.0 Canery 3 13 | * Kotlin compiler and runtime version 1.1.2-4 14 | * Android SDK Platform 26 (android-O) 15 | * Android sdk tools 26.0.2 16 | * Android sdk build-tools 26.0.0 17 | * Android sdk plateform-tools 26.0.0 18 | 19 | Android-O Notifications 20 | 21 | 22 | -------------------------------------------------------------------------------- /o_notifications/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | 5 | android { 6 | compileSdkVersion 30 7 | 8 | 9 | defaultConfig { 10 | applicationId "com.talentica.androidkotlin.onotifications" 11 | minSdkVersion 21 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 17 | 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | android { 26 | lintOptions { 27 | abortOnError false 28 | } 29 | } 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | kotlinOptions { 35 | jvmTarget = '1.8' 36 | } 37 | } 38 | 39 | dependencies { 40 | implementation fileTree(dir: 'libs', include: ['*.jar']) 41 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { 42 | exclude group: 'com.android.support', module: 'support-annotations' 43 | }) 44 | 45 | implementation 'androidx.appcompat:appcompat:1.3.0' 46 | testImplementation 'junit:junit:4.13.2' 47 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 48 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 49 | implementation 'com.github.enricocid:cpl:1.0.2' 50 | } 51 | repositories { 52 | mavenCentral() 53 | } 54 | -------------------------------------------------------------------------------- /o_notifications/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/kaushald/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /o_notifications/src/androidTest/java/com/talentica/androidkotlin/onotifications/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.onotifications; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.runner.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | /** 14 | * Instrumentation test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() throws Exception { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.talentica.androidkotlin.onotifications", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /o_notifications/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /o_notifications/src/main/java/com/talentica/androidkotlin/onotifications/BasePresenter.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2017 Talentica Software Pvt. Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | package com.talentica.androidkotlin.onotifications 18 | 19 | interface BasePresenter { 20 | fun start() 21 | fun destroy() 22 | } -------------------------------------------------------------------------------- /o_notifications/src/main/java/com/talentica/androidkotlin/onotifications/BaseView.kt: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2017 Talentica Software Pvt. Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | package com.talentica.androidkotlin.onotifications 18 | 19 | interface BaseView { 20 | 21 | fun setPresenter(presenter: T) 22 | 23 | } -------------------------------------------------------------------------------- /o_notifications/src/main/res/drawable/ic_color_lens_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/o_notifications/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /o_notifications/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /o_notifications/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /o_notifications/src/test/java/com/talentica/androidkotlin/onotifications/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.onotifications; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /sensors/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sensors/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | 5 | android { 6 | compileSdkVersion 30 7 | buildToolsVersion "30.0.3" 8 | 9 | defaultConfig { 10 | applicationId "com.talentica.androidkotlin.sensors" 11 | minSdkVersion 21 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 17 | 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | android { 26 | lintOptions { 27 | abortOnError false 28 | } 29 | } 30 | 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(dir: 'libs', include: ['*.jar']) 35 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { 36 | exclude group: 'com.android.support', module: 'support-annotations' 37 | }) 38 | 39 | implementation 'androidx.appcompat:appcompat:1.3.0' 40 | implementation 'junit:junit:4.13.2' 41 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 42 | } 43 | repositories { 44 | mavenCentral() 45 | } 46 | -------------------------------------------------------------------------------- /sensors/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/suyashg/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /sensors/src/androidTest/java/com/talentica/androidkotlin/sensors/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sensors 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.runner.AndroidJUnit4 5 | import org.junit.Assert.assertEquals 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | /** 10 | * Instrumented test, which will execute on an Android device. 11 | * 12 | * See [testing documentation](http://d.android.com/tools/testing). 13 | */ 14 | @RunWith(AndroidJUnit4::class) 15 | class ExampleInstrumentedTest { 16 | @Test 17 | fun useAppContext() { 18 | // Context of the app under test. 19 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 20 | assertEquals("com.talentica.androidkotlin.sensors", appContext.packageName) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sensors/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sensors/src/main/java/com/talentica/androidkotlin/sensors/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sensors 2 | 3 | import android.os.Bundle 4 | import android.widget.ImageView 5 | import android.widget.Toast 6 | import androidx.appcompat.app.AppCompatActivity 7 | 8 | class MainActivity : AppCompatActivity() { 9 | private var compass: Compass? = null 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | setContentView(R.layout.activity_main) 14 | 15 | try { 16 | compass = Compass(this) 17 | } catch (e:IllegalStateException) { 18 | e.printStackTrace() 19 | Toast.makeText(this, "Either accelerometer or magnetic sensor not found" , Toast.LENGTH_LONG).show() 20 | } 21 | compass?.arrowView = findViewById(R.id.main_image_hands) 22 | } 23 | 24 | override fun onResume() { 25 | super.onResume() 26 | compass?.start() 27 | } 28 | 29 | override fun onPause() { 30 | super.onPause() 31 | compass?.stop() 32 | } 33 | 34 | companion object { 35 | private val TAG = "CompassActivity" 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /sensors/src/main/res/drawable/dial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/drawable/dial.png -------------------------------------------------------------------------------- /sensors/src/main/res/drawable/hands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/drawable/hands.png -------------------------------------------------------------------------------- /sensors/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 19 | 20 | 27 | 28 | 36 | 37 | -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sensors/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sensors/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sensors/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /sensors/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /sensors/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Compass 3 | 4 | Settings 5 | 6 | Compass Dial 7 | Compass Hands 8 | 9 | -------------------------------------------------------------------------------- /sensors/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sensors/src/test/java/com/talentica/androidkotlin/sensors/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sensors 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':audioplayer', ':locationmanager', ':sqlitedatabase', ':videostreaming', ':sensors', ':networking', 2 | ':customcamera', ':o_notifications' 3 | -------------------------------------------------------------------------------- /sqlitedatabase/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sqlitedatabase/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | 5 | android { 6 | compileSdkVersion 30 7 | 8 | 9 | defaultConfig { 10 | applicationId "com.talentica.androidkotlin.sqlitedatabase" 11 | minSdkVersion 21 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 17 | 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | android { 26 | lintOptions { 27 | abortOnError false 28 | } 29 | } 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | kotlinOptions { 35 | jvmTarget = '1.8' 36 | } 37 | } 38 | 39 | dependencies { 40 | implementation fileTree(dir: 'libs', include: ['*.jar']) 41 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { 42 | exclude group: 'com.android.support', module: 'support-annotations' 43 | }) 44 | 45 | implementation 'androidx.appcompat:appcompat:1.3.0' 46 | testImplementation 'junit:junit:4.13.2' 47 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 48 | 49 | implementation 'io.reactivex:rxandroid:0.24.0' 50 | implementation 'io.reactivex:rxjava:1.0.y-SNAPSHOT' 51 | implementation 'com.squareup.retrofit:retrofit:1.9.0' 52 | } 53 | repositories { 54 | mavenCentral() 55 | } 56 | -------------------------------------------------------------------------------- /sqlitedatabase/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/suyashg/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /sqlitedatabase/src/androidTest/java/com/talentica/androidkotlin/sqlitedatabase/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sqlitedatabase; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.runner.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | /** 14 | * Instrumentation test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() throws Exception { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.talentica.androidkotlin.sqlitedatabase", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/java/com/talentica/androidkotlin/sqlitedatabase/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sqlitedatabase 2 | 3 | import android.app.Application 4 | import android.database.Cursor 5 | import android.database.sqlite.SQLiteDatabase 6 | import com.talentica.androidkotlin.sqlitedatabase.helpers.DbHelper 7 | import kotlin.properties.Delegates 8 | 9 | class MainApplication : Application() { 10 | 11 | //database helper 12 | var dbHelper: DbHelper by Delegates.notNull() 13 | 14 | override fun onCreate() { 15 | //intantiate the db-helper when the app is created 16 | dbHelper = DbHelper(this) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/java/com/talentica/androidkotlin/sqlitedatabase/helpers/DbHelper.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sqlitedatabase.helpers 2 | 3 | import android.content.ContentValues 4 | import android.content.Context 5 | import android.database.Cursor 6 | import android.database.sqlite.SQLiteDatabase 7 | import android.database.sqlite.SQLiteOpenHelper 8 | import android.util.Log 9 | import java.util.* 10 | 11 | class DbHelper(context: Context) : SQLiteOpenHelper(context, "logs.db", null, 4) { 12 | val TAG = "DbHelper" 13 | val TABLE = "logs" 14 | 15 | companion object { 16 | val ID: String = "_id" 17 | val TIMESTAMP: String = "TIMESTAMP" 18 | val TEXT: String = "TEXT" 19 | } 20 | 21 | val DATABASE_CREATE = 22 | "CREATE TABLE if not exists " + TABLE + " (" + 23 | "${ID} integer PRIMARY KEY autoincrement," + 24 | "${TIMESTAMP} integer," + 25 | "${TEXT} text"+ 26 | ")" 27 | 28 | fun log(text: String) { 29 | val values = ContentValues() 30 | values.put(TEXT, text) 31 | values.put(TIMESTAMP, Date().time) 32 | getWritableDatabase().insert(TABLE, null, values); 33 | } 34 | 35 | fun getLogs() : Cursor { 36 | return getReadableDatabase() 37 | .query(TABLE, arrayOf(ID, TIMESTAMP, TEXT), null, null, null, null, TIMESTAMP + " DESC"); 38 | } 39 | 40 | override fun onCreate(db: SQLiteDatabase) { 41 | Log.d(TAG, "Creating: " + DATABASE_CREATE); 42 | db.execSQL(DATABASE_CREATE) 43 | } 44 | 45 | override fun onUpgrade(p0: SQLiteDatabase, p1: Int, p2: Int) { 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/java/com/talentica/androidkotlin/sqlitedatabase/model/User.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sqlitedatabase.model 2 | 3 | /** 4 | * Created by suyashg on 31/05/17. 5 | */ 6 | data class User(val id: String, val name: String) -------------------------------------------------------------------------------- /sqlitedatabase/src/main/java/com/talentica/androidkotlin/sqlitedatabase/server/UserService.kt: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sqlitedatabase.server 2 | 3 | import com.google.gson.JsonObject 4 | import com.talentica.androidkotlin.sqlitedatabase.model.User 5 | import rx.Observable 6 | 7 | /** 8 | * Created by suyashg on 31/05/17. 9 | */ 10 | interface UserService { 11 | fun findUser(name: String) : Observable 12 | fun addFriend(user: User) : Observable 13 | } 14 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/layout/item_log.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/sqlitedatabase/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 64dp 7 | 8 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | sqliteDatabase 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /sqlitedatabase/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sqlitedatabase/src/test/java/com/talentica/androidkotlin/sqlitedatabase/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.sqlitedatabase; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /videostreaming/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /videostreaming/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | 5 | android { 6 | compileSdkVersion 30 7 | 8 | 9 | defaultConfig { 10 | applicationId "com.talentica.androidkotlin.videostreaming" 11 | minSdkVersion 21 12 | targetSdkVersion 30 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 17 | 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | android { 26 | lintOptions { 27 | abortOnError false 28 | } 29 | } 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | kotlinOptions { 35 | jvmTarget = '1.8' 36 | } 37 | } 38 | 39 | dependencies { 40 | implementation fileTree(dir: 'libs', include: ['*.jar']) 41 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { 42 | exclude group: 'com.android.support', module: 'support-annotations' 43 | }) 44 | 45 | implementation 'androidx.appcompat:appcompat:1.3.0' 46 | testImplementation 'junit:junit:4.13.2' 47 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 48 | implementation 'com.google.android.material:material:1.3.0' 49 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 50 | } 51 | repositories { 52 | mavenCentral() 53 | } 54 | -------------------------------------------------------------------------------- /videostreaming/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/suyashg/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /videostreaming/src/androidTest/java/com/talentica/androidkotlin/videostreaming/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.talentica.androidkotlin.videostreaming; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.runner.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | /** 14 | * Instrumentation test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() throws Exception { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.talentica.androidkotlin.videostreaming", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /videostreaming/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /videostreaming/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap/pause_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap/pause_button.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap/play_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap/play_button.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/mipmap/stop_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Talentica/AndroidWithKotlin/08d3d5d396aa9263030d37eea5a323a39b04c80c/videostreaming/src/main/res/mipmap/stop_button.png -------------------------------------------------------------------------------- /videostreaming/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /videostreaming/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /videostreaming/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | VideoStreaming 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /videostreaming/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |