├── .DS_Store
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ ├── android.yml
│ ├── build.yml
│ └── master-apk-create.yml
├── .gitignore
├── .idea
├── .gitignore
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── deploymentTargetDropDown.xml
├── kotlinScripting.xml
└── kotlinc.xml
├── LICENSE
├── README.md
├── animations
├── canvas
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── canvas
│ │ ├── MultiStateAnimationCircleFilledCanvas.kt
│ │ └── MultiStateAnimationCircleStrokeCanvas.kt
└── lottie
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── cryptoload.json
│ ├── food.json
│ ├── loader.json
│ ├── profile.json
│ ├── success.json
│ └── working.json
│ └── java
│ └── com
│ └── guru
│ └── composecookbook
│ └── lottie
│ ├── LottieCryptoLoadingView.kt
│ ├── LottieFoodView.kt
│ ├── LottieLoaderLoadingView.kt
│ ├── LottieLoadingView.kt
│ └── LottieWorkingLoadingView.kt
├── app
├── .gitignore
├── build.gradle.kts
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ ├── BottomNavigationBarTests.kt
│ │ └── ui
│ │ └── home
│ │ ├── HomeScreenTest.kt
│ │ └── home_screen_options
│ │ ├── GridListTest.kt
│ │ ├── HorizontalListTest.kt
│ │ ├── LayoutsTest.kt
│ │ ├── VerticalListTest.kt
│ │ └── flings
│ │ ├── FlingListActivityTest.kt
│ │ └── FlingSettingsPageTest.kt
│ ├── debug
│ └── AndroidManifest.xml
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ ├── t1.mp4
│ │ ├── t2.mp4
│ │ └── t3.mp4
│ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ ├── App.kt
│ │ │ ├── BottomNavType.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── theme
│ │ │ ├── AppThemeState.kt
│ │ │ └── SystemUI.kt
│ │ │ └── ui
│ │ │ ├── animation
│ │ │ ├── AnimatableSuspendingAnimations.kt
│ │ │ ├── AnimateAsStateAnimations.kt
│ │ │ ├── AnimationScreen.kt
│ │ │ ├── TransitionsAnimations.kt
│ │ │ └── VisibilityAnimations.kt
│ │ │ ├── demoapps
│ │ │ └── DemoUIList.kt
│ │ │ ├── home
│ │ │ ├── HomeScreen.kt
│ │ │ ├── advancelists
│ │ │ │ ├── AdvanceListsActivity.kt
│ │ │ │ ├── AnimatedLists.kt
│ │ │ │ ├── LoadingShimmerList.kt
│ │ │ │ ├── Shimmer.kt
│ │ │ │ └── SwipeableLists.kt
│ │ │ ├── androidviews
│ │ │ │ └── AndroidViews.kt
│ │ │ ├── clock
│ │ │ │ ├── ClockDemo.kt
│ │ │ │ ├── ClockView.kt
│ │ │ │ └── ClockViewModel.kt
│ │ │ ├── constraintlayout
│ │ │ │ └── ConstraintLayoutDemos.kt
│ │ │ ├── customfling
│ │ │ │ ├── FlingListActivity.kt
│ │ │ │ ├── FlingListSettingsActivity.kt
│ │ │ │ ├── FlingListViewTypes.kt
│ │ │ │ ├── FlingStateStore.kt
│ │ │ │ ├── ListItemDivider.kt
│ │ │ │ ├── SettingsPage.kt
│ │ │ │ ├── VerticalFlingerList.kt
│ │ │ │ └── VerticalFlingerListItem.kt
│ │ │ ├── dialogs
│ │ │ │ ├── BottomSheetLayouts.kt
│ │ │ │ ├── DialogState.kt
│ │ │ │ ├── DialogType.kt
│ │ │ │ └── DialogsActivity.kt
│ │ │ ├── dynamic
│ │ │ │ ├── DynamicUIActivity.kt
│ │ │ │ ├── DynamicUiType.kt
│ │ │ │ └── Modifiers.kt
│ │ │ ├── lists
│ │ │ │ ├── GridListItem.kt
│ │ │ │ ├── HorizontalListItem.kt
│ │ │ │ ├── ListViewActivity.kt
│ │ │ │ ├── ListViewType.kt
│ │ │ │ ├── VerticalListItem.kt
│ │ │ │ └── VerticalListItemSmall.kt
│ │ │ ├── motionlayout
│ │ │ │ └── MotionLayoutDemo.kt
│ │ │ ├── pullrefreshdemos
│ │ │ │ └── PullRefreshList.kt
│ │ │ ├── tabslayout
│ │ │ │ └── TabLayout.kt
│ │ │ └── timer
│ │ │ │ ├── TimerDemo.kt
│ │ │ │ ├── TimerView.kt
│ │ │ │ ├── TimerViewAnimation.kt
│ │ │ │ └── TimerViewModel.kt
│ │ │ ├── learnwidgets
│ │ │ ├── AllButtons.kt
│ │ │ ├── AppBars.kt
│ │ │ ├── Chips.kt
│ │ │ ├── Layouts.kt
│ │ │ ├── Loaders.kt
│ │ │ ├── Snackbars.kt
│ │ │ ├── SwipeButton.kt
│ │ │ ├── TextInputs.kt
│ │ │ ├── Texts.kt
│ │ │ ├── Toggles.kt
│ │ │ ├── UICards.kt
│ │ │ └── WidgetScreen.kt
│ │ │ ├── templates
│ │ │ ├── TemplateScreen.kt
│ │ │ └── TemplatesActivity.kt
│ │ │ └── utils
│ │ │ ├── CommomComponents.kt
│ │ │ ├── Extentions.kt
│ │ │ ├── FloatUtil.kt
│ │ │ └── TestTags.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── heart_grey.png
│ │ ├── heart_red.png
│ │ ├── ic_baseline_access_time_24.xml
│ │ └── ic_launcher_background.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.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
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── guru
│ └── composecookbook
│ └── ui
│ └── home
│ └── HomeScreenItemsTest.kt
├── build.gradle.kts
├── buildSrc
├── build.gradle.kts
└── src
│ └── main
│ └── kotlin
│ ├── com
│ └── guru
│ │ └── composecookbook
│ │ └── build
│ │ ├── configurations
│ │ └── ProjectConfigs.kt
│ │ └── dependencies
│ │ ├── Dependencies.kt
│ │ ├── DependencyHandlerExtensions.kt
│ │ ├── GroupedDependencies.kt
│ │ └── Versions.kt
│ ├── common-compose-module-configs-script-plugin.gradle.kts
│ └── common-kotlin-module-configs-script-plugin.gradle.kts
├── components
├── carousel
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── carousel
│ │ ├── CarouselDot.kt
│ │ ├── CarouselLayout.kt
│ │ ├── PageData.kt
│ │ ├── Pager.kt
│ │ ├── PagerScope.kt
│ │ ├── PagerState.kt
│ │ └── SelectionState.kt
├── charts
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── charts
│ │ └── Charts.kt
├── colorpicker
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── colorpicker
│ │ └── ColorPicker.kt
├── comingsoon
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── comingsoon
│ │ └── ComingSoon.kt
├── fab
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── fab
│ │ └── AnimatingFabContent.kt
├── tags
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── tags
│ │ └── InterestTag.kt
└── verticalgrid
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── guru
│ └── composecookbook
│ └── verticalgrid
│ ├── StaggeredVerticalGrid.kt
│ └── VerticalGrid.kt
├── data
├── .gitignore
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── data
│ │ ├── AlbumsDataProvider.kt
│ │ ├── DemoDataProvider.kt
│ │ └── model
│ │ ├── Album.kt
│ │ ├── HomeScreenItems.kt
│ │ ├── Item.kt
│ │ └── Tweet.kt
│ └── res
│ └── drawable-nodpi
│ ├── adele.jpeg
│ ├── adele21.jpeg
│ ├── billie.jpg
│ ├── bp.jpg
│ ├── camelia.jpeg
│ ├── dancemonkey.jpg
│ ├── dualipa.jpeg
│ ├── ed2.jpg
│ ├── edsheeran.jpeg
│ ├── eminem.jpeg
│ ├── food1.jpg
│ ├── food10.jpg
│ ├── food11.webp
│ ├── food12.webp
│ ├── food13.webp
│ ├── food14.jpg
│ ├── food15.webp
│ ├── food16.jpg
│ ├── food2.jpg
│ ├── food3.jpg
│ ├── food4.jpg
│ ├── food5.webp
│ ├── food6.jpg
│ ├── food7.webp
│ ├── food8.webp
│ ├── food9.jpg
│ ├── imagindragon.jpg
│ ├── james.jpg
│ ├── katy.jpg
│ ├── khalid.png
│ ├── lana.jpeg
│ ├── marsh.jpg
│ ├── p1.jpeg
│ ├── p10.jpeg
│ ├── p11.jpeg
│ ├── p2.jpeg
│ ├── p3.jpeg
│ ├── p4.jpeg
│ ├── p5.jpeg
│ ├── p6.jpeg
│ ├── p7.jpeg
│ ├── p8.jpeg
│ ├── p9.jpeg
│ ├── sam.jpeg
│ ├── shawn.jpeg
│ ├── tylor.jpeg
│ ├── weekend.jpeg
│ └── wolves.jpg
├── demos
├── betty
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── androidTest
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── adwi
│ │ │ │ └── betty
│ │ │ │ └── ExampleInstrumentedTest.kt
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── ic_launcher-playstore.png
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── adwi
│ │ │ │ │ └── betty
│ │ │ │ │ ├── BettyApp.kt
│ │ │ │ │ ├── data
│ │ │ │ │ ├── local
│ │ │ │ │ │ ├── BettyDatabase.kt
│ │ │ │ │ │ ├── dao
│ │ │ │ │ │ │ └── OddsDao.kt
│ │ │ │ │ │ └── entity
│ │ │ │ │ │ │ └── Odd.kt
│ │ │ │ │ ├── remote
│ │ │ │ │ │ ├── OddsApi.kt
│ │ │ │ │ │ └── dto
│ │ │ │ │ │ │ ├── MatchDto.kt
│ │ │ │ │ │ │ └── SportKey.kt
│ │ │ │ │ └── repository
│ │ │ │ │ │ ├── OddsRepository.kt
│ │ │ │ │ │ └── OddsRepositoryInterface.kt
│ │ │ │ │ ├── di
│ │ │ │ │ ├── AppModule.kt
│ │ │ │ │ ├── DispatcherModule.kt
│ │ │ │ │ ├── LocalModule.kt
│ │ │ │ │ ├── NetworkModule.kt
│ │ │ │ │ └── ViewModelModule.kt
│ │ │ │ │ ├── ui
│ │ │ │ │ ├── base
│ │ │ │ │ │ ├── BaseActivity.kt
│ │ │ │ │ │ └── BaseViewModel.kt
│ │ │ │ │ ├── components
│ │ │ │ │ │ ├── AnimatedView.kt
│ │ │ │ │ │ ├── Header.kt
│ │ │ │ │ │ ├── List.kt
│ │ │ │ │ │ └── Scaffold.kt
│ │ │ │ │ ├── home
│ │ │ │ │ │ └── Home.kt
│ │ │ │ │ ├── main
│ │ │ │ │ │ ├── MainActivity.kt
│ │ │ │ │ │ └── MainViewModel.kt
│ │ │ │ │ └── theme
│ │ │ │ │ │ ├── Color.kt
│ │ │ │ │ │ ├── Shape.kt
│ │ │ │ │ │ ├── Theme.kt
│ │ │ │ │ │ └── Type.kt
│ │ │ │ │ ├── util
│ │ │ │ │ ├── Constants.kt
│ │ │ │ │ ├── Extensions.kt
│ │ │ │ │ ├── ModifierExtensions.kt
│ │ │ │ │ ├── NetworkBoundResource.kt
│ │ │ │ │ ├── NotificationUtil.kt
│ │ │ │ │ └── Resource.kt
│ │ │ │ │ └── work
│ │ │ │ │ ├── FetchFreshDataWork.kt
│ │ │ │ │ └── SetupNotificationsWork.kt
│ │ │ └── res
│ │ │ │ ├── drawable
│ │ │ │ ├── ic_fire_animated.png
│ │ │ │ ├── ic_launcher_foreground.xml
│ │ │ │ └── ic_refresh.xml
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.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
│ │ │ │ ├── raw
│ │ │ │ ├── emoji.json
│ │ │ │ ├── fire.json
│ │ │ │ ├── loading.json
│ │ │ │ ├── no_results.json
│ │ │ │ └── ok.json
│ │ │ │ ├── values-night
│ │ │ │ └── themes.xml
│ │ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── themes.xml
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── adwi
│ │ │ └── betty
│ │ │ ├── TestCoroutineRule.kt
│ │ │ ├── fake
│ │ │ └── FakeRepository.kt
│ │ │ └── ui
│ │ │ └── main
│ │ │ └── MainViewModelTest.kt
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── screenshots
│ │ └── betty.gif
│ └── settings.gradle
├── cryptoapp
│ ├── app
│ │ ├── .gitignore
│ │ ├── build.gradle.kts
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── guru
│ │ │ │ └── composecookbook
│ │ │ │ └── cryptoapp
│ │ │ │ └── ui
│ │ │ │ ├── composewear
│ │ │ │ └── AndroidWearActivity.kt
│ │ │ │ ├── detail
│ │ │ │ ├── CryptoDetailActivity.kt
│ │ │ │ ├── CryptoDetailViewModel.kt
│ │ │ │ └── components
│ │ │ │ │ ├── CryptoDetailScreen.kt
│ │ │ │ │ └── FavoriteCryptoCard.kt
│ │ │ │ ├── home
│ │ │ │ ├── CryptoHomeActivity.kt
│ │ │ │ ├── CryptoHomeViewModel.kt
│ │ │ │ └── components
│ │ │ │ │ ├── CryptoHomeScreen.kt
│ │ │ │ │ ├── CryptoListItem.kt
│ │ │ │ │ └── MyWalletCard.kt
│ │ │ │ └── internal
│ │ │ │ ├── extensions
│ │ │ │ └── Extentions.kt
│ │ │ │ └── theme
│ │ │ │ └── Colors.kt
│ │ │ └── res
│ │ │ ├── values-round
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ └── strings.xml
│ └── data
│ │ ├── .gitignore
│ │ ├── build.gradle.kts
│ │ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── cryptoapp
│ │ └── data
│ │ ├── CryptoDemoDataProvider.kt
│ │ ├── DemoDIGraph.kt
│ │ ├── api
│ │ ├── CryptoApi.kt
│ │ ├── CryptoApiMapper.kt
│ │ └── models
│ │ │ ├── CryptoApiResponse.kt
│ │ │ └── CryptoDetailResponse.kt
│ │ ├── db
│ │ ├── CryptoDatabase.kt
│ │ ├── ListTypeConverter.kt
│ │ ├── daos
│ │ │ └── CryptoDao.kt
│ │ └── models
│ │ │ └── Crypto.kt
│ │ ├── paging
│ │ └── PageNumSource.kt
│ │ └── repositories
│ │ ├── CryptoRepository.kt
│ │ └── CryptoRepositoryImpl.kt
├── datingapp
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── datingapp
│ │ │ ├── DatingHomeActivity.kt
│ │ │ ├── DatingHomeViewModel.kt
│ │ │ ├── components
│ │ │ ├── chat
│ │ │ │ ├── DatingChatItem.kt
│ │ │ │ ├── DatingChatScreen.kt
│ │ │ │ ├── MatchesImage.kt
│ │ │ │ └── MatchesSections.kt
│ │ │ ├── home
│ │ │ │ ├── DatingHomeScreen.kt
│ │ │ │ └── DraggableCard.kt
│ │ │ └── profile
│ │ │ │ └── ProfileScreen.kt
│ │ │ └── util
│ │ │ └── Extentions.kt
│ │ └── res
│ │ └── values
│ │ └── strings.xml
├── gmail
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── gmail
│ │ │ ├── data
│ │ │ └── SampleData.kt
│ │ │ └── ui
│ │ │ ├── GmailActivity.kt
│ │ │ ├── create
│ │ │ ├── CreateMessageBody.kt
│ │ │ ├── CreateMessageMoreActionPopupMenu.kt
│ │ │ └── CreateMessageScreen.kt
│ │ │ ├── details
│ │ │ ├── MessageDetailBody.kt
│ │ │ └── MessageDetailScreen.kt
│ │ │ └── home
│ │ │ ├── GmailDrawer.kt
│ │ │ ├── GmailHome.kt
│ │ │ ├── GmailListItem.kt
│ │ │ └── SearchLayout.kt
│ │ └── res
│ │ └── values
│ │ └── strings.xml
├── instagram
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── instagram
│ │ │ ├── InstagramActivity.kt
│ │ │ └── components
│ │ │ ├── InstagramHome.kt
│ │ │ ├── posts
│ │ │ ├── PostImage.kt
│ │ │ ├── PostInteractionBar.kt
│ │ │ ├── PostItem.kt
│ │ │ └── PostList.kt
│ │ │ ├── profile
│ │ │ ├── Profile.kt
│ │ │ └── ProfileSection.kt
│ │ │ └── stories
│ │ │ ├── StoryItem.kt
│ │ │ ├── StoryList.kt
│ │ │ └── StoryPopup.kt
│ │ └── res
│ │ └── values
│ │ └── strings.xml
├── meditation
│ ├── .gitignore
│ ├── build.gradle.kts
│ ├── consumer-rules.pro
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── meditation
│ │ │ └── ExampleInstrumentedTest.kt
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── guru
│ │ │ │ └── composecookbook
│ │ │ │ └── meditation
│ │ │ │ ├── MeditaionActivity.kt
│ │ │ │ └── ui
│ │ │ │ ├── component
│ │ │ │ ├── BottomMenuItem.kt
│ │ │ │ ├── CategoryItem.kt
│ │ │ │ ├── DailyThoughtsItem.kt
│ │ │ │ ├── FeatureItem.kt
│ │ │ │ ├── RecommendationItem.kt
│ │ │ │ └── TopicItem.kt
│ │ │ │ ├── model
│ │ │ │ ├── BottomMenuContent.kt
│ │ │ │ ├── Categories.kt
│ │ │ │ ├── DailyThought.kt
│ │ │ │ ├── Feature.kt
│ │ │ │ ├── Recommendation.kt
│ │ │ │ └── Topic.kt
│ │ │ │ ├── screen
│ │ │ │ └── HomeScreen.kt
│ │ │ │ ├── theme
│ │ │ │ ├── Color.kt
│ │ │ │ ├── Shape.kt
│ │ │ │ ├── Theme.kt
│ │ │ │ ├── Type.kt
│ │ │ │ └── dimens.kt
│ │ │ │ └── utils.kt
│ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ ├── ic_category_all.xml
│ │ │ ├── ic_category_anxious.xml
│ │ │ ├── ic_category_kids.xml
│ │ │ ├── ic_category_my.xml
│ │ │ ├── ic_category_sleep.xml
│ │ │ ├── ic_daily_thoughts.xml
│ │ │ ├── ic_feature_1.xml
│ │ │ ├── ic_feature_2.xml
│ │ │ ├── ic_home.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── ic_logo.xml
│ │ │ ├── ic_meditate.xml
│ │ │ ├── ic_music.xml
│ │ │ ├── ic_play.xml
│ │ │ ├── ic_profile.xml
│ │ │ ├── ic_recommendation_1.xml
│ │ │ ├── ic_recommendation_2.xml
│ │ │ ├── ic_sleep.xml
│ │ │ ├── ic_topic_1.xml
│ │ │ ├── ic_topic_2.xml
│ │ │ ├── ic_topic_3.xml
│ │ │ ├── ic_topic_4.xml
│ │ │ ├── ic_topic_5.xml
│ │ │ └── ic_topic_6.xml
│ │ │ ├── font
│ │ │ ├── sans_pro_black.ttf
│ │ │ ├── sans_pro_bold.ttf
│ │ │ ├── sans_pro_extra_light.ttf
│ │ │ ├── sans_pro_light.ttf
│ │ │ ├── sans_pro_regular.ttf
│ │ │ └── sans_pro_semi_bold.ttf
│ │ │ └── values
│ │ │ └── strings.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── meditation
│ │ └── ExampleUnitTest.kt
├── moviesapp
│ ├── app
│ │ ├── .gitignore
│ │ ├── build.gradle.kts
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── guru
│ │ │ │ └── composecookbook
│ │ │ │ └── moviesapp
│ │ │ │ └── ui
│ │ │ │ ├── details
│ │ │ │ ├── MovieDetailActivity.kt
│ │ │ │ ├── MovieDetailViewModel.kt
│ │ │ │ └── components
│ │ │ │ │ ├── GenreSection.kt
│ │ │ │ │ ├── MovieDetailContent.kt
│ │ │ │ │ └── SimilarMoviesSection.kt
│ │ │ │ ├── home
│ │ │ │ ├── MoviesHomeActivity.kt
│ │ │ │ ├── MoviewsHomeViewModel.kt
│ │ │ │ └── components
│ │ │ │ │ ├── MoviePagerItem.kt
│ │ │ │ │ ├── MoviesHomeScreen.kt
│ │ │ │ │ └── MoviesPager.kt
│ │ │ │ ├── internal
│ │ │ │ └── theme
│ │ │ │ │ └── Colors.kt
│ │ │ │ ├── trending
│ │ │ │ ├── TrendingViewModel.kt
│ │ │ │ └── components
│ │ │ │ │ ├── MovieTrendingScreen.kt
│ │ │ │ │ └── MoviesLaneItem.kt
│ │ │ │ └── watch
│ │ │ │ └── components
│ │ │ │ ├── EmptyWatchlistSection.kt
│ │ │ │ ├── MovieWatchlistItem.kt
│ │ │ │ └── WatchlistScreen.kt
│ │ │ └── res
│ │ │ └── values
│ │ │ └── strings.xml
│ └── data
│ │ ├── .gitignore
│ │ ├── build.gradle.kts
│ │ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── moviesapp
│ │ └── data
│ │ ├── DemoMovieDataProvider.kt
│ │ ├── MovieDIGraph.kt
│ │ ├── api
│ │ ├── MovieApi.kt
│ │ └── models
│ │ │ ├── GenreApiResponse.kt
│ │ │ └── MovieListResponse.kt
│ │ ├── db
│ │ ├── ListTypeConverter.kt
│ │ ├── MovieDatabase.kt
│ │ ├── daos
│ │ │ ├── GenreDao.kt
│ │ │ └── MoviesDao.kt
│ │ └── models
│ │ │ ├── Genre.kt
│ │ │ └── Movie.kt
│ │ └── repositories
│ │ ├── MovieRepository.kt
│ │ ├── MovieRepositoryImpl.kt
│ │ ├── MoviesLaneRepositoryImpl.kt
│ │ └── MoviesLanesRepository.kt
├── paint
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── paint
│ │ │ ├── DrawingCanvas.kt
│ │ │ ├── DrawingTools.kt
│ │ │ ├── PaintActivity.kt
│ │ │ └── PaintApp.kt
│ │ └── res
│ │ └── values
│ │ └── strings.xml
├── spotify
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── spotify
│ │ │ ├── data
│ │ │ └── SpotifyDataProvider.kt
│ │ │ └── ui
│ │ │ ├── details
│ │ │ ├── SpotifyDetailActivity.kt
│ │ │ └── components
│ │ │ │ ├── BoxTopSection.kt
│ │ │ │ ├── SongListScrollingSection.kt
│ │ │ │ ├── SpotifyDetailScreen.kt
│ │ │ │ └── SpotifySongListItem.kt
│ │ │ ├── home
│ │ │ ├── SpotifyActivity.kt
│ │ │ └── components
│ │ │ │ ├── PlayerBottomBar.kt
│ │ │ │ ├── SpotifyHome.kt
│ │ │ │ ├── SpotifyHomeGridItem.kt
│ │ │ │ └── SpotifyLaneItem.kt
│ │ │ ├── playlist
│ │ │ └── components
│ │ │ │ └── SpotifyPlaylist.kt
│ │ │ └── search
│ │ │ └── components
│ │ │ ├── SpotifySearchBar.kt
│ │ │ ├── SpotifySearchGrid.kt
│ │ │ └── SpotifySearchScreen.kt
│ │ └── res
│ │ └── values
│ │ └── strings.xml
├── tiktok
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── tiktok
│ │ │ ├── TikTokScreen.kt
│ │ │ ├── TiktokActivity.kt
│ │ │ ├── TiktokDemoDataProvider.kt
│ │ │ ├── TiktokHomeInteractionEvents.kt
│ │ │ └── components
│ │ │ ├── discovers
│ │ │ ├── DiscoveryScreen.kt
│ │ │ ├── LanesSection.kt
│ │ │ ├── MediaItem.kt
│ │ │ └── SearchSection.kt
│ │ │ ├── home
│ │ │ ├── HomeScreen.kt
│ │ │ ├── TikTokPlayer.kt
│ │ │ └── TiktokCreateIcon.kt
│ │ │ └── profile
│ │ │ ├── ProfileAppBar.kt
│ │ │ ├── ProfileScreen.kt
│ │ │ ├── ProfileTabs.kt
│ │ │ └── ProfileTopSection.kt
│ │ └── res
│ │ └── values
│ │ └── strings.xml
├── twitter
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── twitter
│ │ │ ├── TwitterActivity.kt
│ │ │ └── components
│ │ │ ├── TwitterHome.kt
│ │ │ ├── icons
│ │ │ ├── IconCounter.kt
│ │ │ └── IconCounterBar.kt
│ │ │ ├── profiles
│ │ │ ├── ProfileInfo.kt
│ │ │ └── ProfilePicture.kt
│ │ │ └── tweets
│ │ │ ├── TweetImage.kt
│ │ │ └── TweetItem.kt
│ │ └── res
│ │ └── values
│ │ └── strings.xml
└── youtube
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── youtube
│ │ ├── YoutubeActivity.kt
│ │ └── components
│ │ ├── YoutubeChip.kt
│ │ ├── YoutubeHome.kt
│ │ └── YoutubeListItem.kt
│ └── res
│ └── values
│ └── strings.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screens
├── .DS_Store
├── Screenshot_20200906-161500_ComposeDemo.jpg
├── Screenshot_20200906-161609_ComposeDemo.jpg
├── Screenshot_20200906-161629_ComposeDemo.jpg
├── Screenshot_20200907-001949_ComposeDemo.jpg
├── Screenshot_20200907-002000_ComposeDemo.jpg
└── composelogo.png
├── settings.gradle.kts
├── templates
├── cascademenu
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── cascademenu
│ │ ├── CascadeScreen.kt
│ │ └── cascade
│ │ ├── CascadeMenu.kt
│ │ ├── CascadeMenuBuilder.kt
│ │ ├── CascadeMenuColors.kt
│ │ ├── CascadeMenuItem.kt
│ │ └── CascadeMenuState.kt
├── login
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── login
│ │ ├── HorizontalDottedProgressBar.kt
│ │ └── LoginScreen.kt
├── onboarding
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── onboarding
│ │ ├── OnboardingPagerItem.kt
│ │ ├── OnboardingPagerSlide.kt
│ │ └── OnboardingScreen.kt
├── paymentcard
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── composecookbook
│ │ │ └── paymentcard
│ │ │ ├── AddPaymentScreen.kt
│ │ │ ├── InputItem.kt
│ │ │ ├── PaymentCard.kt
│ │ │ └── PaymentCardFilter.kt
│ │ └── res
│ │ ├── drawable
│ │ └── card_symbol.png
│ │ └── values
│ │ └── strings.xml
├── pinlock
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── guru
│ │ │ └── pinlock
│ │ │ ├── BiometricActivity.kt
│ │ │ └── PinLockView.kt
│ │ └── res
│ │ └── values
│ │ └── themes.xml
└── profile
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── guru
│ │ └── composecookbook
│ │ └── profile
│ │ ├── BottomScrollingContent.kt
│ │ ├── InterestsSection.kt
│ │ ├── MoreInfoSection.kt
│ │ ├── MyPhotosSection.kt
│ │ ├── ProfileScreen.kt
│ │ ├── SocialRow.kt
│ │ └── TopScrollingContent.kt
│ └── res
│ └── values
│ └── strings.xml
└── theme
├── .gitignore
├── build.gradle.kts
└── src
└── main
├── AndroidManifest.xml
├── java
└── com
│ └── guru
│ └── composecookbook
│ └── theme
│ ├── Color.kt
│ ├── MaterialTheme.kt
│ ├── Shape.kt
│ ├── Theme.kt
│ ├── Type.kt
│ ├── components
│ └── Material3Card.kt
│ ├── extensions
│ └── BitmapExt.kt
│ ├── helpers
│ └── TextFieldDefaultsMaterial.kt
│ └── modifiers
│ └── ModifierExtentions.kt
└── res
├── drawable
├── ic_baseline_home_24.xml
├── ic_bitcoin_brands.xml
├── ic_comment_dots_solid.xml
├── ic_ethereum_brands.xml
├── ic_github_square_brands.xml
├── ic_hashtag_solid.xml
├── ic_heart_solid.xml
├── ic_instagram.xml
├── ic_linkedin_brands.xml
├── ic_retweet_solid.xml
├── ic_send.xml
├── ic_share_solid.xml
├── ic_sleep.xml
├── ic_speech_bubble.xml
├── ic_twitter.xml
├── ic_twitter_square_brands.xml
├── ic_visa_logo.xml
└── ic_youtube.xml
├── values-night
└── themes.xml
└── values
├── colors.xml
└── themes.xml
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/.DS_Store
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/workflows/android.yml:
--------------------------------------------------------------------------------
1 | name: Android CI
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v2
16 | - name: set up JDK 1.8
17 | uses: actions/setup-java@v1
18 | with:
19 | java-version: 11
20 | - name: Grant execute permission for gradlew
21 | run: chmod +x gradlew
22 | - name: Build with Gradle
23 | run: ./gradlew build
24 |
25 | androidTests:
26 |
27 | runs-on: macos-latest
28 |
29 | steps:
30 | - name: checkout
31 | uses: actions/checkout@v2
32 | - name: set up JDK 1.8
33 | uses: actions/setup-java@v1
34 | with:
35 | java-version: 11
36 | - name: Compose UI tests
37 | uses: reactivecircus/android-emulator-runner@v2
38 | with:
39 | api-level: 29
40 | script: ./gradlew connectedCheck
41 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build APK
2 |
3 | on:
4 |
5 | push:
6 | branches: [ "master" ]
7 | pull_request:
8 | branches: [ "master" ]
9 |
10 | workflow_dispatch:
11 |
12 |
13 | jobs:
14 |
15 | build_job:
16 | name: Building the APK
17 | runs-on: ubuntu-latest
18 | continue-on-error: true
19 | steps:
20 | - name: Checkout
21 | uses: actions/checkout@v2
22 | - name: Restore Cache
23 | uses: actions/cache@v2
24 | with:
25 | path: |
26 | ~/.gradle/caches
27 | ~/.gradle/wrapper
28 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
29 | restore-keys: |
30 | ${{ runner.os }}-gradle-
31 | - name: Change wrapper permissions
32 | run: chmod +x ./gradlew
33 |
34 |
35 | - name: Touch local properties
36 | run: touch local.properties
37 | - name: Add Api Key
38 | run: echo "apiKey=\"\"" >> local.properties
39 |
40 | - name: Assemble Debug
41 | run: ./gradlew assembleDebug
42 |
43 | - name: Upload APK
44 | uses: actions/upload-artifact@v2
45 | with:
46 | name: ComposeCookBook
47 | path: app/build/outputs/apk/debug/**.apk
48 |
--------------------------------------------------------------------------------
/.github/workflows/master-apk-create.yml:
--------------------------------------------------------------------------------
1 | name: Create APK from Main
2 |
3 | on:
4 |
5 | push:
6 |
7 | branches:
8 |
9 | - master
10 |
11 | jobs:
12 |
13 | build:
14 |
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 |
19 | - uses: actions/checkout@v2
20 |
21 | - name: set up JDK 11
22 |
23 | uses: actions/setup-java@v2
24 |
25 | with:
26 |
27 | java-version: '11'
28 |
29 | distribution: 'temurin'
30 |
31 | cache: gradle
32 |
33 | - name: Grant execute permission for gradlew
34 |
35 | run: chmod +x gradlew
36 |
37 |
38 |
39 | - name: Build APK ⚙️🛠
40 |
41 | run: bash ./gradlew assembleDebug
42 |
43 |
44 |
45 | - uses: "marvinpinto/action-automatic-releases@latest"
46 |
47 | with:
48 |
49 | repo_token: "${{ github.token }}"
50 |
51 | automatic_release_tag: "latest-master"
52 |
53 | prerelease: true
54 |
55 | title: "Staging Build"
56 |
57 | files: app/build/outputs/apk/debug/app-debug.apk
58 |
59 |
60 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/deploymentTargetDropDown.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/kotlinScripting.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Gurupreet Singh
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/animations/canvas/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/animations/canvas/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":theme"))
12 | addComposeOfficialDependencies()
13 | }
14 |
--------------------------------------------------------------------------------
/animations/canvas/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/animations/lottie/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/animations/lottie/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidDependencies
3 | import com.guru.composecookbook.build.dependencies.addThirdPartyUiDependencies
4 |
5 | plugins {
6 | /**
7 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
8 | */
9 | id("common-compose-module-configs-script-plugin")
10 | }
11 |
12 | dependencies {
13 | addComposeOfficialDependencies()
14 | addCoreAndroidDependencies()
15 | addThirdPartyUiDependencies()
16 | }
17 |
--------------------------------------------------------------------------------
/animations/lottie/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/animations/lottie/src/main/java/com/guru/composecookbook/lottie/LottieCryptoLoadingView.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.lottie
2 |
3 | import android.content.Context
4 | import androidx.compose.foundation.layout.fillMaxWidth
5 | import androidx.compose.foundation.layout.height
6 | import androidx.compose.runtime.Composable
7 | import androidx.compose.ui.Modifier
8 | import androidx.compose.ui.unit.dp
9 |
10 | @Composable
11 | fun LottieCryptoLoadingView(context: Context) {
12 | LottieLoadingView(
13 | context = context,
14 | file = "cryptoload.json",
15 | modifier = Modifier
16 | .fillMaxWidth()
17 | .height(150.dp)
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/animations/lottie/src/main/java/com/guru/composecookbook/lottie/LottieFoodView.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.lottie
2 |
3 | import android.content.Context
4 | import androidx.compose.foundation.layout.fillMaxWidth
5 | import androidx.compose.foundation.layout.height
6 | import androidx.compose.runtime.Composable
7 | import androidx.compose.ui.Modifier
8 | import androidx.compose.ui.unit.dp
9 |
10 | @Composable
11 | fun LottieFoodView(context: Context) {
12 | LottieLoadingView(
13 | context = context,
14 | file = "food.json",
15 | modifier = Modifier
16 | .fillMaxWidth()
17 | .height(200.dp)
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/animations/lottie/src/main/java/com/guru/composecookbook/lottie/LottieLoaderLoadingView.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.lottie
2 |
3 | import android.content.Context
4 | import androidx.compose.foundation.layout.fillMaxWidth
5 | import androidx.compose.foundation.layout.height
6 | import androidx.compose.runtime.Composable
7 | import androidx.compose.ui.Modifier
8 | import androidx.compose.ui.unit.dp
9 |
10 | @Composable
11 | fun LottieLoaderLoadingView(context: Context) {
12 | LottieLoadingView(
13 | context = context,
14 | file = "loader.json",
15 | modifier = Modifier
16 | .fillMaxWidth()
17 | .height(200.dp)
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/animations/lottie/src/main/java/com/guru/composecookbook/lottie/LottieWorkingLoadingView.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.lottie
2 |
3 | import android.content.Context
4 | import androidx.compose.foundation.layout.fillMaxWidth
5 | import androidx.compose.foundation.layout.height
6 | import androidx.compose.runtime.Composable
7 | import androidx.compose.ui.Modifier
8 | import androidx.compose.ui.unit.dp
9 |
10 | @Composable
11 | fun LottieWorkingLoadingView(context: Context) {
12 | LottieLoadingView(
13 | context = context,
14 | file = "working.json",
15 | modifier = Modifier
16 | .fillMaxWidth()
17 | .height(250.dp)
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
17 | *.swp
18 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.kts.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging Box traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/assets/t1.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/assets/t1.mp4
--------------------------------------------------------------------------------
/app/src/main/assets/t2.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/assets/t2.mp4
--------------------------------------------------------------------------------
/app/src/main/assets/t3.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/assets/t3.mp4
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/App.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook
2 |
3 | import android.app.Application
4 | import android.content.Context
5 |
6 | class App : Application() {
7 |
8 | init {
9 | instance = requireNotNull(this)
10 | }
11 |
12 | companion object {
13 | private lateinit var instance: App
14 |
15 | fun applicationContext(): Context {
16 | return instance
17 | }
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/BottomNavType.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook
2 |
3 | enum class BottomNavType {
4 | HOME,
5 | WIDGETS,
6 | ANIMATION,
7 | DEMOUI,
8 | TEMPLATE
9 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/theme/AppThemeState.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.theme
2 |
3 | data class AppThemeState(
4 | var darkTheme: Boolean = false,
5 | var pallet: ColorPallet = ColorPallet.GREEN
6 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/home/customfling/FlingListViewTypes.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.home.customfling
2 |
3 | /**
4 | * @author https://github.com/iamjosephmj
5 | */
6 | enum class FlingListViewTypes(type: Int) {
7 | // Renders list with native scroll behaviour
8 | NATIVE(0),
9 |
10 | // Renders list with Smooth Scroll behaviour
11 | SMOOTH(1),
12 |
13 | // Custom values set by user.
14 | CUSTOM(2),
15 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/home/customfling/ListItemDivider.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.home.customfling
2 |
3 | import androidx.compose.foundation.layout.padding
4 | import androidx.compose.material.Divider
5 | import androidx.compose.material3.MaterialTheme
6 | import androidx.compose.runtime.Composable
7 | import androidx.compose.ui.Modifier
8 | import androidx.compose.ui.unit.dp
9 |
10 | /**
11 | * @author https://github.com/iamjosephmj
12 | */
13 | @Composable
14 | fun ListItemDivider() {
15 | Divider(
16 | modifier = Modifier.padding(horizontal = 12.dp, vertical = 12.dp),
17 | color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.08f)
18 | )
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/home/dialogs/DialogState.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.home.dialogs
2 |
3 | data class DialogState(var showDialog: Boolean, var dialogType: DialogType)
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/home/dialogs/DialogType.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.home.dialogs
2 |
3 | enum class DialogType {
4 | SIMPLE, TITLE, VERTICALBUTTON, IMAGE, LONGDIALOG, ROUNDED, DATEPICKER, TIMEPICKER
5 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/home/dynamic/DynamicUiType.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.home.dynamic
2 |
3 | enum class DynamicUiType {
4 | TABS,
5 | BOTTOMSHEET,
6 | LAYOUTS,
7 | CONSTRAINTLAYOUT,
8 | CAROUSELL,
9 | MODIFIERS,
10 | ANDROIDVIEWS,
11 | PULLRERESH,
12 | MOTIONLAYOUT
13 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/home/lists/ListViewType.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.home.lists
2 |
3 | enum class ListViewType(string: String) {
4 | VERTICAL("Vertical"),
5 | HORIZONTAL("Horizontal"),
6 | GRID("Grid"),
7 | MIX("Vertical+Horizontal")
8 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/home/timer/TimerViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.home.timer
2 |
3 | import androidx.lifecycle.ViewModel
4 | import androidx.lifecycle.viewModelScope
5 | import kotlinx.coroutines.delay
6 | import kotlinx.coroutines.flow.MutableStateFlow
7 | import kotlinx.coroutines.flow.StateFlow
8 | import kotlinx.coroutines.launch
9 | import java.util.*
10 |
11 | class TimerViewModel : ViewModel() {
12 |
13 | private val todayMax = Calendar.getInstance().apply {
14 | set(Calendar.HOUR_OF_DAY, 23)
15 | set(Calendar.MINUTE, 59)
16 | set(Calendar.SECOND, 59)
17 | }.timeInMillis
18 |
19 | private val _timerState = MutableStateFlow(
20 | TimerData(todayMax.minus(Calendar.getInstance().timeInMillis))
21 | )
22 | val timerState: StateFlow = _timerState
23 |
24 | init {
25 | initTimer()
26 | }
27 |
28 | private fun initTimer() {
29 | viewModelScope.launch {
30 | while (true) {
31 | val next = timerState.value.millis.minus(1000)
32 | _timerState.emit(timerState.value.copy(millis = next))
33 | delay(1000L)
34 | }
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/learnwidgets/Loaders.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.learnwidgets
2 |
3 | import androidx.compose.foundation.layout.Column
4 | import androidx.compose.foundation.layout.Row
5 | import androidx.compose.foundation.layout.fillMaxWidth
6 | import androidx.compose.foundation.layout.padding
7 | import androidx.compose.material.CircularProgressIndicator
8 | import androidx.compose.material.LinearProgressIndicator
9 | import androidx.compose.material3.Text
10 | import androidx.compose.runtime.Composable
11 | import androidx.compose.ui.Alignment
12 | import androidx.compose.ui.Modifier
13 | import androidx.compose.ui.unit.dp
14 | import com.guru.composecookbook.theme.typography
15 |
16 | @Composable
17 | fun Loaders() {
18 | Text(text = "Progress bars", style = typography.h6, modifier = Modifier.padding(8.dp))
19 |
20 | Row(modifier = Modifier.padding(8.dp)) {
21 | LinearProgressIndicator()
22 | CircularProgressIndicator()
23 | CircularProgressIndicator(strokeWidth = 8.dp)
24 | }
25 |
26 | Column(
27 | modifier = Modifier
28 | .fillMaxWidth()
29 | .padding(16.dp),
30 | horizontalAlignment = Alignment.CenterHorizontally
31 | ) {
32 | LinearProgressIndicator()
33 | Text(text = "Loading with text...", modifier = Modifier.padding(8.dp))
34 | }
35 |
36 |
37 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/utils/Extentions.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.utils
2 |
3 | fun Boolean?.orFalse(): Boolean = this ?: false
4 |
--------------------------------------------------------------------------------
/app/src/main/java/com/guru/composecookbook/ui/utils/FloatUtil.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.ui.utils
2 |
3 | import android.text.TextUtils
4 |
5 | /**
6 | * This is a util class that is created to help the editTexts to convert string values into float.
7 | */
8 | fun String.toFloatNum(): Float {
9 | return if (isNotEmpty() && length == 1 &&
10 | TextUtils.equals(get(0).toString(), ".")
11 | ) {
12 | "0.".toFloat()
13 | } else if (isEmpty()) {
14 | "0".toFloat()
15 | } else {
16 | toFloat()
17 | }
18 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/heart_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/drawable/heart_grey.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/heart_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/drawable/heart_red.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_access_time_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | google()
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath("com.android.tools.build:gradle:7.2.2")
9 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
10 | }
11 | }
12 |
13 | allprojects {
14 | repositories {
15 | mavenCentral()
16 | google()
17 | maven(url = "https://jitpack.io")
18 | jcenter()
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/buildSrc/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | `kotlin-dsl`
3 | `kotlin-dsl-precompiled-script-plugins`
4 | }
5 |
6 | sourceSets {
7 | main {
8 | java {
9 | setSrcDirs(listOf("src"))
10 | }
11 | }
12 | }
13 |
14 | buildscript {
15 |
16 | repositories {
17 | mavenLocal()
18 | mavenCentral()
19 | google()
20 | }
21 |
22 | dependencies {
23 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
24 | }
25 | }
26 |
27 |
28 | repositories {
29 | mavenLocal()
30 | mavenCentral()
31 | google()
32 | }
33 |
34 | dependencies {
35 | // in order to be able to use "kotlin-android" in the common script
36 | implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
37 |
38 | // in order to recognize the "plugins" block in the common script
39 | implementation("com.android.tools.build:gradle:7.2.2")
40 |
41 | // in order to recognize the "android" block in the common script
42 | implementation("com.android.tools.build:gradle-api:7.2.2")
43 | }
44 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/com/guru/composecookbook/build/configurations/ProjectConfigs.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.build.configurations
2 |
3 | import com.guru.composecookbook.build.dependencies.Versions
4 |
5 | object ProjectConfigs {
6 | const val compileSdkVersion = 33
7 | const val minSdkVersion = 25
8 | const val targetSdkVersion = 30
9 | const val applicationId = "com.guru.composecookbook"
10 | const val kotlinCompilerExtensionVersion = Versions.composeCompiler
11 | }
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/common-compose-module-configs-script-plugin.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.configurations.ProjectConfigs
2 |
3 | plugins {
4 | id("com.android.library")
5 | id("kotlin-android")
6 | }
7 |
8 | android {
9 | compileSdk = ProjectConfigs.compileSdkVersion
10 |
11 | defaultConfig {
12 | minSdk = ProjectConfigs.minSdkVersion
13 | targetSdk = ProjectConfigs.targetSdkVersion
14 | }
15 |
16 | compileOptions {
17 | sourceCompatibility = JavaVersion.VERSION_1_8
18 | targetCompatibility = JavaVersion.VERSION_1_8
19 | }
20 | kotlinOptions {
21 | jvmTarget = "1.8"
22 | freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn"
23 | }
24 | buildFeatures {
25 | compose = true
26 | }
27 | composeOptions {
28 | kotlinCompilerExtensionVersion = ProjectConfigs.kotlinCompilerExtensionVersion
29 | }
30 | dexOptions {
31 | javaMaxHeapSize = "4G"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/common-kotlin-module-configs-script-plugin.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.configurations.ProjectConfigs
2 |
3 | plugins {
4 | id("com.android.library")
5 | id("kotlin-android")
6 | id("kotlin-kapt")
7 | }
8 |
9 | android {
10 | compileSdk = ProjectConfigs.compileSdkVersion
11 |
12 | defaultConfig {
13 | minSdk = ProjectConfigs.minSdkVersion
14 | targetSdk = ProjectConfigs.targetSdkVersion
15 | }
16 |
17 | compileOptions {
18 | sourceCompatibility = JavaVersion.VERSION_1_8
19 | targetCompatibility = JavaVersion.VERSION_1_8
20 | }
21 | kotlinOptions {
22 | jvmTarget = "1.8"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/components/carousel/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/components/carousel/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":theme"))
12 | implementation(project(":data"))
13 |
14 | addComposeOfficialDependencies()
15 | }
16 |
--------------------------------------------------------------------------------
/components/carousel/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/components/carousel/src/main/java/com/guru/composecookbook/carousel/PageData.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.carousel
2 |
3 | import androidx.compose.runtime.Immutable
4 | import androidx.compose.ui.layout.ParentDataModifier
5 | import androidx.compose.ui.unit.Density
6 |
7 | @Immutable
8 | internal data class PageData(val page: Int) : ParentDataModifier {
9 | override fun Density.modifyParentData(parentData: Any?): Any = this@PageData
10 | }
--------------------------------------------------------------------------------
/components/carousel/src/main/java/com/guru/composecookbook/carousel/SelectionState.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.carousel
2 |
3 | enum class SelectionState {
4 | Selected,
5 | Undecided
6 | }
7 |
--------------------------------------------------------------------------------
/components/charts/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/components/charts/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":theme"))
13 |
14 | addComposeOfficialDependencies()
15 | addCoreAndroidUiDependencies()
16 | }
--------------------------------------------------------------------------------
/components/charts/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/components/colorpicker/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/components/colorpicker/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":theme"))
12 |
13 | addComposeOfficialDependencies()
14 | }
15 |
--------------------------------------------------------------------------------
/components/colorpicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/components/comingsoon/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/components/comingsoon/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":animations:lottie"))
12 | implementation(project(":theme"))
13 |
14 | addComposeOfficialDependencies()
15 | }
16 |
--------------------------------------------------------------------------------
/components/comingsoon/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/components/fab/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/components/fab/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | addComposeOfficialDependencies()
12 | }
13 |
--------------------------------------------------------------------------------
/components/fab/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/components/tags/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/components/tags/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":theme"))
12 |
13 | addComposeOfficialDependencies()
14 | }
15 |
--------------------------------------------------------------------------------
/components/tags/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/components/verticalgrid/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/components/verticalgrid/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | addComposeOfficialDependencies()
12 | }
13 |
--------------------------------------------------------------------------------
/components/verticalgrid/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/data/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/data/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | /**
3 | * See [common-kotlin-module-configs-script-plugin.gradle.kts] file
4 | */
5 | id("common-kotlin-module-configs-script-plugin")
6 | }
7 |
--------------------------------------------------------------------------------
/data/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/data/src/main/java/com/guru/composecookbook/data/model/Album.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.data.model
2 |
3 | import java.io.Serializable
4 |
5 | data class Album(
6 | val id: Int,
7 | val genre: String = "Pop",
8 | val artist: String,
9 | val song: String,
10 | val descriptions: String,
11 | val imageId: Int,
12 | val swiped: Boolean = false
13 | ) : Serializable
--------------------------------------------------------------------------------
/data/src/main/java/com/guru/composecookbook/data/model/Item.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.data.model
2 |
3 | data class Item(
4 | val id: Int,
5 | val title: String,
6 | val subtitle: String,
7 | val imageId: Int,
8 | val source: String = "demo source"
9 | )
--------------------------------------------------------------------------------
/data/src/main/java/com/guru/composecookbook/data/model/Tweet.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.data.model
2 |
3 | data class Tweet(
4 | val id: Int,
5 | val text: String,
6 | val author: String,
7 | val handle: String,
8 | val time: String,
9 | val authorImageId: Int,
10 | val likesCount: Int,
11 | val commentsCount: Int,
12 | val retweetCount: Int,
13 | val source: String,
14 | val tweetImageId: Int = 0
15 | )
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/adele.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/adele.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/adele21.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/adele21.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/billie.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/billie.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/bp.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/bp.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/camelia.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/camelia.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/dancemonkey.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/dancemonkey.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/dualipa.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/dualipa.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/ed2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/ed2.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/edsheeran.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/edsheeran.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/eminem.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/eminem.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food1.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food10.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food11.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food11.webp
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food12.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food12.webp
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food13.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food13.webp
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food14.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food15.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food15.webp
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food16.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food2.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food3.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food4.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food5.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food5.webp
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food6.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food7.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food7.webp
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food8.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food8.webp
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/food9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/food9.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/imagindragon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/imagindragon.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/james.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/james.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/katy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/katy.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/khalid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/khalid.png
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/lana.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/lana.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/marsh.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/marsh.jpg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p1.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p10.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p10.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p11.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p11.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p2.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p3.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p4.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p5.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p6.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p6.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p7.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p7.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p8.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p8.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/p9.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/p9.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/sam.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/sam.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/shawn.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/shawn.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/tylor.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/tylor.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/weekend.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/weekend.jpeg
--------------------------------------------------------------------------------
/data/src/main/res/drawable-nodpi/wolves.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/data/src/main/res/drawable-nodpi/wolves.jpg
--------------------------------------------------------------------------------
/demos/betty/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/demos/betty/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /src/main/java/com/adwi/betty/util/ApiKey.kt
--------------------------------------------------------------------------------
/demos/betty/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/demos/betty/app/src/androidTest/java/com/adwi/betty/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.adwi.betty", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/BettyApp.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty
2 |
3 | import android.app.Application
4 | import android.os.Build
5 | import android.util.Log
6 | import androidx.annotation.RequiresApi
7 | import androidx.compose.animation.ExperimentalAnimationApi
8 | import androidx.compose.foundation.ExperimentalFoundationApi
9 | import androidx.compose.material.ExperimentalMaterialApi
10 | import androidx.hilt.work.HiltWorkerFactory
11 | import androidx.work.Configuration
12 | import dagger.hilt.android.HiltAndroidApp
13 | import javax.inject.Inject
14 |
15 | @OptIn(ExperimentalFoundationApi::class)
16 | @OptIn(ExperimentalMaterialApi::class)
17 | @OptIn(ExperimentalAnimationApi::class)
18 | @RequiresApi(Build.VERSION_CODES.M)
19 | @HiltAndroidApp
20 | class BettyApp : Application(), Configuration.Provider {
21 |
22 | @Inject
23 | lateinit var workerFactory: HiltWorkerFactory
24 |
25 | override fun getWorkManagerConfiguration() =
26 | Configuration.Builder()
27 | .setWorkerFactory(workerFactory)
28 | .setMinimumLoggingLevel(Log.DEBUG)
29 | .build()
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/data/local/BettyDatabase.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.data.local
2 |
3 |
4 | import androidx.room.Database
5 | import androidx.room.RoomDatabase
6 | import com.adwi.betty.data.local.dao.OddsDao
7 | import com.adwi.betty.data.local.entity.Odd
8 |
9 | @Database(
10 | entities = [
11 | Odd::class
12 | ],
13 | version = 1,
14 | exportSchema = false
15 | )
16 | abstract class BettyDatabase : RoomDatabase() {
17 |
18 | abstract fun oddsDao(): OddsDao
19 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/data/local/dao/OddsDao.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.data.local.dao
2 |
3 | import androidx.room.*
4 | import com.adwi.betty.data.local.entity.Odd
5 | import kotlinx.coroutines.flow.Flow
6 |
7 | @Dao
8 | interface OddsDao {
9 |
10 | @Insert(onConflict = OnConflictStrategy.REPLACE)
11 | suspend fun insertOdds(odds: List)
12 |
13 | @Query("SELECT * FROM odd_table ORDER BY difference DESC")
14 | fun getAllOdds(): Flow>
15 |
16 | @Update
17 | suspend fun updateOdd(odd: Odd)
18 |
19 | @Query("DELETE FROM odd_table")
20 | suspend fun deleteAllOdds()
21 |
22 | @Query("DELETE FROM odd_table WHERE commenceTime < :timestampInMillis AND hasBetOn = 0")
23 | suspend fun deleteOddsWithNoBetsOlderThan(timestampInMillis: Long)
24 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/data/remote/dto/MatchDto.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.data.remote.dto
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class MatchDto(
6 | @SerializedName("id") val id: String,
7 | @SerializedName("sport_key") val sportKey: String,
8 | @SerializedName("sport_title") val sportName: String,
9 | @SerializedName("commence_time") val commenceTime: String,
10 | @SerializedName("home_team") val homeTeam: String?,
11 | @SerializedName("away_team") val awayTeam: String?,
12 | @SerializedName("bookmakers") val bookmakers: List
13 | )
14 |
15 | data class BookmakerDto(
16 | @SerializedName("key") var key: String,
17 | @SerializedName("title") var title: String,
18 | @SerializedName("last_update") var lastUpdate: String,
19 | @SerializedName("markets") var markets: List
20 | )
21 |
22 | data class MarketDto(
23 | @SerializedName("key") var key: String,
24 | @SerializedName("outcomes") var outcomes: List
25 | )
26 |
27 | data class OutcomeDto(
28 | @SerializedName("name") var name: String,
29 | @SerializedName("price") var price: Double
30 | )
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/data/remote/dto/SportKey.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.data.remote.dto
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class SportKeyDto(
6 | val key: String,
7 | val group: String,
8 | val title: String,
9 | val description: String,
10 | val active: Boolean = true,
11 | @SerializedName("has_outrights")
12 | val hasOutright: Boolean = false
13 | )
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/data/repository/OddsRepositoryInterface.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.data.repository
2 |
3 | import com.adwi.betty.data.local.entity.Odd
4 | import com.adwi.betty.ui.main.Range
5 | import kotlinx.coroutines.flow.Flow
6 |
7 | interface OddsRepositoryInterface {
8 |
9 | suspend fun fetchOddsRemote(sportKey: String)
10 |
11 | fun getOddsLocal(): Flow>
12 |
13 | suspend fun updateOdd(odd: Odd)
14 |
15 | suspend fun deleteAllOdds()
16 | suspend fun deleteOddsOlderThan(timeMillis: Long)
17 |
18 | fun workoutDifference(teamA: Double, teamB: Double): Double
19 | fun setRangeFromDifference(difference: Double): Range
20 | fun isItGoodOdd(odd: Odd): Boolean
21 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/di/AppModule.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.di
2 |
3 | import android.content.Context
4 | import androidx.compose.animation.ExperimentalAnimationApi
5 | import androidx.compose.foundation.ExperimentalFoundationApi
6 | import androidx.compose.material.ExperimentalMaterialApi
7 | import com.adwi.betty.util.NotificationUtil
8 | import dagger.Module
9 | import dagger.Provides
10 | import dagger.hilt.InstallIn
11 | import dagger.hilt.android.qualifiers.ApplicationContext
12 | import dagger.hilt.components.SingletonComponent
13 | import javax.inject.Singleton
14 |
15 | @InstallIn(SingletonComponent::class)
16 | @Module
17 | class AppModule {
18 |
19 | @OptIn(ExperimentalAnimationApi::class)
20 | @OptIn(ExperimentalMaterialApi::class)
21 | @OptIn(ExperimentalFoundationApi::class)
22 | @Singleton
23 | @Provides
24 | fun provideNotificationTools(
25 | @ApplicationContext context: Context
26 | ) = NotificationUtil(context)
27 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/di/DispatcherModule.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.di
2 |
3 | import dagger.Module
4 | import dagger.Provides
5 | import dagger.hilt.InstallIn
6 | import dagger.hilt.android.components.ViewModelComponent
7 | import kotlinx.coroutines.CoroutineDispatcher
8 | import kotlinx.coroutines.Dispatchers
9 | import javax.inject.Qualifier
10 |
11 | @Module
12 | @InstallIn(ViewModelComponent::class)
13 | object DispatcherModule {
14 |
15 | @DefaultDispatcher
16 | @Provides
17 | fun providesDefaultDispatcher(): CoroutineDispatcher = Dispatchers.Default
18 |
19 | @IoDispatcher
20 | @Provides
21 | fun providesIoDispatcher(): CoroutineDispatcher = Dispatchers.IO
22 |
23 | @MainDispatcher
24 | @Provides
25 | fun providesMainDispatcher(): CoroutineDispatcher = Dispatchers.Main
26 | }
27 |
28 | @Retention(AnnotationRetention.BINARY)
29 | @Qualifier
30 | annotation class DefaultDispatcher
31 |
32 | @Retention(AnnotationRetention.BINARY)
33 | @Qualifier
34 | annotation class IoDispatcher
35 |
36 | @Retention(AnnotationRetention.BINARY)
37 | @Qualifier
38 | annotation class MainDispatcher
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/di/LocalModule.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.di
2 |
3 | import android.app.Application
4 | import androidx.room.Room
5 | import com.adwi.betty.data.local.BettyDatabase
6 | import com.adwi.betty.util.Constants.Companion.BETTY_DATABASE
7 | import dagger.Module
8 | import dagger.Provides
9 | import dagger.hilt.InstallIn
10 | import dagger.hilt.components.SingletonComponent
11 | import javax.inject.Singleton
12 |
13 | @Module
14 | @InstallIn(SingletonComponent::class)
15 | object LocalModule {
16 |
17 | @Provides
18 | @Singleton
19 | fun provideAppDatabase(application: Application) =
20 | Room
21 | .databaseBuilder(
22 | application,
23 | BettyDatabase::class.java,
24 | BETTY_DATABASE
25 | )
26 | .fallbackToDestructiveMigration()
27 | .build()
28 |
29 | @Provides
30 | @Singleton
31 | fun provideOdsDao(appDatabase: BettyDatabase) =
32 | appDatabase.oddsDao()
33 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/di/ViewModelModule.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.di
2 |
3 | import com.adwi.betty.data.local.BettyDatabase
4 | import com.adwi.betty.data.remote.OddsApi
5 | import com.adwi.betty.data.repository.OddsRepository
6 | import com.adwi.betty.data.repository.OddsRepositoryInterface
7 | import dagger.Module
8 | import dagger.Provides
9 | import dagger.hilt.InstallIn
10 | import dagger.hilt.android.components.ViewModelComponent
11 | import dagger.hilt.android.scopes.ViewModelScoped
12 | import kotlinx.coroutines.CoroutineDispatcher
13 |
14 | @Module
15 | @InstallIn(ViewModelComponent::class)
16 | object ViewModelModule {
17 |
18 | @Provides
19 | @ViewModelScoped
20 | fun provideSettingsRepository(
21 | api: OddsApi,
22 | database: BettyDatabase
23 | ) = OddsRepository(api, database) as OddsRepositoryInterface
24 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/ui/base/BaseViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.ui.base
2 |
3 | import androidx.lifecycle.ViewModel
4 | import kotlinx.coroutines.flow.MutableStateFlow
5 |
6 | abstract class BaseViewModel : ViewModel() {
7 |
8 | val TAG: String = javaClass.simpleName
9 |
10 | val snackBarMessage = MutableStateFlow("")
11 | val toastMessage = MutableStateFlow("")
12 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/ui/components/AnimatedView.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.ui.components
2 |
3 | import androidx.compose.foundation.layout.padding
4 | import androidx.compose.runtime.Composable
5 | import androidx.compose.runtime.getValue
6 | import androidx.compose.ui.Modifier
7 | import androidx.compose.ui.layout.ContentScale
8 | import androidx.compose.ui.unit.dp
9 | import com.airbnb.lottie.compose.*
10 |
11 | @Composable
12 | fun AnimatedView(resource: Int, modifier: Modifier) {
13 | val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(resource))
14 | val progress by animateLottieCompositionAsState(
15 | composition,
16 | iterations = LottieConstants.IterateForever
17 | )
18 | LottieAnimation(
19 | composition = composition, progress = progress, modifier = modifier.padding(80.dp), contentScale = ContentScale.Fit
20 | )
21 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/ui/home/Home.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.ui.home
2 |
3 | import androidx.compose.animation.ExperimentalAnimationApi
4 | import androidx.compose.foundation.ExperimentalFoundationApi
5 | import androidx.compose.foundation.layout.fillMaxSize
6 | import androidx.compose.material.ExperimentalMaterialApi
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.runtime.collectAsState
9 | import androidx.compose.runtime.getValue
10 | import androidx.compose.ui.Modifier
11 | import com.adwi.betty.ui.components.BettyOddList
12 | import com.adwi.betty.ui.components.BettyScaffold
13 | import com.adwi.betty.ui.main.MainViewModel
14 |
15 | @OptIn(ExperimentalAnimationApi::class)
16 | @OptIn(ExperimentalFoundationApi::class)
17 | @OptIn(ExperimentalMaterialApi::class)
18 | @Composable
19 | fun HomeScreen(
20 | viewModel: MainViewModel
21 | ) {
22 | val odds by viewModel.odds.collectAsState()
23 | val progress by viewModel.progress.collectAsState()
24 |
25 | BettyScaffold(
26 | viewModel = viewModel
27 | ) {
28 | BettyOddList(
29 | progress = progress,
30 | onRefresh = { viewModel.onManualRefresh() },
31 | list = odds,
32 | modifier = Modifier.fillMaxSize()
33 | )
34 | }
35 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.ui.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val Purple200 = Color(0xFFBB86FC)
6 | val Purple500 = Color(0xFF6200EE)
7 | val Purple700 = Color(0xFF3700B3)
8 | val Teal200 = Color(0xFF03DAC5)
9 | val LightGray = Color(0xFFE6E6E6)
10 | val MediumGray = Color(0xFF8D8D8D)
11 | val DarkGray = Color(0xFF464646)
12 |
13 | // Ranges
14 | val LowRange = Color(0xFFFFE252)
15 | val MediumRange = Color(0xFFFCAF3D)
16 | val HighRange = Color(0xFFFF5656)
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/ui/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.ui.theme
2 |
3 | import androidx.compose.foundation.shape.RoundedCornerShape
4 | import androidx.compose.material.Shapes
5 | import androidx.compose.ui.unit.dp
6 |
7 | val Shapes = Shapes(
8 | small = RoundedCornerShape(4.dp),
9 | medium = RoundedCornerShape(4.dp),
10 | large = RoundedCornerShape(0.dp)
11 | )
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/ui/theme/Type.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.ui.theme
2 |
3 | import androidx.compose.material.Typography
4 | import androidx.compose.ui.text.TextStyle
5 | import androidx.compose.ui.text.font.FontFamily
6 | import androidx.compose.ui.text.font.FontWeight
7 | import androidx.compose.ui.unit.sp
8 |
9 | // Set of Material typography styles to start with
10 | val Typography = Typography(
11 | body1 = TextStyle(
12 | fontFamily = FontFamily.Default,
13 | fontWeight = FontWeight.Normal,
14 | fontSize = 16.sp
15 | )
16 | /* Other default text styles to override
17 | button = TextStyle(
18 | fontFamily = FontFamily.Default,
19 | fontWeight = FontWeight.W500,
20 | fontSize = 14.sp
21 | ),
22 | caption = TextStyle(
23 | fontFamily = FontFamily.Default,
24 | fontWeight = FontWeight.Normal,
25 | fontSize = 12.sp
26 | )
27 | */
28 | )
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/util/Constants.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.util
2 |
3 | import com.adwi.betty.BuildConfig
4 |
5 |
6 | class Constants {
7 | companion object {
8 |
9 |
10 | const val BASE_URL = "https://api.the-odds-api.com/"
11 | const val API_KEY = BuildConfig.BETTY_API_KEY
12 | const val BETTY_DATABASE = "wallpaper_database"
13 |
14 | const val MIN_ODD_DIFFERENCE = 3.0
15 |
16 | const val DEFAULT_BOOKMAKER = "William Hill"
17 | }
18 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/util/Extensions.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.util
2 |
3 | import android.app.Activity
4 | import android.content.Context
5 | import android.view.View
6 | import android.widget.Toast
7 | import androidx.appcompat.app.AppCompatActivity
8 | import androidx.core.app.ActivityCompat
9 | import androidx.fragment.app.Fragment
10 | import androidx.lifecycle.ViewModel
11 | import androidx.lifecycle.lifecycleScope
12 | import androidx.lifecycle.viewModelScope
13 | import com.google.android.material.snackbar.Snackbar
14 | import kotlinx.coroutines.CoroutineDispatcher
15 | import kotlinx.coroutines.Job
16 | import kotlinx.coroutines.launch
17 | import kotlin.math.round
18 |
19 |
20 | val T.exhaustive: T
21 | get() = this
22 |
23 | fun concatenate(vararg lists: List): List {
24 | return listOf(*lists).flatten()
25 | }
26 |
27 | fun Double.round(decimals: Int): Double {
28 | var multiplier = 1.0
29 | repeat(decimals) { multiplier *= 10 }
30 | return round(this * multiplier) / multiplier
31 | }
32 |
33 | fun AppCompatActivity.launchCoroutine(body: suspend () -> Unit): Job {
34 | return lifecycleScope.launchWhenStarted {
35 | body()
36 | }
37 | }
38 |
39 | fun ViewModel.onDispatcher(dispatcher: CoroutineDispatcher, body: suspend () -> Unit): Job {
40 | return viewModelScope.launch(dispatcher) {
41 | body()
42 | }
43 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/util/ModifierExtensions.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.util
2 |
3 | import androidx.compose.runtime.Stable
4 | import androidx.compose.ui.Modifier
5 | import androidx.compose.ui.draw.alpha
6 |
7 | @Stable
8 | fun Modifier.visible(visibility: Boolean): Modifier {
9 | return if (visibility) {
10 | this.then(alpha(1f))
11 | } else {
12 | this.then(alpha(0f))
13 | }
14 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/java/com/adwi/betty/util/Resource.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.util
2 |
3 | sealed class Resource(
4 | val data: T? = null,
5 | val error: Throwable? = null
6 | ) {
7 | class Success(data: T) : Resource(data)
8 | class Loading(data: T? = null) : Resource(data)
9 | class Error(throwable: Throwable, data: T? = null) : Resource(data, throwable)
10 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/drawable/ic_fire_animated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/drawable/ic_fire_animated.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/drawable/ic_refresh.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #5867AB
4 |
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Betty
3 |
4 |
5 | Could not refresh: %s
6 | An unknown error occurred
7 | Betty downloaded some new ods for you. Have a look!
8 |
9 |
--------------------------------------------------------------------------------
/demos/betty/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/demos/betty/app/src/test/java/com/adwi/betty/TestCoroutineRule.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty
2 |
3 | import kotlinx.coroutines.Dispatchers
4 | import kotlinx.coroutines.ExperimentalCoroutinesApi
5 | import kotlinx.coroutines.test.TestCoroutineDispatcher
6 | import kotlinx.coroutines.test.resetMain
7 | import kotlinx.coroutines.test.setMain
8 | import org.junit.rules.TestWatcher
9 | import org.junit.runner.Description
10 |
11 | @OptIn(ExperimentalCoroutinesApi::class)
12 | class MainCoroutineRule(
13 | val testDispatcher: TestCoroutineDispatcher = TestCoroutineDispatcher()
14 | ) : TestWatcher() {
15 |
16 | override fun starting(description: Description?) {
17 | super.starting(description)
18 | Dispatchers.setMain(testDispatcher)
19 | }
20 |
21 | override fun finished(description: Description?) {
22 | super.finished(description)
23 | Dispatchers.resetMain()
24 | testDispatcher.cleanupTestCoroutines()
25 | }
26 | }
--------------------------------------------------------------------------------
/demos/betty/app/src/test/java/com/adwi/betty/ui/main/MainViewModelTest.kt:
--------------------------------------------------------------------------------
1 | package com.adwi.betty.ui.main
2 |
3 | import com.adwi.betty.MainCoroutineRule
4 | import com.adwi.betty.fake.FakeRepository
5 | import com.google.common.truth.Truth.assertThat
6 | import kotlinx.coroutines.ExperimentalCoroutinesApi
7 | import kotlinx.coroutines.test.TestCoroutineDispatcher
8 | import org.junit.Rule
9 | import org.junit.Test
10 |
11 | @OptIn(ExperimentalCoroutinesApi::class)
12 | class MainViewModelTest {
13 |
14 | private val testDispatcher = TestCoroutineDispatcher()
15 |
16 | @get:Rule
17 | val rule = MainCoroutineRule()
18 |
19 | @Test
20 | fun `check progress set return true`() {
21 |
22 | val viewModel = MainViewModel(FakeRepository(), testDispatcher)
23 |
24 | viewModel.setProgress(1)
25 |
26 | assertThat(viewModel.progress.value).isNotNull()
27 | }
28 | }
--------------------------------------------------------------------------------
/demos/betty/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ext {
4 | compose_version = '1.0.2'
5 | orchestraVersion = '1.0.6'
6 | accompanistVersion = '0.12.0'
7 | landscapistVersion = '1.2.3'
8 | coil_version = "0.11.0"
9 | hiltComposeNavigation= '1.0.0-alpha03'
10 | }
11 | repositories {
12 | mavenCentral()
13 | google()
14 | maven { url 'https://jitpack.io' }
15 | }
16 | dependencies {
17 | classpath "com.android.tools.build:gradle:7.2.2"
18 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
19 | classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
20 |
21 | // NOTE: Do not place your application dependencies here; they belong
22 | // in the individual module build.gradle files
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
--------------------------------------------------------------------------------
/demos/betty/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/demos/betty/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/demos/betty/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Sep 14 12:50:30 BST 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/demos/betty/screenshots/betty.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/betty/screenshots/betty.gif
--------------------------------------------------------------------------------
/demos/betty/settings.gradle:
--------------------------------------------------------------------------------
1 | dependencyResolutionManagement {
2 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
3 | repositories {
4 | google()
5 | mavenCentral()
6 | jcenter() // Warning: this repository is going to shut down soon
7 | }
8 | }
9 | rootProject.name = "Betty"
10 | include ':app'
11 |
--------------------------------------------------------------------------------
/demos/cryptoapp/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/cryptoapp/app/src/main/java/com/guru/composecookbook/cryptoapp/ui/detail/CryptoDetailViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.ui.detail
2 |
3 | import android.content.Context
4 | import androidx.lifecycle.ViewModel
5 | import androidx.lifecycle.ViewModelProvider
6 | import androidx.lifecycle.liveData
7 | import com.guru.composecookbook.cryptoapp.data.DemoDIGraph
8 | import com.guru.composecookbook.cryptoapp.data.repositories.CryptoRepository
9 | import kotlinx.coroutines.Dispatchers
10 |
11 | class CryptoDetailViewModelFactory(val context: Context) : ViewModelProvider.Factory {
12 | override fun create(modelClass: Class): T {
13 | return CryptoDetailViewModel(context) as T
14 | }
15 | }
16 |
17 | class CryptoDetailViewModel(context: Context) : ViewModel() {
18 | private val cryptoRepository: CryptoRepository = DemoDIGraph.createRepository(context)
19 |
20 | //live data to read room database
21 | val favCryptoLiveData = liveData(Dispatchers.IO) {
22 | emitSource(cryptoRepository.getFavourite())
23 | }
24 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/app/src/main/java/com/guru/composecookbook/cryptoapp/ui/internal/extensions/Extentions.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.ui.internal.extensions
2 |
3 | import java.text.DecimalFormat
4 |
5 | private val formatter2 = DecimalFormat("##.##")
6 | private val formatter3 = DecimalFormat("##.###")
7 | fun Double.roundToTwoDecimals() = formatter2.format(this).toString()
8 | fun Double.roundToThreeDecimals() = formatter3.format(this).toString()
--------------------------------------------------------------------------------
/demos/cryptoapp/app/src/main/java/com/guru/composecookbook/cryptoapp/ui/internal/theme/Colors.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.ui.internal.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 | import com.guru.composecookbook.theme.graySurface
5 |
6 | object Colors {
7 | fun cryptoSurfaceGradient(isDark: Boolean) =
8 | if (isDark) listOf(graySurface, Color.Black) else listOf(Color.White, Color.LightGray)
9 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/app/src/main/res/values-round/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Hello Round World!
3 |
--------------------------------------------------------------------------------
/demos/cryptoapp/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | CryptoHome
3 | CryptoDetail
4 | Back
5 | AndroidWearActivity
6 | Hello World!
7 |
11 |
12 |
--------------------------------------------------------------------------------
/demos/cryptoapp/data/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/cryptoapp/data/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addCoreAndroidDependencies
2 | import com.guru.composecookbook.build.dependencies.addDataDependencies
3 | import com.guru.composecookbook.build.dependencies.addNetworkingDependencies
4 |
5 | plugins {
6 | /**
7 | * See [common-kotlin-module-configs-script-plugin.gradle.kts] file
8 | */
9 | id("common-kotlin-module-configs-script-plugin")
10 | }
11 |
12 | dependencies {
13 | addCoreAndroidDependencies()
14 | addNetworkingDependencies()
15 | addDataDependencies()
16 | }
17 |
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/CryptoDemoDataProvider.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data
2 |
3 | import com.guru.composecookbook.cryptoapp.data.db.models.Crypto
4 |
5 | object CryptoDemoDataProvider {
6 |
7 | val bitcoin = Crypto(
8 | "BTC",
9 | 1025.43,
10 | "Bitcoin",
11 | "https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bitcoin.svg/128px-Bitcoin.svg.png",
12 | 12.1,
13 | 1.2,
14 | 1044.01,
15 | 1000.09,
16 | 1992922,
17 | 12223333.0,
18 | 120234333.99,
19 | emptyList()
20 | )
21 |
22 | val demoList = mutableListOf(bitcoin, bitcoin.copy(symbol = "ETH", name = "Ethereum"))
23 |
24 |
25 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/api/CryptoApi.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.api
2 |
3 | import com.guru.composecookbook.cryptoapp.data.api.models.CryptoApiResponse
4 | import com.guru.composecookbook.cryptoapp.data.api.models.CryptoDetailResponse
5 | import retrofit2.Response
6 | import retrofit2.http.GET
7 | import retrofit2.http.Path
8 | import retrofit2.http.Query
9 |
10 | interface CryptoApi {
11 |
12 | @GET("coins/markets?vs_currency=usd&order=market_cap_desc&sparkline=true")
13 | suspend fun getAllCrypto(
14 | @Query("page") page: Int = 1,
15 | @Query("per_page") pageSize: Int = 20
16 | ): Response>
17 |
18 | @GET("coins/{ticker}")
19 | suspend fun getCryptoDetail(@Path("ticker") ticker: String): Response
20 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/api/CryptoApiMapper.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.api
2 |
3 | import com.guru.composecookbook.cryptoapp.data.api.models.CryptoApiResponse
4 | import com.guru.composecookbook.cryptoapp.data.db.models.Crypto
5 |
6 | class CryptoApiMapper {
7 | fun map(cryptoApiResponse: CryptoApiResponse) = Crypto(
8 | name = cryptoApiResponse.name,
9 | symbol = cryptoApiResponse.symbol,
10 | price = cryptoApiResponse.current_price,
11 | image = cryptoApiResponse.image,
12 | dailyChange = cryptoApiResponse.price_change_24h,
13 | dailyChangePercentage = cryptoApiResponse.price_change_percentage_24h,
14 | high = cryptoApiResponse.high_24h,
15 | low = cryptoApiResponse.low_24h,
16 | volume = cryptoApiResponse.total_volume,
17 | supply = cryptoApiResponse.total_supply,
18 | marketCap = cryptoApiResponse.market_cap,
19 | chartData = cryptoApiResponse.sparkline_in_7d.price
20 | )
21 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/api/models/CryptoApiResponse.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.api.models
2 |
3 | data class CryptoApiResponse(
4 | val id: String,
5 | val symbol: String,
6 | val name: String,
7 | val image: String,
8 | val current_price: Double,
9 | val market_cap: Long,
10 | val total_volume: Double,
11 | val high_24h: Double,
12 | val low_24h: Double,
13 | val price_change_24h: Double,
14 | val price_change_percentage_24h: Double,
15 | val total_supply: Double,
16 | val sparkline_in_7d: SparkLineData
17 | )
18 |
19 | data class SparkLineData(val price: List)
20 |
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/api/models/CryptoDetailResponse.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.api.models
2 |
3 | data class CryptoDetailResponse(
4 | val id: String,
5 | val symbol: String,
6 | val name: String,
7 | val image: String,
8 | val current_price: Double,
9 | val market_cap: Double,
10 | val total_volume: Double,
11 | val high_24h: Double,
12 | val low_24h: Double,
13 | val price_change_24h: Double,
14 | val price_change_percentage_24h: Double,
15 | )
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/db/CryptoDatabase.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.db
2 |
3 | import android.content.Context
4 | import androidx.room.Database
5 | import androidx.room.Room
6 | import androidx.room.RoomDatabase
7 | import androidx.room.TypeConverters
8 | import com.guru.composecookbook.cryptoapp.data.db.daos.CryptoDao
9 | import com.guru.composecookbook.cryptoapp.data.db.models.Crypto
10 |
11 | @Database(entities = [Crypto::class], version = 4, exportSchema = false)
12 | @TypeConverters(ListTypeConverter::class)
13 | abstract class CryptoDatabase : RoomDatabase() {
14 | abstract fun cryptoDao(): CryptoDao
15 |
16 | companion object {
17 | private var instance: CryptoDatabase? = null
18 | private val LOCK = Any()
19 |
20 | fun getInstance(context: Context) = instance ?: synchronized(LOCK) {
21 | instance ?: buildDatabase(context.applicationContext).also { instance = it }
22 | }
23 |
24 | private fun buildDatabase(context: Context) =
25 | Room.databaseBuilder(
26 | context.applicationContext,
27 | CryptoDatabase::class.java, "crypto.db"
28 | ).build()
29 | }
30 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/db/ListTypeConverter.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.db
2 |
3 | import androidx.room.TypeConverter
4 |
5 | class ListTypeConverter {
6 | companion object {
7 | @TypeConverter
8 | @JvmStatic
9 | fun gettingFloatListFromString(floatList: String?): List? {
10 | val list = arrayListOf()
11 |
12 | val array =
13 | floatList?.split(",".toRegex())?.dropLastWhile { it.isEmpty() }?.toTypedArray()
14 | if (array.isNullOrEmpty()) {
15 | return null
16 | }
17 | for (s in array) {
18 | if (s.isNotEmpty()) {
19 | list.add(s.toFloat())
20 | }
21 | }
22 | return list
23 | }
24 |
25 | @TypeConverter
26 | @JvmStatic
27 | fun writingStringFromFloatList(list: List?): String? {
28 | var genreIds = ""
29 | if (genreIds.isEmpty()) {
30 | return null
31 | } else {
32 | for (i in list!!) {
33 | genreIds += ",$i"
34 | }
35 | }
36 |
37 | return genreIds
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/db/daos/CryptoDao.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.db.daos
2 |
3 | import androidx.lifecycle.LiveData
4 | import androidx.room.*
5 | import com.guru.composecookbook.cryptoapp.data.db.models.Crypto
6 |
7 | @Dao
8 | @TypeConverters()
9 | interface CryptoDao {
10 |
11 | @Transaction
12 | @Query("select * from crypto_fav_table")
13 | fun getFavCryptos(): LiveData>
14 |
15 | @Insert(onConflict = OnConflictStrategy.IGNORE)
16 | fun addFav(favCrypto: Crypto)
17 |
18 | @Delete
19 | fun removeFav(crypto: Crypto)
20 |
21 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/db/models/Crypto.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.db.models
2 |
3 | import androidx.room.Entity
4 | import androidx.room.PrimaryKey
5 | import java.io.Serializable
6 |
7 | @Entity(tableName = "crypto_fav_table")
8 | data class Crypto(
9 | @PrimaryKey
10 | val symbol: String,
11 | val price: Double,
12 | val name: String,
13 | val image: String,
14 | val dailyChange: Double,
15 | val dailyChangePercentage: Double,
16 | val high: Double,
17 | val low: Double,
18 | val marketCap: Long,
19 | val volume: Double,
20 | val supply: Double?,
21 | val chartData: List
22 | ) : Serializable {
23 |
24 | override fun equals(other: Any?): Boolean {
25 | return (other as Crypto).symbol == symbol
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/demos/cryptoapp/data/src/main/java/com/guru/composecookbook/cryptoapp/data/repositories/CryptoRepository.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cryptoapp.data.repositories
2 |
3 | import androidx.lifecycle.LiveData
4 | import com.guru.composecookbook.cryptoapp.data.db.models.Crypto
5 |
6 | interface CryptoRepository {
7 | suspend fun getPageCryptos(page: Int, pageSize: Int): List
8 | suspend fun getFavourite(): LiveData>
9 | suspend fun addFavorite(crypto: Crypto)
10 | suspend fun removeFavorite(crypto: Crypto)
11 | }
--------------------------------------------------------------------------------
/demos/datingapp/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/datingapp/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":animations:canvas"))
13 | implementation(project(":components:comingsoon"))
14 | implementation(project(":data"))
15 | implementation(project(":theme"))
16 |
17 | addComposeOfficialDependencies()
18 | addCoreAndroidUiDependencies()
19 | }
20 |
--------------------------------------------------------------------------------
/demos/datingapp/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/datingapp/src/main/java/com/guru/composecookbook/datingapp/DatingHomeViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.datingapp
2 |
3 | import androidx.lifecycle.LiveData
4 | import androidx.lifecycle.MutableLiveData
5 | import androidx.lifecycle.ViewModel
6 | import com.guru.composecookbook.data.AlbumsDataProvider
7 | import com.guru.composecookbook.data.model.Album
8 |
9 | class DatingHomeViewModel : ViewModel() {
10 | private val _albumLiveData = MutableLiveData>()
11 | val albumLiveData: LiveData> = _albumLiveData
12 |
13 | init {
14 | getAlbums()
15 | }
16 |
17 | private fun getAlbums() {
18 | _albumLiveData.value = AlbumsDataProvider.albums.take(15).toMutableList()
19 | }
20 | }
--------------------------------------------------------------------------------
/demos/datingapp/src/main/java/com/guru/composecookbook/datingapp/components/chat/MatchesSections.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.datingapp.components.chat
2 |
3 | import androidx.compose.foundation.layout.Spacer
4 | import androidx.compose.foundation.layout.height
5 | import androidx.compose.foundation.layout.padding
6 | import androidx.compose.foundation.lazy.LazyRow
7 | import androidx.compose.foundation.lazy.items
8 | import androidx.compose.material.Text
9 | import androidx.compose.runtime.Composable
10 | import androidx.compose.ui.Modifier
11 | import androidx.compose.ui.unit.dp
12 | import androidx.compose.ui.unit.sp
13 | import com.guru.composecookbook.data.AlbumsDataProvider
14 | import com.guru.composecookbook.theme.purple
15 | import com.guru.composecookbook.theme.typography
16 |
17 | @Composable
18 | fun MatchSection() {
19 | val matches = AlbumsDataProvider.albums.takeLast(10)
20 | Text(
21 | text = "New matches",
22 | style = typography.h6.copy(fontSize = 16.sp),
23 | modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),
24 | color = purple
25 | )
26 | LazyRow {
27 | items(
28 | items = matches,
29 | itemContent = { MatchesImage(imageId = it.imageId) })
30 | }
31 | Spacer(modifier = Modifier.height(24.dp))
32 | }
33 |
--------------------------------------------------------------------------------
/demos/datingapp/src/main/java/com/guru/composecookbook/datingapp/components/profile/ProfileScreen.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.datingapp.components.profile
2 |
3 | import androidx.compose.foundation.layout.fillMaxWidth
4 | import androidx.compose.foundation.layout.padding
5 | import androidx.compose.foundation.lazy.LazyColumn
6 | import androidx.compose.runtime.Composable
7 | import androidx.compose.ui.Alignment
8 | import androidx.compose.ui.Modifier
9 | import androidx.compose.ui.unit.dp
10 | import com.guru.composecookbook.comingsoon.ComingSoon
11 |
12 | @Composable
13 | fun ProfileScreen() {
14 | LazyColumn(
15 | modifier = Modifier
16 | .fillMaxWidth()
17 | .padding(16.dp),
18 | horizontalAlignment = Alignment.CenterHorizontally
19 | ) {
20 | item { ComingSoon() }
21 | }
22 | }
--------------------------------------------------------------------------------
/demos/datingapp/src/main/java/com/guru/composecookbook/datingapp/util/Extentions.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.datingapp.util
2 |
3 | fun Boolean?.orFalse(): Boolean = this ?: false
4 |
--------------------------------------------------------------------------------
/demos/datingapp/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | DatingHome
3 |
--------------------------------------------------------------------------------
/demos/gmail/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/gmail/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":components:fab"))
13 | implementation(project(":data"))
14 | implementation(project(":theme"))
15 |
16 | addComposeOfficialDependencies()
17 | addCoreAndroidUiDependencies()
18 | }
19 |
--------------------------------------------------------------------------------
/demos/gmail/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/gmail/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Gmail
3 | Back
4 | Menu
5 | My profile
6 | Create new email
7 |
--------------------------------------------------------------------------------
/demos/instagram/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/instagram/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addComposeThirdPartyDependencies
3 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
4 |
5 | plugins {
6 | /**
7 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
8 | */
9 | id("common-compose-module-configs-script-plugin")
10 | }
11 |
12 | dependencies {
13 | implementation(project(":data"))
14 | implementation(project(":theme"))
15 |
16 | addComposeOfficialDependencies()
17 | addComposeThirdPartyDependencies()
18 | addCoreAndroidUiDependencies()
19 | }
20 |
--------------------------------------------------------------------------------
/demos/instagram/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/instagram/src/main/java/com/guru/composecookbook/instagram/components/posts/PostImage.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.instagram.components.posts
2 |
3 | import androidx.annotation.DrawableRes
4 | import androidx.compose.foundation.Image
5 | import androidx.compose.foundation.layout.fillMaxWidth
6 | import androidx.compose.foundation.layout.height
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Modifier
9 | import androidx.compose.ui.layout.ContentScale
10 | import androidx.compose.ui.res.painterResource
11 | import androidx.compose.ui.tooling.preview.Preview
12 | import androidx.compose.ui.unit.dp
13 | import com.guru.composecookbook.data.DemoDataProvider
14 |
15 | @Composable
16 | fun PostImage(
17 | @DrawableRes imageId: Int,
18 | contentDescription: String?,
19 | modifier: Modifier = Modifier
20 | ) {
21 | Image(
22 | painter = painterResource(id = imageId),
23 | modifier = modifier.fillMaxWidth().height(450.dp),
24 | contentDescription = contentDescription,
25 | contentScale = ContentScale.Crop
26 | )
27 | }
28 |
29 | @Preview
30 | @Composable
31 | fun PostImagePreview() {
32 | PostImage(
33 | imageId = DemoDataProvider.tweetList.first { it.tweetImageId != 0 }.tweetImageId,
34 | contentDescription = null
35 | )
36 | }
--------------------------------------------------------------------------------
/demos/instagram/src/main/java/com/guru/composecookbook/instagram/components/posts/PostList.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.instagram.components.posts
2 |
3 | import androidx.compose.foundation.lazy.LazyColumn
4 | import androidx.compose.foundation.lazy.items
5 | import androidx.compose.runtime.Composable
6 | import androidx.compose.ui.Modifier
7 | import com.guru.composecookbook.data.model.Tweet
8 | import kotlin.random.Random
9 |
10 | @Composable
11 | fun PostList(
12 | posts: List,
13 | onLikeClicked: () -> Unit,
14 | onCommentsClicked: () -> Unit,
15 | onSendClicked: () -> Unit,
16 | modifier: Modifier = Modifier,
17 | ) {
18 | LazyColumn(modifier = modifier) {
19 | items(posts) {
20 | PostItem(
21 | post = it,
22 | isLiked = Random.nextBoolean(),
23 | onLikeClicked = onLikeClicked,
24 | onCommentsClicked = onCommentsClicked,
25 | onSendClicked = onSendClicked
26 | )
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/demos/instagram/src/main/java/com/guru/composecookbook/instagram/components/stories/StoryList.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.instagram.components.stories
2 |
3 | import androidx.compose.foundation.layout.Arrangement
4 | import androidx.compose.foundation.layout.PaddingValues
5 | import androidx.compose.foundation.layout.padding
6 | import androidx.compose.foundation.lazy.LazyRow
7 | import androidx.compose.foundation.lazy.items
8 | import androidx.compose.runtime.Composable
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.unit.dp
11 | import com.guru.composecookbook.data.model.Tweet
12 |
13 | @Composable
14 | fun StoryList(
15 | profiles: List,
16 | onProfileClicked: () -> Unit,
17 | modifier: Modifier = Modifier
18 | ) {
19 | LazyRow(
20 | modifier = modifier.padding(top = 8.dp, bottom = 8.dp),
21 | horizontalArrangement = Arrangement.spacedBy(8.dp),
22 | contentPadding = PaddingValues(horizontal = 8.dp)
23 | ) {
24 | items(profiles) {
25 | StoryItem(
26 | profileImageId = it.authorImageId,
27 | profileName = it.author,
28 | isMe = it.id == 1,
29 | onClick = onProfileClicked
30 | )
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/demos/instagram/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Instagram
3 |
--------------------------------------------------------------------------------
/demos/meditation/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/meditation/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":theme"))
13 | implementation(project(":components:verticalgrid"))
14 |
15 | addComposeOfficialDependencies()
16 | addCoreAndroidUiDependencies()
17 | }
18 |
--------------------------------------------------------------------------------
/demos/meditation/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/meditation/consumer-rules.pro
--------------------------------------------------------------------------------
/demos/meditation/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/demos/meditation/src/androidTest/java/com/guru/composecookbook/meditation/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.guru.composecookbook.meditation.test", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/demos/meditation/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/MeditaionActivity.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import androidx.activity.ComponentActivity
7 | import androidx.activity.compose.setContent
8 | import androidx.compose.foundation.ExperimentalFoundationApi
9 | import com.guru.composecookbook.meditation.ui.screen.MeditationHome
10 | import com.guru.composecookbook.meditation.ui.theme.MeditationAppTheme
11 |
12 | class MeditationActivity : ComponentActivity() {
13 | @OptIn(ExperimentalFoundationApi::class)
14 | override fun onCreate(savedInstanceState: Bundle?) {
15 | super.onCreate(savedInstanceState)
16 | setContent {
17 | MeditationAppTheme {
18 | MeditationHome()
19 | }
20 | }
21 | }
22 |
23 | companion object {
24 | fun newIntent(context: Context) = Intent(context, MeditationActivity::class.java)
25 | }
26 | }
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/model/BottomMenuContent.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.model
2 |
3 | import androidx.annotation.DrawableRes
4 | import com.guru.composecookbook.meditation.R
5 |
6 | data class BottomMenuContent(
7 | val title: String,
8 | @DrawableRes val iconId: Int
9 | )
10 |
11 | val bottomList = listOf(
12 | BottomMenuContent("Home", R.drawable.ic_home),
13 | BottomMenuContent("Sleep", R.drawable.ic_sleep),
14 | BottomMenuContent("Meditate", R.drawable.ic_meditate),
15 | BottomMenuContent("Music", R.drawable.ic_music),
16 | BottomMenuContent("Profile", R.drawable.ic_profile),
17 | )
18 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/model/Categories.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.model
2 |
3 | import com.guru.composecookbook.meditation.R
4 |
5 | data class Categories(
6 | val title : String,
7 | val icon : Int
8 | )
9 |
10 | val categoryList = listOf(
11 | Categories("All", R.drawable.ic_category_all),
12 | Categories("My", R.drawable.ic_category_my),
13 | Categories("Anxious", R.drawable.ic_category_anxious),
14 | Categories("Sleep", R.drawable.ic_category_sleep),
15 | Categories("Kids", R.drawable.ic_category_kids),
16 | )
17 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/model/DailyThought.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.model
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 |
6 | data class DailyThought(
7 | val title : String,
8 | val description : String,
9 | val textColor : Color
10 | )
11 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/model/Feature.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.model
2 |
3 | data class Feature(
4 | val title : String,
5 | val description : String,
6 | val image : Int,
7 | val time : String
8 | )
9 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/model/Recommendation.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.model
2 |
3 | import com.guru.composecookbook.meditation.R
4 |
5 | data class Recommendation(
6 | val title : String,
7 | val description : String,
8 | val image : Int
9 | )
10 |
11 | val recommendationList = listOf(
12 | Recommendation(
13 | "Focus",
14 | description = "MEDITATION • 3-10 MIN",
15 | R.drawable.ic_recommendation_1
16 | ),
17 | Recommendation(
18 | "Happiness",
19 | description = "MEDITATION • 3-10 MIN",
20 | R.drawable.ic_recommendation_2
21 | ),
22 | Recommendation(
23 | "Focus",
24 | description = "MEDITATION • 3-10 MIN",
25 | R.drawable.ic_recommendation_1
26 | ),
27 | Recommendation(
28 | "Happiness",
29 | description = "MEDITATION • 3-10 MIN",
30 | R.drawable.ic_recommendation_2
31 | ),
32 | )
33 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/model/Topic.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.model
2 |
3 | import androidx.compose.ui.graphics.Color
4 | import com.guru.composecookbook.meditation.R
5 | import com.guru.composecookbook.meditation.ui.theme.Blue
6 | import com.guru.composecookbook.meditation.ui.theme.DarkGray
7 | import com.guru.composecookbook.meditation.ui.theme.DeepBlue
8 | import com.guru.composecookbook.meditation.ui.theme.Green
9 | import com.guru.composecookbook.meditation.ui.theme.LightOrange
10 | import com.guru.composecookbook.meditation.ui.theme.Red
11 | import com.guru.composecookbook.meditation.ui.theme.TextWhite
12 |
13 | data class Topic(
14 | val title: String,
15 | val image: Int,
16 | val color : Color,
17 | val textColor : Color
18 | )
19 |
20 | val topicList = listOf(
21 | Topic("Reduce Stress", R.drawable.ic_topic_1, Blue, TextWhite),
22 | Topic("Improve Performance", R.drawable.ic_topic_2, Red, TextWhite),
23 | Topic("Increase Happiness", R.drawable.ic_topic_3, LightOrange, DeepBlue),
24 | Topic("Reduce Anxiety", R.drawable.ic_topic_4, Color.Yellow, DeepBlue),
25 | Topic("Personal Growth", R.drawable.ic_topic_5, Green, TextWhite),
26 | Topic("Better Sleep", R.drawable.ic_topic_6, DarkGray, TextWhite),
27 | )
28 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val TextWhite = Color(0xffeeeeee)
6 | val DeepBlue = Color(0xff06164c)
7 | val ButtonBlue = Color(0xff505cf3)
8 | val DarkerButtonBlue = Color(0xff566894)
9 | val LightRed = Color(0xfffc879a)
10 | val AquaBlue = Color(0xff9aa5c4)
11 | val OrangeYellow1 = Color(0xfff0bd28)
12 | val OrangeYellow2 = Color(0xfff1c746)
13 | val OrangeYellow3 = Color(0xfff4cf65)
14 | val Beige1 = Color(0xfffdbda1)
15 | val Beige2 = Color(0xfffcaf90)
16 | val Beige3 = Color(0xfff9a27b)
17 | val LightGreen1 = Color(0xff54e1b6)
18 | val LightGreen2 = Color(0xff36ddab)
19 | val LightGreen3 = Color(0xff11d79b)
20 | val BlueViolet1 = Color(0xffaeb4fd)
21 | val BlueViolet2 = Color(0xff9fa5fe)
22 | val BlueViolet3 = Color(0xff8f98fd)
23 | val Blue = Color(0xff8E97FD)
24 | val Orange = Color(0xffFFC97E)
25 | val DarkBlue = Color(0xff333242)
26 | val Gray = Color(0xffA0A3B1)
27 | val LightGray = Color(0xffA1A4B2)
28 | val Red = Color(0xffFA6E5A)
29 | val LightOrange = Color(0xffFEB18F)
30 | val Yellow = Color(0xffFFCF86)
31 | val Green = Color(0xff6CB28E)
32 | val DarkGray = Color(0xff4E5567)
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.theme
2 |
3 | import androidx.compose.foundation.shape.RoundedCornerShape
4 | import androidx.compose.material.Shapes
5 | import androidx.compose.ui.unit.dp
6 |
7 | val Shapes = Shapes(
8 | small = RoundedCornerShape(4.dp),
9 | medium = RoundedCornerShape(4.dp),
10 | large = RoundedCornerShape(0.dp)
11 | )
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/theme/Theme.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.theme
2 |
3 | import androidx.compose.foundation.isSystemInDarkTheme
4 | import androidx.compose.material.MaterialTheme
5 | import androidx.compose.runtime.Composable
6 |
7 | @Composable
8 | fun MeditationAppTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable() () -> Unit) {
9 | MaterialTheme(
10 | typography = Typography,
11 | shapes = Shapes,
12 | content = content,
13 | )
14 | }
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/theme/dimens.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui.theme
2 |
3 | import androidx.compose.ui.unit.dp
4 |
5 | val dp5 = 5.dp
6 | val dp10 = 10.dp
7 | val dp15 = 15.dp
8 | val dp20 = 20.dp
9 | val dp25 = 25.dp
--------------------------------------------------------------------------------
/demos/meditation/src/main/java/com/guru/composecookbook/meditation/ui/utils.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation.ui
2 |
3 | import androidx.compose.foundation.layout.Spacer
4 | import androidx.compose.foundation.layout.height
5 | import androidx.compose.foundation.layout.width
6 | import androidx.compose.runtime.Composable
7 | import androidx.compose.ui.Modifier
8 | import com.guru.composecookbook.meditation.ui.theme.dp10
9 | import com.guru.composecookbook.meditation.ui.theme.dp20
10 | import com.guru.composecookbook.meditation.ui.theme.dp5
11 |
12 | @Composable
13 | fun spacerHeight5() = Spacer(modifier = Modifier.height(dp5))
14 |
15 | @Composable
16 | fun spacerHeight10() = Spacer(modifier = Modifier.height(dp10))
17 |
18 | @Composable
19 | fun spacerHeight20() = Spacer(modifier = Modifier.height(dp20))
20 |
21 | @Composable
22 | fun spacerWidth5() = Spacer(modifier = Modifier.width(dp5))
23 |
24 | @Composable
25 | fun spacerWidth10() = Spacer(modifier = Modifier.width(dp10))
26 |
27 | @Composable
28 | fun spacerWidth20() = Spacer(modifier = Modifier.width(dp20))
29 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/drawable/ic_category_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
9 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/drawable/ic_daily_thoughts.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
9 |
12 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/drawable/ic_home.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/drawable/ic_play.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/drawable/ic_profile.xml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
14 |
15 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/drawable/ic_sleep.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/font/sans_pro_black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/meditation/src/main/res/font/sans_pro_black.ttf
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/font/sans_pro_bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/meditation/src/main/res/font/sans_pro_bold.ttf
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/font/sans_pro_extra_light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/meditation/src/main/res/font/sans_pro_extra_light.ttf
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/font/sans_pro_light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/meditation/src/main/res/font/sans_pro_light.ttf
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/font/sans_pro_regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/meditation/src/main/res/font/sans_pro_regular.ttf
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/font/sans_pro_semi_bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/demos/meditation/src/main/res/font/sans_pro_semi_bold.ttf
--------------------------------------------------------------------------------
/demos/meditation/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Meditation
3 | MainActivity
4 | Silent
5 | Moon
6 | Good Morning,
7 | We wish you have a good day
8 | Daily Thought
9 | Recommended for you
10 | Topics
11 | Ammar
12 | Your Name
13 | Basics
14 | Course
15 | Relaxation
16 | Music
17 | 3-10 MIN
18 | MEDITATION • 3-10 MIN
19 |
--------------------------------------------------------------------------------
/demos/meditation/src/test/java/com/guru/composecookbook/meditation/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.meditation
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 | }
--------------------------------------------------------------------------------
/demos/moviesapp/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/moviesapp/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.*
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":components:tags"))
12 | implementation(project(":components:carousel"))
13 | implementation(project(":demos:moviesapp:data"))
14 | implementation(project(":theme"))
15 | implementation(project(":data"))
16 |
17 | addComposeOfficialDependencies()
18 | addComposeThirdPartyDependencies()
19 |
20 | addCoreAndroidUiDependencies()
21 | addThirdPartyUiDependencies()
22 |
23 | addCoreAndroidDependencies()
24 | }
--------------------------------------------------------------------------------
/demos/moviesapp/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/demos/moviesapp/app/src/main/java/com/guru/composecookbook/moviesapp/ui/details/components/GenreSection.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.ui.details.components
2 |
3 | import androidx.compose.foundation.layout.Row
4 | import androidx.compose.runtime.Composable
5 | import androidx.compose.runtime.getValue
6 | import androidx.compose.runtime.livedata.observeAsState
7 | import com.guru.composecookbook.moviesapp.ui.details.MovieDetailViewModel
8 | import com.guru.composecookbook.tags.InterestTag
9 |
10 | @Composable
11 | fun GenreSection(viewModel: MovieDetailViewModel, movieGenreIdArray: List?) {
12 | movieGenreIdArray?.let { movieGenreIds ->
13 | val genres by viewModel.genresLiveData.observeAsState(emptyList())
14 | val movieGenres = genres.filter { movieGenreIds.contains(it.id) }.take(3)
15 | Row {
16 | movieGenres.forEach {
17 | InterestTag(text = it.name)
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/demos/moviesapp/app/src/main/java/com/guru/composecookbook/moviesapp/ui/internal/theme/Colors.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.ui.internal.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 | import com.guru.composecookbook.theme.graySurface
5 |
6 | object Colors {
7 | fun moviesSurfaceGradient(isDark: Boolean) =
8 | if (isDark) listOf(graySurface, Color.Black) else listOf(Color.White, Color.LightGray)
9 | }
--------------------------------------------------------------------------------
/demos/moviesapp/app/src/main/java/com/guru/composecookbook/moviesapp/ui/watch/components/EmptyWatchlistSection.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.ui.watch.components
2 |
3 | import androidx.compose.foundation.layout.Column
4 | import androidx.compose.foundation.layout.Spacer
5 | import androidx.compose.foundation.layout.fillMaxWidth
6 | import androidx.compose.foundation.layout.padding
7 | import androidx.compose.material.Text
8 | import androidx.compose.runtime.Composable
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.text.style.TextAlign
11 | import androidx.compose.ui.unit.dp
12 | import com.guru.composecookbook.theme.typography
13 |
14 | @Composable
15 | fun EmptyWatchlistSection() {
16 | Column {
17 | Spacer(modifier = Modifier.padding(100.dp))
18 | Text(
19 | text = "Watchlist is empty",
20 | style = typography.h6,
21 | modifier = Modifier.fillMaxWidth(),
22 | textAlign = TextAlign.Center
23 | )
24 | Text(
25 | text = "Please add some movies to your watchlist",
26 | style = typography.caption,
27 | textAlign = TextAlign.Center,
28 | modifier = Modifier.fillMaxWidth(),
29 | )
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/demos/moviesapp/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MovieHome
3 | MovieDetail
4 |
--------------------------------------------------------------------------------
/demos/moviesapp/data/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/moviesapp/data/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addCoreAndroidDependencies
2 | import com.guru.composecookbook.build.dependencies.addDataDependencies
3 | import com.guru.composecookbook.build.dependencies.addNetworkingDependencies
4 |
5 | plugins {
6 | /**
7 | * See [common-kotlin-module-configs-script-plugin.gradle.kts] file
8 | */
9 | id("common-kotlin-module-configs-script-plugin")
10 | }
11 |
12 | dependencies {
13 | addCoreAndroidDependencies()
14 | addNetworkingDependencies()
15 | addDataDependencies()
16 | }
17 |
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/MovieDIGraph.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data
2 |
3 | import android.content.Context
4 | import com.guru.composecookbook.moviesapp.data.api.MovieApi
5 | import com.guru.composecookbook.moviesapp.data.db.MoviesDatabase
6 | import com.guru.composecookbook.moviesapp.data.repositories.MovieRepository
7 | import com.guru.composecookbook.moviesapp.data.repositories.MovieRepositoryImpl
8 | import com.guru.composecookbook.moviesapp.data.repositories.MoviesLaneRepositoryImpl
9 | import com.guru.composecookbook.moviesapp.data.repositories.MoviesLanesRepository
10 |
11 | object MovieDIGraph {
12 | // create retrofit
13 | private val movieApi = MovieApi.invoke()
14 |
15 | fun createMovieRepository(context: Context): MovieRepository {
16 | val db = MoviesDatabase.getInstance(context)
17 | return MovieRepositoryImpl(
18 | movieApi = movieApi,
19 | moviesDao = db.moviesDao(),
20 | genreDao = db.genreDao()
21 | )
22 | }
23 |
24 | fun createMoviesLaneRepository(context: Context): MoviesLanesRepository {
25 | val db = MoviesDatabase.getInstance(context)
26 | return MoviesLaneRepositoryImpl(movieApi = movieApi)
27 | }
28 | }
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/api/models/GenreApiResponse.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.api.models
2 |
3 | import com.guru.composecookbook.moviesapp.data.db.models.Genre
4 |
5 | data class GenreApiResponse(val genres: List)
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/api/models/MovieListResponse.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.api.models
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import com.guru.composecookbook.moviesapp.data.db.models.Movie
5 |
6 | data class MovieListResponse(
7 | @SerializedName("pages") val pages: Int,
8 | @SerializedName("results") val movies: List
9 | )
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/db/ListTypeConverter.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.db
2 |
3 | import androidx.room.TypeConverter
4 |
5 | class ListTypeConverter {
6 | companion object {
7 | @TypeConverter
8 | @JvmStatic
9 | fun gettingListFromString(genreIds: String?): List? {
10 | val list = arrayListOf()
11 |
12 | val array =
13 | genreIds?.split(",".toRegex())?.dropLastWhile { it.isEmpty() }?.toTypedArray()
14 | if (array.isNullOrEmpty()) {
15 | return null
16 | }
17 | for (s in array) {
18 | if (s.isNotEmpty()) {
19 | list.add(Integer.parseInt(s))
20 | }
21 | }
22 | return list
23 | }
24 |
25 | @TypeConverter
26 | @JvmStatic
27 | fun writingStringFromList(list: List?): String? {
28 | var genreIds = ""
29 | if (genreIds.isEmpty()) {
30 | return null
31 | } else {
32 | for (i in list!!) {
33 | genreIds += ",$i"
34 | }
35 | }
36 |
37 | return genreIds
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/db/daos/GenreDao.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.db.daos
2 |
3 | import androidx.lifecycle.LiveData
4 | import androidx.room.*
5 | import com.guru.composecookbook.moviesapp.data.db.models.Genre
6 |
7 | @Dao
8 | interface GenreDao {
9 |
10 | @Transaction
11 | @Query("select * from genres")
12 | fun getAllGenres(): LiveData>
13 |
14 | @Insert(onConflict = OnConflictStrategy.IGNORE)
15 | fun insertAllGenres(genres: List)
16 | }
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/db/daos/MoviesDao.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.db.daos
2 |
3 | import androidx.lifecycle.LiveData
4 | import androidx.room.*
5 | import com.guru.composecookbook.moviesapp.data.db.models.Movie
6 |
7 | @Dao
8 | @TypeConverters()
9 | interface MoviesDao {
10 | @Insert(onConflict = OnConflictStrategy.REPLACE)
11 | fun addToWatchList(movie: Movie)
12 |
13 | @Transaction
14 | @Query("select * from movies_table")
15 | fun getMyWatchlist(): LiveData>
16 |
17 | @Query("DELETE FROM movies_table")
18 | fun deleteAll()
19 |
20 | @Query("select * from movies_table where id =:movieId")
21 | fun getMovieDetail(movieId: String): LiveData
22 |
23 | @Delete
24 | fun removeFromMYWatchlist(movie: Movie)
25 | }
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/db/models/Genre.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.db.models
2 |
3 | import androidx.room.Entity
4 | import androidx.room.PrimaryKey
5 |
6 | @Entity(tableName = "genres")
7 | data class Genre(
8 | @PrimaryKey
9 | val id: Int,
10 | val name: String
11 | )
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/db/models/Movie.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.db.models
2 |
3 | import androidx.room.Entity
4 | import androidx.room.PrimaryKey
5 | import java.io.Serializable
6 |
7 | @Entity(tableName = "movies_table")
8 | data class Movie(
9 | @PrimaryKey val id: Long,
10 | var title: String,
11 | val name: String?,
12 | val poster_path: String?,
13 | val backdrop_path: String?,
14 | val release_date: String?,
15 | val vote_average: Double?,
16 | val genre_ids: List?,
17 | val overview: String,
18 | val adult: Boolean,
19 | var tagline: String?,
20 | val budget: Double?,
21 | val revenue: Double?,
22 | val runtime: Int?,
23 | val homepage: String?,
24 | val status: String?,
25 | var addedTime: Long?,
26 | var dominantRgb: Int = 0
27 | ) : Serializable
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/repositories/MovieRepository.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.repositories
2 |
3 | import androidx.lifecycle.LiveData
4 | import com.guru.composecookbook.moviesapp.data.db.models.Genre
5 | import com.guru.composecookbook.moviesapp.data.db.models.Movie
6 | import kotlinx.coroutines.flow.Flow
7 |
8 | interface MovieRepository {
9 | suspend fun getNowShowing(): Flow>
10 | suspend fun getSimilarMovies(movieId: String): Flow>
11 | suspend fun getMyWatchlist(): LiveData>
12 | suspend fun addToMyWatchlist(movie: Movie)
13 | suspend fun removeFromMyWatchlist(movie: Movie)
14 | suspend fun fetchAndSaveGenresToDatabase(): Flow>
15 | suspend fun getGenres(): LiveData>
16 | }
--------------------------------------------------------------------------------
/demos/moviesapp/data/src/main/java/com/guru/composecookbook/moviesapp/data/repositories/MoviesLanesRepository.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.moviesapp.data.repositories
2 |
3 | import com.guru.composecookbook.moviesapp.data.db.models.Movie
4 | import kotlinx.coroutines.flow.Flow
5 |
6 | interface MoviesLanesRepository {
7 | suspend fun getTrendingMovies(): Flow>
8 | suspend fun getPopularMovies(): Flow>
9 | suspend fun getTopRatedMovies(): Flow>
10 | suspend fun getTopRatedTVShwos(): Flow>
11 | suspend fun getTrendingTVShows(): Flow>
12 | }
--------------------------------------------------------------------------------
/demos/paint/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/paint/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":theme"))
13 | implementation(project(":components:colorpicker"))
14 |
15 | addComposeOfficialDependencies()
16 | addCoreAndroidUiDependencies()
17 | }
18 |
--------------------------------------------------------------------------------
/demos/paint/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/paint/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Paint
3 |
--------------------------------------------------------------------------------
/demos/spotify/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/spotify/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":components:verticalgrid"))
13 | implementation(project(":data"))
14 | implementation(project(":theme"))
15 |
16 | addComposeOfficialDependencies()
17 | addCoreAndroidUiDependencies()
18 | }
19 |
--------------------------------------------------------------------------------
/demos/spotify/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/demos/spotify/src/main/java/com/guru/composecookbook/spotify/data/SpotifyDataProvider.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.spotify.data
2 |
3 | import androidx.compose.ui.graphics.Color
4 | import com.guru.composecookbook.theme.graySurface
5 |
6 | object SpotifyDataProvider {
7 | fun spotifySurfaceGradient(isDark: Boolean) =
8 | if (isDark) listOf(graySurface, Color.Black) else listOf(Color.White, Color.LightGray)
9 | }
--------------------------------------------------------------------------------
/demos/spotify/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Spotify
3 | SpotifyDetail
4 |
5 | Home
6 | Search
7 | Your Library
8 |
9 | Back
10 |
11 |
--------------------------------------------------------------------------------
/demos/tiktok/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/tiktok/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 | import com.guru.composecookbook.build.dependencies.addGoogleAndroidDependencies
4 | import com.guru.composecookbook.build.dependencies.addThirdPartyUiDependencies
5 |
6 | plugins {
7 | /**
8 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
9 | */
10 | id("common-compose-module-configs-script-plugin")
11 | }
12 |
13 | dependencies {
14 | implementation(project(":components:carousel"))
15 | implementation(project(":components:verticalgrid"))
16 | implementation(project(":data"))
17 | implementation(project(":theme"))
18 |
19 | addComposeOfficialDependencies()
20 | addCoreAndroidUiDependencies()
21 | addThirdPartyUiDependencies()
22 | addGoogleAndroidDependencies()
23 | }
24 |
--------------------------------------------------------------------------------
/demos/tiktok/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/tiktok/src/main/java/com/guru/composecookbook/tiktok/TikTokScreen.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.tiktok
2 |
3 | sealed class TikTokScreen(val route: String) {
4 | object Home : TikTokScreen("Home")
5 | object Discover : TikTokScreen("Discover")
6 | object Create : TikTokScreen("Create")
7 | object Inbox : TikTokScreen("Inbox")
8 | object Me : TikTokScreen("Me")
9 | object Profile : TikTokScreen("Profile")
10 | }
--------------------------------------------------------------------------------
/demos/tiktok/src/main/java/com/guru/composecookbook/tiktok/TiktokDemoDataProvider.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.tiktok
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | object TiktokDemoDataProvider {
6 | val bottomBarList = listOf(
7 | TikTokScreen.Home,
8 | TikTokScreen.Discover,
9 | TikTokScreen.Create,
10 | TikTokScreen.Inbox,
11 | TikTokScreen.Me
12 | )
13 |
14 | val lanes =
15 | listOf(
16 | "OhHO ohNO",
17 | "FunFacts",
18 | "HappyDeepavli",
19 | "HalloweenIsHere",
20 | "BoomBoom",
21 | "No no no no"
22 | )
23 |
24 | val customGray = Color.LightGray.copy(alpha = 0.5f)
25 |
26 | val videos = listOf("t1.mp4", "t2.mp4", "t3.mp4")
27 | }
--------------------------------------------------------------------------------
/demos/tiktok/src/main/java/com/guru/composecookbook/tiktok/TiktokHomeInteractionEvents.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.tiktok
2 |
3 | import com.guru.composecookbook.data.model.Album
4 |
5 | sealed class TiktokHomeInteractionEvents {
6 | data class OpenProfile(val album: Album) : TiktokHomeInteractionEvents()
7 | data class ShareVideo(val album: Album) : TiktokHomeInteractionEvents()
8 | object OpenComments : TiktokHomeInteractionEvents()
9 | }
--------------------------------------------------------------------------------
/demos/tiktok/src/main/java/com/guru/composecookbook/tiktok/components/discovers/DiscoveryScreen.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.tiktok.components.discovers
2 |
3 | import androidx.compose.foundation.layout.Column
4 | import androidx.compose.foundation.layout.Spacer
5 | import androidx.compose.foundation.layout.height
6 | import androidx.compose.material.Surface
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Modifier
9 | import androidx.compose.ui.unit.dp
10 | import com.guru.composecookbook.theme.ComposeCookBookTheme
11 |
12 | @Composable
13 | fun DiscoverScreen() {
14 | ComposeCookBookTheme(darkTheme = false) {
15 | Surface {
16 | Column {
17 | SearchSection()
18 | LanesSection()
19 | Spacer(modifier = Modifier.height(400.dp))
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/demos/tiktok/src/main/java/com/guru/composecookbook/tiktok/components/discovers/MediaItem.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.tiktok.components.discovers
2 |
3 | import androidx.compose.foundation.Image
4 | import androidx.compose.foundation.layout.height
5 | import androidx.compose.foundation.layout.padding
6 | import androidx.compose.foundation.layout.width
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Modifier
9 | import androidx.compose.ui.layout.ContentScale
10 | import androidx.compose.ui.unit.dp
11 | import coil.compose.rememberImagePainter
12 |
13 | @Composable
14 | fun MediaItem(
15 | id: Int,
16 | modifier: Modifier = Modifier
17 | ) {
18 | Image(
19 | painter = rememberImagePainter(
20 | data = "https://picsum.photos/id/${id}/200/200"
21 | ),
22 | contentDescription = null,
23 | contentScale = ContentScale.Crop,
24 | modifier = modifier
25 | .height(150.dp)
26 | .width(120.dp)
27 | .padding(2.dp),
28 | )
29 | }
30 |
--------------------------------------------------------------------------------
/demos/tiktok/src/main/java/com/guru/composecookbook/tiktok/components/profile/ProfileScreen.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.tiktok.components.profile
2 |
3 | import androidx.compose.foundation.layout.padding
4 | import androidx.compose.foundation.lazy.LazyColumn
5 | import androidx.compose.material.Scaffold
6 | import androidx.compose.runtime.Composable
7 | import androidx.compose.ui.Alignment
8 | import androidx.compose.ui.Modifier
9 | import androidx.navigation.NavHostController
10 | import com.guru.composecookbook.data.AlbumsDataProvider
11 | import com.guru.composecookbook.data.model.Album
12 | import com.guru.composecookbook.theme.ComposeCookBookTheme
13 |
14 | @Composable
15 | fun ProfileScreen(userId: String = "10", navHostController: NavHostController) {
16 | val album: Album = AlbumsDataProvider.albums.first { it.id.toString() == userId }
17 | ComposeCookBookTheme(darkTheme = false) {
18 | Scaffold(
19 | topBar = { ProfileAppBar(album, navHostController) }
20 | ) { paddingValues ->
21 | LazyColumn(
22 | horizontalAlignment = Alignment.CenterHorizontally,
23 | modifier = Modifier.padding(paddingValues),
24 | ) {
25 | item { ProfileTopSection(album) }
26 | }
27 | }
28 | }
29 | }
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/demos/tiktok/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | TikTok
3 | Back
4 |
5 |
--------------------------------------------------------------------------------
/demos/twitter/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/twitter/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":data"))
13 | implementation(project(":theme"))
14 |
15 | addComposeOfficialDependencies()
16 | addCoreAndroidUiDependencies()
17 | }
18 |
--------------------------------------------------------------------------------
/demos/twitter/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/twitter/src/main/java/com/guru/composecookbook/twitter/components/profiles/ProfilePicture.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.twitter.components.profiles
2 |
3 | import androidx.annotation.DrawableRes
4 | import androidx.compose.foundation.Image
5 | import androidx.compose.foundation.layout.size
6 | import androidx.compose.foundation.shape.CircleShape
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Modifier
9 | import androidx.compose.ui.draw.clip
10 | import androidx.compose.ui.layout.ContentScale
11 | import androidx.compose.ui.res.painterResource
12 | import androidx.compose.ui.unit.Dp
13 | import androidx.compose.ui.unit.dp
14 |
15 | @Composable
16 | fun ProfilePicture(
17 | @DrawableRes profileImageId: Int,
18 | modifier: Modifier = Modifier,
19 | size: Dp = ProfilePictureSizes.small
20 | ) {
21 | Image(
22 | painter = painterResource(id = profileImageId),
23 | contentDescription = null,
24 | contentScale = ContentScale.Crop,
25 | modifier = modifier
26 | .size(size)
27 | .clip(CircleShape)
28 | )
29 | }
30 |
31 | object ProfilePictureSizes {
32 | val small = 32.dp
33 | val medium = 50.dp
34 | }
35 |
--------------------------------------------------------------------------------
/demos/twitter/src/main/java/com/guru/composecookbook/twitter/components/tweets/TweetImage.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.twitter.components.tweets
2 |
3 | import androidx.annotation.DrawableRes
4 | import androidx.compose.foundation.Image
5 | import androidx.compose.foundation.layout.fillMaxWidth
6 | import androidx.compose.foundation.layout.height
7 | import androidx.compose.foundation.shape.RoundedCornerShape
8 | import androidx.compose.runtime.Composable
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.draw.clip
11 | import androidx.compose.ui.layout.ContentScale
12 | import androidx.compose.ui.res.painterResource
13 | import androidx.compose.ui.unit.dp
14 |
15 | @Composable
16 | fun TweetImage(
17 | @DrawableRes imageId: Int,
18 | modifier: Modifier = Modifier
19 | ) {
20 | if (imageId != 0) {
21 | Image(
22 | painter = painterResource(id = imageId),
23 | contentDescription = null,
24 | modifier = modifier
25 | .fillMaxWidth()
26 | .height(150.dp)
27 | .clip(RoundedCornerShape(4.dp)),
28 | contentScale = ContentScale.Crop
29 | )
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/demos/twitter/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Twitter
3 |
--------------------------------------------------------------------------------
/demos/youtube/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/demos/youtube/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":data"))
13 | implementation(project(":theme"))
14 |
15 | addComposeOfficialDependencies()
16 | addCoreAndroidUiDependencies()
17 | }
18 |
--------------------------------------------------------------------------------
/demos/youtube/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/demos/youtube/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Youtube
3 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | #org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 | org.gradle.jvmargs=-Xmx4096M -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
23 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jan 30 00:00:22 SGT 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/screens/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/screens/.DS_Store
--------------------------------------------------------------------------------
/screens/Screenshot_20200906-161500_ComposeDemo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/screens/Screenshot_20200906-161500_ComposeDemo.jpg
--------------------------------------------------------------------------------
/screens/Screenshot_20200906-161609_ComposeDemo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/screens/Screenshot_20200906-161609_ComposeDemo.jpg
--------------------------------------------------------------------------------
/screens/Screenshot_20200906-161629_ComposeDemo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/screens/Screenshot_20200906-161629_ComposeDemo.jpg
--------------------------------------------------------------------------------
/screens/Screenshot_20200907-001949_ComposeDemo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/screens/Screenshot_20200907-001949_ComposeDemo.jpg
--------------------------------------------------------------------------------
/screens/Screenshot_20200907-002000_ComposeDemo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/screens/Screenshot_20200907-002000_ComposeDemo.jpg
--------------------------------------------------------------------------------
/screens/composelogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/screens/composelogo.png
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | rootProject.name = "ComposeCookBook"
2 | include(":app")
3 | include(":demos:instagram")
4 | include(":data")
5 | include(":theme")
6 | include(":demos:cryptoapp:app")
7 | include(":demos:cryptoapp:data")
8 | include(":demos:moviesapp:app")
9 | include(":demos:moviesapp:data")
10 | include(":components:charts")
11 | include(":components:tags")
12 | include(":components:carousel")
13 | include(":components:verticalgrid")
14 | include(":demos:spotify")
15 | include(":demos:twitter")
16 | include(":demos:youtube")
17 | include(":demos:gmail")
18 | include(":components:fab")
19 | include(":demos:paint")
20 | include(":components:colorpicker")
21 | include(":demos:tiktok")
22 | include(":demos:datingapp")
23 | include(":animations:lottie")
24 | include(":animations:canvas")
25 | include(":components:comingsoon")
26 | include(":templates:onboarding")
27 | include(":templates:paymentcard")
28 | include(":templates:profile")
29 | include(":templates:login")
30 | include(":templates:pinlock")
31 | include(":templates:cascademenu")
32 | include(":demos:meditation")
33 |
--------------------------------------------------------------------------------
/templates/cascademenu/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addComposeThirdPartyDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":theme"))
13 | implementation(project(":data"))
14 | implementation(project(":components:tags"))
15 |
16 | addComposeOfficialDependencies()
17 | addComposeThirdPartyDependencies()
18 | }
--------------------------------------------------------------------------------
/templates/cascademenu/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/templates/cascademenu/src/main/java/com/guru/composecookbook/cascademenu/cascade/CascadeMenuBuilder.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cascademenu.cascade
2 |
3 | import androidx.compose.ui.graphics.vector.ImageVector
4 |
5 | class CascadeMenuBuilder {
6 | var menu = CascadeMenuItem()
7 |
8 | fun icon(value: ImageVector) {
9 | menu.icon = value
10 | }
11 |
12 | fun item(id: T, title: String, init: (CascadeMenuBuilder.() -> Unit)? = null) {
13 | val menuBuilder = CascadeMenuBuilder()
14 | val child = menuBuilder.menu.apply {
15 | this.id = id
16 | this.title = title
17 | }
18 | init?.let {
19 | menuBuilder.init()
20 | }
21 | menu.children = menu.children ?: mutableListOf()
22 | child.parent = menu
23 | menu.children!!.add(child)
24 | }
25 | }
26 |
27 |
28 | fun cascadeMenu(init: CascadeMenuBuilder.() -> Unit): CascadeMenuItem {
29 | val menuBuilder = CascadeMenuBuilder()
30 | menuBuilder.init()
31 | return menuBuilder.menu
32 | }
--------------------------------------------------------------------------------
/templates/cascademenu/src/main/java/com/guru/composecookbook/cascademenu/cascade/CascadeMenuColors.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cascademenu.cascade
2 |
3 | import androidx.compose.material.MaterialTheme
4 | import androidx.compose.runtime.Composable
5 | import androidx.compose.ui.graphics.Color
6 |
7 | data class CascadeMenuColors(
8 | val backgroundColor: Color,
9 | val contentColor: Color,
10 | )
11 |
12 | @Composable
13 | fun cascadeMenuColors(
14 | backgroundColor: Color = MaterialTheme.colors.surface,
15 | contentColor: Color = MaterialTheme.colors.onSurface
16 | ): CascadeMenuColors {
17 | return CascadeMenuColors(backgroundColor, contentColor)
18 | }
--------------------------------------------------------------------------------
/templates/cascademenu/src/main/java/com/guru/composecookbook/cascademenu/cascade/CascadeMenuItem.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cascademenu.cascade
2 |
3 | import androidx.compose.ui.graphics.vector.ImageVector
4 |
5 | class CascadeMenuItem {
6 | lateinit var id: T
7 |
8 | lateinit var title: String
9 |
10 | var icon: ImageVector? = null
11 |
12 | var parent: CascadeMenuItem? = null
13 |
14 | var children: MutableList>? = null
15 |
16 | fun hasChildren() = !children.isNullOrEmpty()
17 |
18 | fun hasParent() = parent != null
19 |
20 | fun getChild(id: T) = children?.let { items -> items.find { item -> item.id == id } }
21 | }
--------------------------------------------------------------------------------
/templates/cascademenu/src/main/java/com/guru/composecookbook/cascademenu/cascade/CascadeMenuState.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.cascademenu.cascade
2 |
3 | import androidx.compose.runtime.*
4 |
5 | class CascadeMenuState(currentMenuItem: CascadeMenuItem) {
6 | private var _currentMenu by mutableStateOf(currentMenuItem)
7 |
8 | var currentMenuItem: CascadeMenuItem
9 | get() = _currentMenu
10 | set(value) {
11 | _currentMenu = value
12 | }
13 | }
--------------------------------------------------------------------------------
/templates/login/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/templates/login/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addComposeThirdPartyDependencies
3 |
4 | plugins {
5 | /**
6 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
7 | */
8 | id("common-compose-module-configs-script-plugin")
9 | }
10 |
11 | dependencies {
12 | implementation(project(":theme"))
13 | implementation(project(":data"))
14 | implementation(project(":animations:lottie"))
15 | implementation(project(":components:tags"))
16 | implementation(project(":templates:onboarding"))
17 |
18 | addComposeOfficialDependencies()
19 | addComposeThirdPartyDependencies()
20 | }
--------------------------------------------------------------------------------
/templates/login/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/templates/onboarding/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/templates/onboarding/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":components:carousel"))
12 | implementation(project(":animations:lottie"))
13 |
14 | addComposeOfficialDependencies()
15 | }
--------------------------------------------------------------------------------
/templates/onboarding/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/templates/onboarding/src/main/java/com/guru/composecookbook/onboarding/OnboardingPagerSlide.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.onboarding
2 |
3 | import androidx.compose.foundation.layout.padding
4 | import androidx.compose.material.Icon
5 | import androidx.compose.runtime.Composable
6 | import androidx.compose.ui.Modifier
7 | import androidx.compose.ui.graphics.Color
8 | import androidx.compose.ui.graphics.vector.ImageVector
9 | import androidx.compose.ui.unit.dp
10 |
11 | @Composable
12 | fun OnboardingPagerSlide(selected: Boolean, color: Color, icon: ImageVector) {
13 | Icon(
14 | imageVector = icon,
15 | modifier = Modifier.padding(4.dp),
16 | contentDescription = null,
17 | tint = if (selected) color else Color.Gray
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/templates/paymentcard/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/templates/paymentcard/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":theme"))
12 |
13 | addComposeOfficialDependencies()
14 | }
--------------------------------------------------------------------------------
/templates/paymentcard/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/templates/paymentcard/src/main/res/drawable/card_symbol.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gurupreet/ComposeCookBook/1b82b0b990648b2ece5c890fef622d9bdb00e4d8/templates/paymentcard/src/main/res/drawable/card_symbol.png
--------------------------------------------------------------------------------
/templates/paymentcard/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Card holder name
3 | Card number
4 | Expiry date
5 | CVC
6 | save
7 |
--------------------------------------------------------------------------------
/templates/pinlock/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/templates/pinlock/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addBiometricDependency
2 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
3 | import com.guru.composecookbook.build.dependencies.addComposeThirdPartyDependencies
4 |
5 |
6 | plugins {
7 | /**
8 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
9 | */
10 | id("common-compose-module-configs-script-plugin")
11 | }
12 |
13 | dependencies {
14 | implementation(project(":theme"))
15 | implementation(project(":data"))
16 | implementation(project(":animations:lottie"))
17 | implementation(project(":components:tags"))
18 | implementation(project(":templates:onboarding"))
19 |
20 | addComposeOfficialDependencies()
21 | addComposeThirdPartyDependencies()
22 | addBiometricDependency()
23 | }
--------------------------------------------------------------------------------
/templates/pinlock/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/templates/pinlock/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/templates/profile/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/templates/profile/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 |
3 | plugins {
4 | /**
5 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
6 | */
7 | id("common-compose-module-configs-script-plugin")
8 | }
9 |
10 | dependencies {
11 | implementation(project(":theme"))
12 | implementation(project(":data"))
13 | implementation(project(":components:tags"))
14 |
15 | addComposeOfficialDependencies()
16 | }
--------------------------------------------------------------------------------
/templates/profile/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/templates/profile/src/main/java/com/guru/composecookbook/profile/InterestsSection.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.profile
2 |
3 | import androidx.compose.foundation.layout.Row
4 | import androidx.compose.foundation.layout.padding
5 | import androidx.compose.material.Divider
6 | import androidx.compose.material3.MaterialTheme
7 | import androidx.compose.material3.Text
8 | import androidx.compose.runtime.Composable
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.unit.dp
11 | import com.guru.composecookbook.tags.InterestTag
12 | import com.guru.composecookbook.theme.typography
13 |
14 | @Composable
15 | fun InterestsSection() {
16 | Text(
17 | text = "My Interests",
18 | style = typography.h6,
19 | color = MaterialTheme.colorScheme.primary,
20 | modifier = Modifier.padding(start = 8.dp, top = 16.dp)
21 | )
22 | Divider(modifier = Modifier.padding(vertical = 4.dp, horizontal = 8.dp))
23 | Row(modifier = Modifier.padding(start = 8.dp, top = 8.dp)) {
24 | InterestTag("Android")
25 | InterestTag("Compose")
26 | InterestTag("Flutter")
27 | InterestTag("SwiftUI")
28 | }
29 | Row(modifier = Modifier.padding(start = 8.dp)) {
30 | InterestTag("Video games")
31 | InterestTag("Podcasts")
32 | InterestTag("Basketball")
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/templates/profile/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | I am an enthusiastic Developer. I love to create things that make the world a better place. I like to work where technology is used to improve core components of life like Health, Education and Environment.
3 | This project was started because of my curiosity about declarative UIs.I have been tracking Jetpack Compose long before alpha release and trying to understand how it is gonna fit in our current existing system. So this is an attempt to showcase how it can be used to make android development more fun, easy and interesting.
4 |
--------------------------------------------------------------------------------
/theme/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/theme/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
2 | import com.guru.composecookbook.build.dependencies.addComposeThirdPartyDependencies
3 | import com.guru.composecookbook.build.dependencies.addCoreAndroidUiDependencies
4 |
5 | plugins {
6 | /**
7 | * See [common-compose-module-configs-script-plugin.gradle.kts] file
8 | */
9 | id("common-compose-module-configs-script-plugin")
10 | }
11 |
12 | dependencies {
13 | addComposeOfficialDependencies()
14 | addComposeThirdPartyDependencies()
15 | addCoreAndroidUiDependencies()
16 | }
--------------------------------------------------------------------------------
/theme/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/theme/src/main/java/com/guru/composecookbook/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val green200 = Color(0xffa5d6a7)
6 | val green500 = Color(0xff4caf50)
7 | val green700 = Color(0xff388e3c)
8 |
9 | val blue500 = Color(0xFF3F51B5)
10 | val blue200 = Color(0xFF9FA8DA)
11 | val blue700 = Color(0xFF303F9F)
12 |
13 | val purple200 = Color(0xFFB39DDB)
14 | val purple = Color(0xFF833AB4)
15 | val purple700 = Color(0xFF512DA8)
16 |
17 | val orange200 = Color(0xFFff7961)
18 | val orange500 = Color(0xFFf44336)
19 | val orange700 = Color(0xFFba000d)
20 |
21 |
22 | val teal200 = Color(0xff80deea)
23 | val twitterColor = Color(0xFF1DA1F2)
24 | val tiktokBlue = Color(0xFF69C9D0)
25 | val tiktokRed = Color(0xFFEE1D52)
26 | val tiktokBlack = Color(0xFF010101)
27 | val blue = Color(0xFF5851DB)
28 |
29 | val orange = Color(0xFFF56040)
30 | val yellow = Color(0xFFFCAF45)
31 | val graySurface = Color(0xFF2A2A2A)
32 | val gradientGreenColors = listOf(green200, green500, green700)
33 | val gradientRedColors = listOf(orange, tiktokRed)
34 | val gradientBluePurple = listOf(blue, purple)
35 | val instagramGradient = listOf(blue, purple, orange, yellow)
--------------------------------------------------------------------------------
/theme/src/main/java/com/guru/composecookbook/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.theme
2 |
3 | import androidx.compose.foundation.shape.RoundedCornerShape
4 | import androidx.compose.material.Shapes
5 | import androidx.compose.ui.unit.dp
6 |
7 | val shapes = Shapes(
8 | small = RoundedCornerShape(4.dp),
9 | medium = RoundedCornerShape(4.dp),
10 | large = RoundedCornerShape(0.dp)
11 | )
--------------------------------------------------------------------------------
/theme/src/main/java/com/guru/composecookbook/theme/components/Material3Card.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.theme.components
2 |
3 | import androidx.compose.foundation.BorderStroke
4 | import androidx.compose.material3.MaterialTheme
5 | import androidx.compose.material3.Surface
6 | import androidx.compose.material3.contentColorFor
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Modifier
9 | import androidx.compose.ui.graphics.Color
10 | import androidx.compose.ui.graphics.Shape
11 | import androidx.compose.ui.unit.Dp
12 | import androidx.compose.ui.unit.dp
13 |
14 | @Composable
15 | fun Material3Card(
16 | modifier: Modifier = Modifier,
17 | shape: Shape = androidx.compose.material.MaterialTheme.shapes.medium,
18 | backgroundColor: Color = MaterialTheme.colorScheme.surface,
19 | contentColor: Color = contentColorFor(backgroundColor),
20 | border: BorderStroke? = null,
21 | elevation: Dp = 1.dp,
22 | content: @Composable () -> Unit
23 | ) {
24 | Surface(
25 | modifier = modifier,
26 | shape = shape,
27 | color = backgroundColor,
28 | contentColor = contentColor,
29 | tonalElevation = elevation,
30 | shadowElevation = elevation,
31 | border = border,
32 | content = content
33 | )
34 | }
--------------------------------------------------------------------------------
/theme/src/main/java/com/guru/composecookbook/theme/extensions/BitmapExt.kt:
--------------------------------------------------------------------------------
1 | package com.guru.composecookbook.theme.extensions
2 |
3 | import android.graphics.Bitmap
4 | import androidx.palette.graphics.Palette
5 |
6 | fun Bitmap.generateDominantColorState(): Palette.Swatch = Palette.Builder(this)
7 | .resizeBitmapArea(0)
8 | .maximumColorCount(16)
9 | .generate()
10 | .swatches
11 | .maxByOrNull { swatch -> swatch.population }!!
12 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_baseline_home_24.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_comment_dots_solid.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_ethereum_brands.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_hashtag_solid.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_heart_solid.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_instagram.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_linkedin_brands.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_retweet_solid.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_send.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_share_solid.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_speech_bubble.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_twitter.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/drawable/ic_twitter_square_brands.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/theme/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/theme/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffa5d6a7
4 | #ff4caf50
5 | #ff388e3c
6 | #FF03DAC5
7 | #ff80deea
8 | #FF833AB4
9 | #FF000000
10 | #FFFFFFFF
11 |
--------------------------------------------------------------------------------
/theme/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
18 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------