SubhamTyagi / Last-Launcher

Lightweight: Faster than light, Low on memory
GNU General Public License v3.0
166 stars 51 forks source link

Color generation companion app #41

Open renyuneyun opened 4 years ago

renyuneyun commented 4 years ago

In the discussion of #2, there is a consensus (?) of having a companion app (ColorSniffer) to determine the app colors. I'm opening this issue thread for general discussion of the interaction between Last Launcher and the companion app and tracking related issues.

Possibly related (i.e. may be solved by the companion app) issues:

Discussions and questions in the following posts.

renyuneyun commented 4 years ago

The first question is: how does Last Launcher (want to) interact with the companion app?

  1. [x] Currently ColorSniffer can export the color schema to clipboard. If this approach is used, Last Launcher also needs to support import from clipboard.
  2. [x] A potentially more intuitive way is to pass information through startActivityForResult(). The companion app returns the data through the Intent. There are two possible approaches:
    1. wrap the data as string, and parse it in Last Launcher
    2. use the app launcher names as keys, and put the color as values
  3. [ ] A more extended extra possibility is to allow to call the "set color scheme" listener in Last Launcher from the companion app, so the interaction starts from the companion app (other than Last Launcher setting page)

Support in Last Launcher:

  1. [ ] Clipboard import
  2. [ ] Use startActivityForResult()
  3. [ ] Call Last Launcher to change color scheme
SubhamTyagi commented 4 years ago

Currently ColorSniffer can export the color schema to clipboard. If this approach is used, Last Launcher also needs to support import from clipboard.

Although it is straightforward but It is not a long time approach, Android 11... or newer version might removed this. Keep this feature alive in your app i will also work on this. Could you provide and unique string before the DATA to validate its sources.

A more extended extra possibility is to allow to call the "set color scheme" listener in Last Launcher from the companion app, so the interaction starts from the companion app (other than Last Launcher setting page)

Both way interaction is better than one way.

A potentially more intuitive way is to pass information through startActivityForResult()The companion app returns the data through the Intent. ii. use the app launcher names as keys, and put the color as values

👍 could you also provide A DEFAULT COLOR for rest of the Apps.

SubhamTyagi commented 4 years ago

I have make the some changes to app in which app sending some data

  1. Default Color integer (key: default_color_for_apps) current theme font color
  2. if possible, will send Theme related data

and app is receiving the following data

  1. A Bundle with key color_bundle
    which contain the all data i. if user set the default color in Color Sniffer then Bundle have the default color for all others app (same key as above) else it have valuenull or -1 ii. color values as proposed by you

Clipboard id for validate it sourcebae73ae068dacc6cb659d1fb231e7b11 i.e LastLauncher-ColorSniffer MD5-128

https://github.com/SubhamTyagi/Last-Launcher/blob/41bce292f7ef8e344e54bf9a4733e3178f57fe78/app/src/main/java/io/github/subhamtyagi/lastlauncher/LauncherActivity.java#L517

https://github.com/SubhamTyagi/Last-Launcher/blob/41bce292f7ef8e344e54bf9a4733e3178f57fe78/app/src/main/java/io/github/subhamtyagi/lastlauncher/LauncherActivity.java#L531

renyuneyun commented 4 years ago

I didn't find any information about why Android would remove clipboard. The only source I found was Android 10 changes, but it does no harm to this usage: both apps will be in front ground when accessing clipboard.

Anyway, your specification matches my expectation too. I'm making changes according to it.

SubhamTyagi commented 4 years ago

I didn't find any information about why Android would remove clipboard. The only source I found was Android 10 changes

it is a possibility and We didn't trust Google behaviour

renyuneyun commented 4 years ago

How about passing the "default color" like this?:

This makes a further extension more intuitive:

SubhamTyagi commented 4 years ago

Last Launcher can maintain a list of apps whose color will be kept as "default". This list can be passed to ColorSniffer and the user can respect or change. Finally, this list will be passed back to Last Launcher. (I suggest to use key use_default_color and pass a String array through putStringArray()/getStringArray().)

i will pass the app list which will keep as "unchanged" color, and you can exclude these apps when passing the bundle to last launcher.

@renyuneyun ?

TheLastProject commented 4 years ago

I must say that I don't quite understand why this would be done as an external app instead of just having the built-in random colour generation instead use the app name as an "input hash" so it always generates the same colour for each app name, I do want to state my support in having the colours remain the same always for each app, makes looking for the right app much much faster.