-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collaboration between screen filter app devs #222
Comments
I think a library for screen filtering would be very useful. Sounds like fun to work on :D My app lacks a lot of functionality, I would love to somehow merge it in to a more fleshed-out app. |
Thank you for organizing a collaboration. I'm glad to share idea about my open source apps with people. Although I might not migrate my app to some new library, I would support your work! |
So far it seems like there's more interest in libraries. I would slightly prefer merging, because:
However, merging is be a big step to take, especially since most of us have not worked together at all yet, and I'd rather collaborate on a library than not collaborate at all. That would also be a good way for us to get comfortable working together, and we could always decide to merge later. |
Some ideas I had for libraries are:
If we really wanted to go all the way, we could make a single library that handles the entire backend (everything above, keeping track of state, etc). Then we'd just maintain our separate UIs (simpler vs more customizable, etc). How do any of those ideas sound to you? |
I definitely agree that merging the UIs would ease development, but people have different ideas of what makes a good UX.
|
I think our situation is a bit unique, since
Plus, none of us actually have this feature, so it would be useful to all of us :)
I'd guess, by ignoring values it doesn't use. Let's decide which library to start with, first.
Like, we could all respond to the same type of intent broadcast, instead of the current way where it's specific to Red Moon. Honestly it might make more sense for this to just be a spec we agree on, than a library, since it's pretty simple to implement. |
Library seems a nice idea.
Nice. This is something that is common in all of the apps here. I guess we could start off by this?
Ok, I don't know about others but implementing KCAL is easy (surfaceflinger seems easy too, what about overlays?), and since this is where the apps differ, for now I would keep it specific to app (and later think about generalizing it).
We would need a common way for those apps to interact with ours. Would be pretty interesting to implement, but yeah this would be nice. Also, how about having a library for color related stuff? Like RGB calculation for a color temperature and all those stuff? A small but useful helper sort of... About commonizing UI, how about having common UI elements rather than UI itself? Like a SeekBar specifically made for dealing with color temperature inputs and maybe having a link with a TextView or EditText to show the values? |
Will this library include a implementation of And, although Kotlin is one of the most popular Android development languages, it's not suitable for a library project. We know that developers will be forced to implement Kotlin standard libraries if library dependecies use Kotlin. It may increase install package size by at least 100KB. To guarantee developers' choice, just use Java. (Java 8 is also okay. Lambda helps us improve coding performance.) |
That's a good point. I like Kotlin, but it shouldn't be that painful to use Java for shared libraries. Of course, if it's something @corphish and I want but you don't care about, we could write it in Kotlin, or share code instead of making a library. Scheduling / fading
I agree that this seems like the easiest one to start with, since it's pretty small scope. I described the part that makes it hard on stackexchange when I was originally grappling with how to handle fading. I was thinking the library interface would be a fairly thin wrapper around AlarmManager and ValueAnimator. Something like:
We could also definitely simplify the AbstractAnimatorListener interface, if you'd prefer that to staying closer to the Android animation api. Filtering library
I don't think any of them are difficult, particularly since we already have working implementations. The complexity comes from things like:
For what it's worth, about a year ago @joonatoona and I were looking into implementing surfaceflinger into Red Moon, so a lot of the ground work for this is already done. A lot of the complexity here comes from trying to maintain a consistent UX across filtering methods. For example, surfaceFlinger requires opening a root shell, which is slow. Red Moon fades in over half a second, instead of starting at full strength immediately, and opening a new shell each time might not be feasible. @joonatoona was looking into things like opening a shell and then passing new values to it using a named pipe; I don't honestly remember what the outcome of that was (@joonatoona, do you?). Due to that complexity, I agree that this is not the best place to start. However, I think it would be really valuable to have eventually. Different methods have trade-offs that make them ideal for different people — for example, surfaceFlinger is strictly better than overlay… but only if you have root, which many people don't.
Agreed. @joonatoona and I ended up with something like this: interface Filter {
fun start()
fun setColor(profile: Profile)
fun stop()
} We'd probably need to modify it a little since our apps use different representations of the filter settings (Red Moon has 3 settings, Night Screen has 2, not sure what Night Light uses since I don't have root to check). Color LibraryThat sounds useful. Red Moon's current calculations are here. I don't think we ever got around to converting between the values in Red Moon's profile and what's needed for the surfaceFlinger call. I think @raatmarien might have planned on looking into that? Seekbar / UI elementsThe whole Red Moon UI is built using preference screens, I suspect it'll be a bit difficult to share, unless Night Light is, too. That said, it does have a SeekBarPreference that's close to what you're describing. |
I'm starting on the timer library. Does the interface I proposed sound good to you? (edit: we'll need a context in there, too) To start, I just made a new branch in this repo; when I have anything worth sharing, I'll move it out to its own repo and make you all maintainers (is everyone okay with having it under the LibreShift organization? Any good ideas for a name?). |
I haven't had that much time, but I'm close to a proof-of-concept implementation. The interface now looks like: public int schedule(Context context, Animator animator, long startAtMillis) I did it this way since we all have separate representations of a profile, so we might as well let the Android animation framework do the work of calculating intermediate values instead of doing it ourselves. |
@corphish @fython How would you like me to share the code when I'm ready? I think it would make sense to put in its own repo and publish to jcenter, but I'm not sure what namespace to use (right now it's just The other option is to keep it where it is right now, as a new library module in Red Moon. However, we'll have to figure out a namespace eventually, so I think I'd rather just do that now. |
Yeah having it in its own repo seems fine. |
Any suggestions for a name? (edit: repo name and package name) |
|
I could buy a domain to use as a namespace; |
Its not really a transition manager, is it? |
I was thinking of Android's |
I made https://github.com/LibreShift/TransitionScheduler and pushed what I have so far. Obviously still a work in progress, with many I used |
It might be easier to create new issues in that repo than in this thread, which is already quite long. |
Thanks for sharing push access. If I catch my own idea or want to make some changes, I will send a pull request or an issue before pushing to |
Closing this since we have a new repo to make issues on, now. |
On f-droid, there are 3 screen filter apps that all do more or less the same thing:
And some apps that have partial overlap:
It seems like a waste of effort to have so many of us working independently on the same kinds of issues. Are any of you interested in merging our apps, or collaborating in some other way (eg, refactoring some functionality into libraries we could share)?
edit: We're all GPLv3 (or GPLv3+), so we can freely combine our code.
The text was updated successfully, but these errors were encountered: