Jetpack Compose based project, used to stress-testing compose features / integrations and explore non-trivial functionality

Overview

Project containing Jetpack Compose samples

For pagination & network images it uses CATAAS.

Known issues

Navigation-Compose

  • Issue with fast tapping on destination

Paging

  • Can't declare state listeners on the Flow<PagingData> or Pager or similar. We're forced to propagate important events from bottom to top instead of top to bottom. issue

Modal Drawer

  • can't change width, issue
  • can't peek to reveal, issue

Google Maps

Keyboard

  • issue with changing focus on backpress ( affecting OTP sample )
  • issue with adjustPan mode not pinning to the focused textField
  • issue with keyboard being hidden when focus is shared between composables & views

Miscellaneous

  • We can't drop usage of liveData completely since we can't return stateFlow from the savedStateHandle, also it is still needed for scenarios which cover flow being observed with flatMapLatest ( as a typical scenario for searching by query ). Latter issue
  • drag & drop feature. possible workaround, library
  • there is no out of the box support for scroll bars as of August 19, 2021. Sample for simple cases
  • bottomSheet destination is not preserved by default when navigating to new destination and coming back. Workaround
  • no way to create nested sticky headers. Workaround imo is changing design or making one lvl of the headers as a composable that animates text changes.
  • LazyVerticalGrid seems to be really imperformant and not adviced to use. Instead use combinations of Column + Rows
  • Fling breaks on skipped frames. issue
  • Need to find an alternative to onboarding guides from the view system like these libraries provided: onboardingFlow,TapTargetView,Spotlight

Limitations

  • We're forced to use ProvideWindowInsets composable as a wrapper for composables in fragment based projects
  • There is no way to navigate from composable to fragment & share a navigation graph between them. (not an issue)
  • Deep links might require lot of additional work if we need to open them in a specific bottom bar / drawer tab.
  • Navigating with parcelable object might be causing issues due it's hacky logic
  • We need to use setViewCompositionStrategy when working with fragments
  • Surface composable has issue with elevation overlapping. This is considered a proper behaviour and one of the workarounds would be using Scaffold.

TODO

CameraX

  • investigate crashe on orientation change

Paging ( all cases should be tested with both PagingSource & RemoteMediator versions ).

  • add sample of how to use maxSize
  • scroll to top feature with maxSize (page dropping) enabled.
  • paging with Grids
  • allow modifying lists using selectedIds array, to ensure any modification behaviour is working well & can be properlly restored across PD ( eg. selection, checkboxes )
  • immitate socket updates ( eg. stock price updates or smth )
  • check out if it's a bug or misconfiguration inside paging+room sample. Upon entering the screen we're fetching twice.

Pager

  • check & fix bad performance on viewPager sample.
  • check & fix/file issue with scroll indicator going only to the right side upon swiping. video
  • add tab indicator animation like on google weather application.

