Skip to content

Commit

Permalink
Add/Fix links to code files and write description in corresponding .m…
Browse files Browse the repository at this point in the history
…d file
  • Loading branch information
krunal-simform authored and yashwantgowla-simform committed Aug 13, 2024
1 parent 18c2064 commit e854078
Show file tree
Hide file tree
Showing 11 changed files with 758 additions and 173 deletions.
215 changes: 42 additions & 173 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,174 +15,50 @@ A Collection of major Jetpack compose UI components which are commonly used.

In this repository, there are number of UI components demonstrated which can be useful in regular development through Jetpack Compose.

## Prerequisites
- Experience with Kotlin syntax, including lambdas
## Content

## What you'll need
- [Latest Stable Android Studio](https://developer.android.com/studio)
- [Google Maps Key](https://developers.google.com/maps/documentation/android-sdk/get-api-key)

## Setup (For Google Map Implementation)
To run the google map samples, you'll have to:

1. Get a Maps API key
2. Add an entry in `local.properties` or `local.defaults.properties` that looks like `MAPS_API_KEY=YOUR_MAPS_KEY`
3. Build and run

## Components

| App Bar | Bottom Navigation | Button |
| -- | -- | -- |
| <img src="/gif/AppBar.jpg" height="500px"/> | <img src="/gif/BottomNav.gif" height="500px"/>| <img src="/gif/Button.jpg" height="500px"/>

| Checkbox | Dialog | Dropdown |
| -- | -- | -- |
| <img src="/gif/Checkbox.jpg" height="500px"/> | <img src="/gif/Dialog.gif" height="500px"/>| <img src="/gif/Dropdown.gif" height="500px"/>

| FAB | Modal Drawer | Bottom Drawer |
| -- | -- | -- |
| <img src="/gif/FAB.png" height="500px"/> | <img src="/gif/ModalDrawer.gif" height="500px"/>| <img src="/gif/BottomDrawer.gif" height="500px"/>

| Radio Button | Slider | Text |
| -- | -- | -- |
| <img src="/gif/Radio.png" height="500px"/> | <img src="/gif/Sliders.gif" height="500px"/>| <img src="/gif/Text.png" height="500px"/>

| Textfield | Theme | ZoomView |
| -- | -- | -- |
| <img src="/gif/TextFields.png" height="500px"/> | <img src="/gif/Theme.gif" height="500px"/>| <img src="/gif/Zoomview.gif" height="500px"/>

| Textfield | Theme | MagnifierView |
| -- | -- | -- |
| <img src="/gif/TextFields.png" height="500px"/> | <img src="/gif/Theme.gif" height="500px"/>| <img src="/gif/magnifierView.gif" height="500px"/>

| TabBar | DatePicker | TimePicker |
| -- | -- | -- |
| <img src="/gif/TabBar.gif" height="500px"/> | <img src="/gif/DatePicker.gif" height="500px"/> | <img src="/gif/TimePicker.gif" height="500px"/>

| ImagePicker | ParallaxEffect | Compose views in Xml |
| -- | -- | -- |
| <img src="/gif/ImagePicker.gif" height="500px"/> | <img src="/gif/ParallaxEffect.gif" height="500px"/> | <img src="/gif/ComposeViewsInXml.gif" height="500px"/> |

| XML views in Compose |
| -- |
| <img src="/gif/XmlViewInCompose.png" height="500px"/> |

## List

| LazyRow/Column | LazyVerticalGrid | Advance List |
| -- | -- | -- |
| <img src="/gif/List/ListRowColumn.jpg" height="500px"/> | <img src="/gif/List/ListGrid.jpg" height="500px"/>| <img src="/gif/List/AdvanceList.gif" height="500px"/>

## Pull To Refresh
| Simple Pull To Refresh | Custom Background Pull To Refresh | Custom View Pull To Refresh |
| -- | -- | -- |
| <img src="/gif/PullToRefresh/SimplePullToRefresh.gif" height="500px"/> | <img src="/gif/PullToRefresh/CustomBackgroundPullToRefresh.gif" height="500px"/> | <img src="/gif/PullToRefresh/CustomViewPullToRefresh.gif" height="500px"/>

## Swipe To Delete
| Swipe Left | Swipe Right | Swipe Left + Right |
| -- | -- | -- |
| <img src="/gif/SwipeToDelete/swipeLeft.gif" height="500px"/> | <img src="/gif/SwipeToDelete/swipeRight.gif" height="500px"/>| <img src="/gif/SwipeToDelete/swipeLeft+Right.gif" height="500px"/>

## Constraint Layout

| Barrier | Guideline | Chain |
| -- | -- | -- |
| <img src="/gif/Constraint/Barrier.png" height="500px"/> | <img src="/gif/Constraint/Guideline.png" height="500px"/>| <img src="/gif/Constraint/Chain.png" height="500px"/>
- [UI Components] - Contains App Bar, Bottom Navigation, Button, Checkbox, Dialog, Dropdown, FAB, Modal Drawer, Bottom Drawer, Radio Button, Slider, Text, TextField, Theme, ZoomView, MagnifierView, TabBar, DatePicker, TimePicker, ImagePicker, ParallaxEffect, Compose viewXml and XML views in Compose examples.

- [List] - Contains LazyRow/Column, LazyVerticalGrid and Advance List examples.

## Animation
- [Pull To refresh] - Contains Simple Pull To Refresh, Custom Background Pull To Refresh and Custom View Pull To Refresh examples.

| Basic | Content | Gesture |
| -- | -- | -- |
| <img src="/gif/Animation/BasicAnim.gif" height="500px"/> | <img src="/gif/Animation/ContentAnim.gif" height="500px"/>| <img src="/gif/Animation/GestureAnim.gif" height="500px"/>
- [Swipe To Delete] - Contains Swipe from Left, Swipe from Right and Swipe from Both examples.

| Infinite | Shimmer | TabBar |
| -- | -- | -- |
| <img src="/gif/Animation/InfiniteAnim.gif" height="500px"/> | <img src="/gif/Animation/ShimmerAnim.gif" height="500px"/>| <img src="/gif/Animation/TabBarAnim.gif" height="500px"/>
- [Constraint Layout] - Contains Barrier, Chain and Guideline examples.

## Sample UI
- [Animation] - Contains Basic Animation, Content Animation, Gesture Animation, Infinite Animation, Shimmer Animation and TabBar Animation examples.

| Instagram |
| -- |
| <img src="/gif/SampleUI/InstagramDemo.gif" height="500px"/> |
- [Sample Instagram UI] - Contains a sample UI for Instagram Clone App created using Jetpack Compose.

## Canvas
- [Canvas] - Contains Shapes, Text and Image, Paths, Path Operations, Draw Scope Helpers, Canvas + Touch and Blend Modes examples.

| Overview | Shapes | Text and Image |
| -- | -- | -- |
| <img src="/gif/canvas/canvas.gif" height="500px"/> | <img src="/gif/canvas/shapes.jpg" height="500px"/> | <img src="/gif/canvas/text_and_image.jpg" height="500px"/> |
- [Google Maps] - Contains Basic Map, Markers, Polyline, Polygon, Circle, Ground Overlay, Compose Map In XML etc. examples.

| Path | Path Operations | DrawScope Helpers |
| -- | -- | -- |
| <img src="/gif/canvas/path.jpg" height="500px"/> | <img src="/gif/canvas/path_operation.jpg" height="500px"/> | <img src="/gif/canvas/drawscope_helpers.jpg" height="500px"/> |
- [ViewPager] - Contains Horizontal Pager, Horizontal Pager with Tabs, Horizontal Pager with Indicator, Vertical Pager with Indicator, Pager with Zoom-in Transformation, Pager with Fling Behavior and Add/Remove Pager examples.

| Canvas + Touch | Blend Modes | Basic Example |
| -- | -- | -- |
| <img src="/gif/canvas/canvas_and_touch.jpg" height="500px"/> | <img src="/gif/canvas/blendmode.jpg" height="500px"/> | <img src="/gif/canvas/basic_example.jpg" height="500px"/> |

| Android 11 Easter Egg |
| -- |
| <img src="/gif/canvas/android_easter_egg.gif" height="500px"/> |

## Google Maps

| Basic | Marker | Polyline |
| -- | -- | -- |
| <img src="/gif/map/basic_map.gif" height="500px"/> | <img src="/gif/map/marker.jpg" height="500px"/>| <img src="/gif/map/polyline.jpg" height="500px"/>

| Polygon | Circle | Ground Overlay |
| -- | -- | -- |
| <img src="/gif/map/polygon.jpg" height="500px"/> | <img src="/gif/map/circle.jpg" height="500px"/>| <img src="/gif/map/ground_overlay.jpg" height="500px"/>

| Tile Overlay | Indoor Level | Lite Map |
| -- | -- | -- |
| <img src="/gif/map/tile_overlay.jpg" height="500px"/> | <img src="/gif/map/indoor_level.jpg" height="500px"/>| <img src="/gif/map/lite_map.jpg" height="500px"/>

| Place Picker | Navigation Viewer | Projection |
| -- | -- | -- |
| <img src="/gif/map/place_picker.jpg" height="500px"/> | <img src="/gif/map/navigation_viewer.gif" height="500px"/>| <img src="/gif/map/projection.jpg" height="500px"/>

| Cluster | Heat Map | KML |
| -- | -- | -- |
| <img src="/gif/map/cluster.jpg" height="500px"/> | <img src="/gif/map/heat_map.jpg" height="500px"/>| <img src="/gif/map/kml.jpg" height="500px"/>

| GeoJSON | ScaleBar | Snapshot |
| -- | -- | -- |
| <img src="/gif/map/geo_json.jpg" height="500px"/> | <img src="/gif/map/scale_bar.gif" height="500px"/>| <img src="/gif/map/snapshot.jpg" height="500px"/>

| Map in scrollable view | Compose Map In XML |
| -- | -- |
| <img src="/gif/map/map_in_scrollable_view.jpg" height="500px"/> | <img src="/gif/map/compose_maps_in_xml.jpg" height="500px"/> |

## ViewPager

| Horizontal Pager | Horizontal Pager with Tabs | Horizontal Pager with indicator |
| -- | -- | -- |
| <img src="/gif/ViewPager/horizontal_pager.gif" height="500px"/> | <img src="/gif/ViewPager/horizontal_page_with_tab.gif" height="500px"/> | <img src="/gif/ViewPager/horizontal_pager_with_indicator.gif" height="500px"/> |

| Vertical Pager with indicator | Pager with Zoom-in</br>transformation | Pager with Fling Behavior |
| -- | -- | -- |
| <img src="/gif/ViewPager/vertical_pager_with_indicator.gif" height="500px"/> | <img src="/gif/ViewPager/pager_with_zoom_in_transformation.gif" height="500px"/> | <img src="/gif/ViewPager/pager_with_fling_behavior.gif" height="500px"/> |

| Add/Remove pager |
| -- |
| <img src="/gif/ViewPager/add_remove_pager.gif" height="500px"/> |
## What you'll need

## Coming Up
- Navigation
- Theme enhancement
- [Latest Stable Android Studio](https://developer.android.com/studio)
- [Google Maps Key](https://developers.google.com/maps/documentation/android-sdk/get-api-key) - Learn how to create and use API key for Maps SDK integration.
- [Setup Google Maps API Key](pages/GoogleMaps.md)

## Our Libraries in JetPackCompose

- [SSJetPackComposeProgressButton](https://github.com/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton) : SSJetPackComposeProgressButton is an elegant button with a different loading animations which makes your app attractive.
- [SSJetpackComposeSwipeableView](https://github.com/SimformSolutionsPvtLtd/SSJetpackComposeSwipeableView) : SSJetpackComposeSwipeableView is a small library which provides support for the swipeable views. You can use this in your lazyColumns or can add a simple view which contains swipe to edit/delete functionality.
- [SSComposeOTPPinView](https://github.com/SimformSolutionsPvtLtd/SSComposeOTPPinView) : A custom OTP view to enter a code usually used in authentication. It includes different types of OTPViews which is easy to use and configure your own view and character of OTP using all the attributes.
- [SSCompose-CustomInfoBar](https://github.com/SimformSolutionsPvtLtd/SSCompose-CustomInfoBar) : This Jetpack Compose library offers a powerful and customizable way to display informative messages within your app.
- [SSCompose-FurniCraftAR](https://github.com/SimformSolutionsPvtLtd/SSCompose-FurniCraftAR) : This demo is created using Jetpack compose and Google Filament and ARCore for seamless 3D model rendering in AR view. In which users can browse a list of furniture products, select a product to view in AR, customize the color of the model, capture the AR scene with the placed furniture model, and share it with others.

## Official Documentations

- [Jetpack Compose](https://developer.android.com/jetpack/compose)
- [Jetpack Compose Pathways](https://developer.android.com/courses/pathways/compose)
- [Jetpack Compose Samples](https://github.com/android/compose-samples)

## Find this samples useful? ❤️

Support it by joining __[stargazers]__ for this repository.⭐

## How to Contribute🤝
Expand All @@ -191,9 +67,11 @@ Whether you're helping us fix bugs, improve the docs, or a feature request, we'd
Check out our __[Contributing Guide]__ for ideas on contributing.

## Bugs and Feedback

For bugs, feature requests, and discussion please use __[GitHub Issues]__.

## Awesome Mobile Libraries

- Check out our other available [awesome mobile libraries](https://github.com/SimformSolutionsPvtLtd/Awesome-Mobile-Libraries)

## Main Contributors
Expand All @@ -217,32 +95,23 @@ For bugs, feature requests, and discussion please use __[GitHub Issues]__.
<br/>

## License
```
MIT License
Copyright (c) 2022 Simform Solutions
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)
[git-repo-url]: <https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook.git>
[stargazers]: <https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook/stargazers>
[Contributing Guide]: <https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook/blob/main/CONTRIBUTING.md>
[GitHub Issues]: <https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook/issues>
Distributed under the MIT License. See [LICENSE] for details.

<!-- Links -->
[git-repo-url]: https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook.git
[stargazers]: https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook/stargazers
[Contributing Guide]: https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook/blob/main/CONTRIBUTING.md
[GitHub Issues]: https://github.com/SimformSolutionsPvtLtd/SSComposeCookBook/issues

<!-- Preview pages -->
[LICENSE]: /LICENSE
[UI Components]: ./pages/Components.md
[List]: pages/List.md
[Pull To refresh]: pages/PullToRrefresh.md
[Swipe To Delete]: pages/SwipeToDelete.md
[Constraint Layout]: pages/ConstraintLayout.md
[Animation]: pages/Animation.md
[Sample Instagram UI]: pages/InstagramCloneUI.md
[Canvas]: pages/Canvas.md
[Google Maps]: pages/GoogleMaps.md
[ViewPager]: pages/ViewPager.md
88 changes: 88 additions & 0 deletions pages/Animation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Animation

The Animations section of the Jetpack Compose Cookbook is designed to enhance your app's user experience with dynamic and engaging animations. Jetpack Compose provides a flexible and intuitive API to create a range of animations, making your UI elements not only interactive but also visually appealing.

| Basic | Content | Gesture |
| -- | -- | -- |
| <a href="/app/src/main/java/com/jetpack/compose/learning/animation/BasicAnimation.kt#L49" target="_blank"><img src="/gif/Animation/BasicAnim.gif" height="500px"/></a> | <a href="/app/src/main/java/com/jetpack/compose/learning/animation/contentAnimation/ContentIconAnimationActivity.kt#L65" target="_blank"><img src="/gif/Animation/ContentAnim.gif" height="500px"/></a>| <a href="/app/src/main/java/com/jetpack/compose/learning/animation/GestureAnimationActivity.kt" target="_blank"><img src="/gif/Animation/GestureAnim.gif" height="500px"/></a> |

## Basic Animation

Learn how to create fundamental animations for the actions like:

- [Change in color][AnimateAsStateChangeColor]
- [Change in *color* with *size*][AnimateAsStateChangeColorWithSize]
- [Show or hide composable view][AnimatedVisibilityDemo]
- [Rotation of the view][RotatingSquareComponent]

## Conent Animation

A sudden change in content without animation can be jarring and disrupt the user experience. Discover how to smooth out these transitions with animations:

- [Animate the change in size and content of a composable][ContentWithIconAnimation]
- [Create animations that expand short text into longer content and vice versa][ContentAnimation]
- [FAB Button Expansion and Collapse Animation][TabFloatingActionButton]

These techniques will make content updates feel more seamless and engaging.

## Gesture Animation

Gesture animations bring a touch of fluidity and responsiveness to user interactions. By incorporating animations that react to gestures, you can create a more intuitive and engaging user experience.

- [Implement swipe to delete with animation][SwipeToDelete]

| Infinite | Shimmer | TabBar |
| -- | -- | -- |
| <a href="/app/src/main/java/com/jetpack/compose/learning/animation/InfiniteTransitionActivity.kt#L59" target="_blank"><img src="/gif/Animation/InfiniteAnim.gif" height="500px"/></a> | <a href="/app/src/main/java/com/jetpack/compose/learning/animation/ShimmerAnimationActivity.kt#L54" target="_blank"><img src="/gif/Animation/ShimmerAnim.gif" height="500px"/></a> | <a href="/app/src/main/java/com/jetpack/compose/learning/animation/Tabbar.kt#L68" target="_blank"><img src="/gif/Animation/TabBarAnim.gif" height="500px"/></a> |

## Infinite Animation

Infinite animations provide continuous and seamless effects, ideal for capturing user attention. Let's implement some indefinite animation

- [Change color with animation indefinitely][InfiniteAnimation]

## Shimmer Animation

Shimmer animations add a polished touch to loading states, creating an engaging visual effect while content is being loaded.

- [Learn how to impelement shinmmer effect][ShimmerAnimation]

## TabBar Animation

- [Animate tab bar changes][TabBar]

## Other References

- **[Choose an animation API]** - Decide which animation API fits your needs based on your use case.

- **[Material Design Motion]** - Principles of motion design according to Material Design guidelines, useful for creating consistent and engaging animations.

<!-- Code Links -->

[AnimateAsStateChangeColor]: /app/src/main/java/com/jetpack/compose/learning/animation/basic/ChangeColorAnimationWithState.kt#L27

[AnimateAsStateChangeColorWithSize]: /app/src/main/java/com/jetpack/compose/learning/animation/basic/ChangeColorAnimationWithState.kt#L50

[AnimatedVisibilityDemo]: /app/src/main/java/com/jetpack/compose/learning/animation/basic/VisibilityAnimation.kt#L34

[RotatingSquareComponent]: /app/src/main/java/com/jetpack/compose/learning/animation/basic/RotateViewAnimation.kt#L23

[ContentWithIconAnimation]: /app/src/main/java/com/jetpack/compose/learning/animation/contentAnimation/ContentIconAnimationActivity.kt#L88

[ContentAnimation]: /app/src/main/java/com/jetpack/compose/learning/animation/contentAnimation/ContentAnimation.kt#L40

[TabFloatingActionButton]: /app/src/main/java/com/jetpack/compose/learning/animation/contentAnimation/FabButtonWithContent.kt#L21

[SwipeToDelete]: /app/src/main/java/com/jetpack/compose/learning/animation/SwipeToDelete.kt#L53

[InfiniteAnimation]: /app/src/main/java/com/jetpack/compose/learning/animation/InfiniteTransitionActivity.kt#L59

[ShimmerAnimation]: /app/src/main/java/com/jetpack/compose/learning/animation/ShimmerAnimationActivity.kt

[TabBar]: /app/src/main/java/com/jetpack/compose/learning/animation/Tabbar.kt

<!-- Reference Links -->

[Choose an animation API]: https://developer.android.com/develop/ui/compose/animation/choose-api

[Material Design Motion]: https://m3.material.io/styles/motion/overview
Loading

0 comments on commit e854078

Please sign in to comment.