erdo / android-fore Goto Github PK
View Code? Open in Web Editor NEWandroid fore - thinner view layers (and rotation for free)
Home Page: https://erdo.github.io/android-fore
License: Apache License 2.0
android fore - thinner view layers (and rotation for free)
Home Page: https://erdo.github.io/android-fore
License: Apache License 2.0
The kotlin class co.early.fore.kt.retrofit.CallProcessor
doesn't use the ForeDelegateHolder yet (see here for example usage)
see https://developer.android.com/reference/kotlin/androidx/compose/runtime/livedata/package-summary for the LiveData example
...rather than relying on the tests for the sample apps
Ignore or fix as appropriate
The SyncActivityX and SyncFragmentX classes don't currently implement the secondary constructor from their parent class that takes a default layout resource:
androidx.fragment.app.AppCompatActivity
public AppCompatActivity(@LayoutRes int contentLayoutId)
and
androidx.fragment.app.Fragment
public Fragment(@LayoutRes int contentLayoutId)
Would be good if they did
Currently in fore, adding and removing observers always happens on the UI thread (because that's where the lifecycle methods like onPause run). That's also the case when using fore's observeAsState() extension function with Compose, however there is the possibility that future versions of compose will run composables from non-UI threads
From this blog post https://jorgecastillo.dev/jetpack-compose-effect-handlers
In the future, compositions could be potentially offloaded to different threads, executed in parallel, in different order, or similar things. That’s a door for diverse potential optimizations the Compose team wants to keep open
I think it's debatable the thread thing will actually happen (there's a reason most UI platforms don't do that), but if it does happen we need to make sure that adding and removing observers still works flawlessly and still remains testable (so in fore that means taking in to account the WorkMode)
Make sure nothing breaks (run all the sample app tests)
At the moment the trigger is only reset if a subsequent call to checkThreshold() returns false.
Sometimes it's convenient to just have the trigger immediately reset, without having to wait for a subsequent call to checkThreshold() that returns false.
We should be able to configure SyncTrigger to operate in either mode
done
get ready for Android Gradle Plugin 8.0
see: https://developer.android.com/studio/publish-library/configure-pub-variants
I think there will be a few (since moving the sample apps to their own folder)
Get the last two ignored tests for the core observables code working with Robolectric (or other solution) - code is correct, but the tests are not
similar to the retrofit integration, so maybe a new package :fore-apollo-kt
have a think about what to do for fore-kt (do we want to move the dependency on retrofit out of there?) so something like in a client app:
implementation("co.early.fore:fore-kt:1.2.1")
implementation("com.squareup.retrofit2:retrofit:a.b.c")
and
implementation("co.early.fore:fore-kt:1.2.1")
implementation("com.apollographql.apollo:apollo-runtime:a.b.c")
ProGuard error when building release version or during obfuscation:
Warning unexpectedly contains class
Warning there were classes in incorrectly named files
You should make sure all file names correspond to their class names
The directory hierarchies must correspond to the package hierarchies
fore 1.2.1 upgrades kotlin to 1.4 (and also references io.arrow-kt:arrow-core-data:0.10.5, which also upgraded to kotlin 1.4), if your project has not upgraded to kotlin 1.4 yet, you might encounter this when building releases
You can use 1.2.1-legacy-KOTLIN-1.3.x from the legacy branch which is the same as 1.2.1 but built with kotlin 1.3.72 (...put an actual x, don't replace the x with 72! see jcenter)
implementation("co.early.fore:fore-kt:1.2.1-legacy-KOTLIN-1.3.x")
implementation("co.early.fore:fore-core-kt:1.2.1-legacy-KOTLIN-1.3.x")
implementation("co.early.fore:fore-adapters-kt:1.2.1-legacy-KOTLIN-1.3.x")
implementation("co.early.fore:fore-retrofit-kt:1.2.1-legacy-KOTLIN-1.3.x")
fore 1.4.2 and above requires Multi-version jar support
minimum versions required in your app:
gradle 6.1.1
gradle android build tools 4.0.0
If you see this when building the project:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by retrofit2.Platform
it's related to JAVA_11, basically it's not a problem but you can upgrade to JDK 14 if you wish to get rid of the warning
The class co.early.fore.kt.retrofit.InterceptorLogging
is implemented in java, would be better if it was implemented in kotlin and using ForeDelegateHolder (see also this issue)
Work out how can we add tabbed kotlin/java code examples in markdown docs so that it's easy to see examples in either kotlin or java according to preference. Will need to survive the transformation from mark down file to html that jekyll does for github pages.
You might see this on 1.5.13 with a Java 1.8 project, because I unintentionally increased the module variant attribute: org.gradle.jvm.version to 11, either upgrade your project to Java 11 compatibility or just bump the fore version to 1.5.14 or later (where the issue is fixed)
The current kotlin examples do everything the long way so that it's super clear what's going on (adding / removing observers in onResume / onPause for example) - I think it's probably time to use the lifecycle observers to remove this boiler plate - over the years the observer pattern has become much more familiar to the average android developer, so I think we don't really need to be so careful to explain all the details in the sample apps. The style used in the external samples might be more appropriate (see https://github.com/erdo/persista/blob/main/example-app/src/main/java/foo/bar/example/ui/wallet/WalletsActivity.kt )
work out how we can build an .aar file that has all the fore code in it in one package. fore-everything to include:
fore 1.4.2 and above requires Multi-version jar support
minimum versions required in your app:
gradle 6.1.1
gradle android build tools 4.0.0
similar to this issue: #99
The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding)
done
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.