Snap behaviour ( seems there is already WIP on it and it might be available on accompanist soon

  • simple snap like in pager (for lazyColumns/rows)
  • snap to X items, eg. snap to 3 visible items
  • grid snapping

Uncategorized

  • spinners with a lot of items like country flags etc.

  • Container transformations. eg. small circle from bottom end of the screen floats to the center of the screen and changes it's size. Both back& forward animations should be flawless and tested across PD.

  • Hide bottomBar on scroll

  • Animations typical for iOS. can be found in olx, monobank. When we scroll something, toolbar changes content relatively to some text/icon being scrolled behind the toolbar

  • Draw / hide something using coordinates. Look into onGloballyPositioned modifier

  • How to do custom shapes ripples

  • Complex motion layout example ( currently it supports only 2 states so might be left for later )

  • Staggered grid example

  • circular reveal upon changing theme

  • cool transformation animations in google owl sample

  • https://github.com/Skyyo/drawing-floating-objects-inside-view in compose

  • compose with ad mob

  • enhance parallax sample, show how to add snapping behaviour

  • add more animate on scroll animations

  • add on scroll animation using animatable DP

  • App bar auto elevation for dark theme sample

  • draggable sample like here. Sample which allows to drag elements in 1 screen from top, right & bottom for example.

  • exoplayer sample with gestures like here

  • check if exoplyaer sample with indexes is reliable when used with paging library

  • memory leaks in compose section

  • add flexible autocomplete & auto-fill sample/samples

  • add reselect bottomBar tab listener and dispatch this event to the composable.

  • try out media3 and think whether it makes sense, and what are its strong sides

    License

MIT License

Copyright (c) 2021 Denis Rudenko

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.```
Comments
  • Android13 changes

    Android13 changes

    • new google API to handle in-app language changes
    • simple backup configuration
    • new savedstatehandle to get/set StateFlow's from it
    • ability to test changes with fragments
    • ability to pick 1/multiple images from gallery
    • 2 helper methods to observe changes, made by other fragments, and to get savedhandle to make this changes
    • use hiltViewModel() method instead of "by viewModels" helper method in compose fragment
    opened by ahamula 2
  • media3 integration, handle audio focus gain/lost

    media3 integration, handle audio focus gain/lost

    Media3 pros:

    • same player interface, which ease switching from playing in activity to playing in service
    • out of the box integration with wear watches, google assistant, bluetooth headset etc. (by implementing mediasessionservice)
    • exoplayer as core, so switching from exoplayer is straightforward

    Cons:

    • Need to refactor
    • New bugs, such as crashing when playing in mediasessionservice. (which forces to use media metadata+medialibraryservice+mediaitemfiller).
    opened by ahamula 1
  • Fixed drag & drop issue

    Fixed drag & drop issue

    Fixed problem with item below the desired one being dragged. Added feature request link to the readme to improve or completely rewrite this implementation in the future if there will be added any api's for better support of drag & drop.

    opened by Akucuki 0
  • fix bounding box function, get rid of extensions, copied from imported libraries

    fix bounding box function, get rid of extensions, copied from imported libraries

    Before: Screenshot_1662465219 After: Screenshot_1662465166

    As you can see, there are 2 bugs in current getBoundingBoxes implementation:

    • Outer composable (column in our case) take full screen width, except of padding 20.dp, but bounding boxes are much far away from right than from left
    • There is precision loose which you can find on screenshots for "filled blue" spans, so box for "the parts" are not aligned.

    If you still need this "trim box to width" functionality, than maybe we can mix implementations, but better idea would be to create feature request to TextField composable (more precisely to TextLayoutResult) to return trimmed bounding boxes (for example with next function TextLayoutResult.getPathForRange(start, end, trim: Boolean)

    opened by ahamula 0
  • Added user interaction tracking timer

    Added user interaction tracking timer

    & interaction idling result screen. To test - change session idling time constants inside the activity to small values. ~~(Differs a bit from prepay version)~~

    opened by Akucuki 0
  • Updated dependencies

    Updated dependencies

    Updated dependencies, fixed permanent bottom sheet crash & fixed issue when the screen does not fill the full height and navigation buttons remain visible after navigation

    opened by Akucuki 0
  • Enhance memory consumption with

    Enhance memory consumption with "collectAsStateWithLifecycle"

    When UI isn’t visible and collectAsStateWithLifecycle instead of collectAsState - flows on the UI layer will stop being collected, thus - freeing up resources. Dependency below is needed to access this new API: implementation "androidx.lifecycle:lifecycle-runtime-compose:2.6.0-alpha01"

    opened by Skyyo 0
  • Custom text underlines spans

    Custom text underlines spans

    https://user-images.githubusercontent.com/25201623/186685426-0e9da37f-c432-4f96-9311-ab833c02d0b6.mp4

    Old:

    https://user-images.githubusercontent.com/25201623/186155022-5cfe6b08-2a20-4206-9058-d9545dce19da.mp4

    opened by Akucuki 0
  • Swap .forEach with .fastForEach

    Swap .forEach with .fastForEach

    Always use fastForEach, fastMap, fastFirstOrNull and other API's for optimised iteration through collection, since it doesn't allocate an iterator like forEach. Beware: never use it with LinkedList, 3d party libraries or other non-common collections without ensuring it works faster and isn't bugged out.

    enhancement good first issue 
    opened by Skyyo 0
  • Fix Composables which take Collections as params from being unstable

    Fix Composables which take Collections as params from being unstable

    There are 2 ways of fixing it:

    1. immutable collections from kotlinx.collections,which has a related issue which even further discourages from using them;
    2. generic immutable wrapper.

    We will use the second approach on this project (since it's a lesser evil) until a better solution surfaces. You can find the class you want to drop in the project in this gist After that, track all Composables which take List, Map as a param (usually thats all we use but consider other Collections as well) and collect them using collectAsStateWithLifecycleImmutable instead of collectAsStateWithLifecycle

    enhancement help wanted good first issue 
    opened by Skyyo 0
  • dropdown improvements

    dropdown improvements

    add implementation of dropdown from puff project with next improvements:

    • hide dropdown when scroll started
    • add ability to type into auto complete text field
    • fix potential issue with focus lost when typing in exposed dropdown menu on samsung devices
    opened by ahamula 0
  • Added baseline profile

    Added baseline profile

    Added Macrobenchmark module. Added basic Macrobenchmark baseline profile generator for startup speed improvement & sample generated baseline profile file itself. Disabled Venom due to a problem with resolving its dependency by benchmark module

    Running Macrobenchmark tests requires a real device. Benchmark app startup results with different startup modes (cold, warm, hot) and compilation modes (partial with baseline profile, no compilation, full compilation, partial compilation without baseline profile):

    Screenshot from 2022-09-16 17-13-02 Screenshot from 2022-09-16 17-20-41 Screenshot from 2022-09-16 13-57-26

    The most representative is a comparison between the partial with baseline profile and partial compilation without baseline profile. The full pre-compilation represents the best possible performance which is available in 21 to 23 API levels by default. The no compilation mode represents the worst-case scenario which is not very realistic but gives the idea of how partial pre-compilation with baseline profile affects performance by itself.

    Before library update and with only 10 tests iterations

    image image image

    opened by Akucuki 0
Owner
Denis Rudenko
Denis Rudenko
Preference functionality for Jetpack Compose

ComposePreferences Compose Preferences is a library which makes it easy to add preference functionality to your Compose app. It provides an easy to us

Niklas Schnettler 59 Jan 4, 2023
A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.

Multiplatform Compose A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many comp

Clément Beffa 548 Jan 7, 2023
Super Heroes Kata implemented using Jetpack Compose and Screenshot Testing.

KataSuperHeroes with Jetpack Compose We are here to learn about Jetpack Compose. We are going to use Jetpack Compose Testing Tools to interact with th

Karumi 18 Dec 15, 2022
Jetpack Compose performance testing

Jetpack Compose performance testing ( ?? WIP) ?? Disclaimer This project is not official, and the information is provided as-is. All test cases descri

Sergey Yaremych 16 Jun 17, 2022
Jetpack Compose performance testing

Jetpack Compose performance testing

Sergey Yaremych 16 Jun 17, 2022
Sample repo that demonstrates various options for testing Jetpack Compose applications.

Composing With Confidence This is the sample repository for the Composing With Confidence presentation from Droidcon NYC in 2022. If you run the sampl

Adam McNeilly 9 Dec 2, 2022
ComposeTextBug - Issue with MotionLayout+Compose in Text functionality

ComposeTextBug Issue with MotionLayout+Compose in Text functionality Demo: devic

Yahor 0 Jan 12, 2022
Dynamic Badge with customizable features as max number before displaying with +, color, shadow, border, corner radius, font properties and more written with Jetpack Compose

✏️?? Dynamic Badge with customizable features as max number before displaying with +, color, shadow, border, corner radius, font properties and more written with Jetpack Compose. Displays numbers either in circle or rounded rectangle shape based on badge count and selected threshold to transform from circle to rounded rectangle.

Smart Tool Factory 4 Jul 27, 2022
An android library to highlight different features of the app built using Jetpack Compose.

An android library to highlight different features of the app built using Jetpack Compose.

Canopas Software 230 Dec 23, 2022
OTPView is a view made in Jetpack compose. It is highly customisable and can be used to show OTP view with different length and shapes.

OTPView OTPView is a highly costumizable OTP view made in the Jetpack compose UI. Usage: CircleOtpView is a sample composable that calls the OtpView w

kunalsale 17 Aug 4, 2022
Stock Ticker / Watchlist App being used as an excuse to learn Compose and other Jetpack libs.

StockTicker App Simple app that displays a few FAANG stock tickers and allows the user to search for and add different tickers to a watchlist. API Key

Alex Hart 2 Aug 26, 2022
Glance Experimental Tools aims to supplement Jetpack Glance with features that are commonly required by developers but not yet available.

Glance Experimental Tools ?? Work in-progress: artifacts not available yet This project aims to supplement Jetpack Glance with features that are commo

Google 96 Dec 25, 2022
GraphQL based Jetpack Compose and SwiftUI Kotlin Multiplatform project

MortyComposeKMM Kotlin Multiplatform sample that demonstrates use of GraphQL + Jetpack Compose and SwiftUI

John O'Reilly 293 Dec 24, 2022
This app can be used to track open slots for vaccination. This is built using Jetpack Compose.

Covid Vaccine This projects used the Cowin APIs provided by the government. Screenshots Tech Stack Used Kotlin Dagger Hilt Clean Architecture with Mod

Himanshu Singh 101 Dec 15, 2022
A Collection of major Jetpack compose UI components which are commonly used.🎉🔝👌

SSComposeCookBook A Collection of major Jetpack compose UI components which are commonly used. Introduction Jetpack Compose is a modern toolkit for bu

Simform Solutions 370 Dec 28, 2022
A Jetpack Compose component used for displaying Markdown-formatted text.

MarkdownText A library for displaying Markdown contents within Jetpack Compose. Uses Coil Current limitations Lists that are annotated with the * must

Arnau Mora 4 Dec 15, 2022
android project based on declarative UI (jetpack compose)

jetpack_compose_mvvm jetpack compose Coroutines and flows Dependency Injection with Koin Library. Model View Intent Architecture - MVI. Clean Architec

null 1 Apr 8, 2022
A library that adds useful features for Compose Desktop apps

Desktopose This is a set of utilities and components meant to help with developing desktop apps that use Compose for Desktop library. It contains the

Szeweq 3 Nov 21, 2022
A playground to showcase cool IDE features.

Let the IDE do that for you It's not being lazy if it makes you more productive ??️ Sebastiano Poggi Lead on Package Search at JetBrains Android, Flut

Sebastiano Poggi 13 Oct 7, 2022