Skip to content
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

theming: respect user current color scheme #1592

Merged
merged 3 commits into from
Feb 18, 2024
Merged

theming: respect user current color scheme #1592

merged 3 commits into from
Feb 18, 2024

Conversation

T-Dynamos
Copy link
Collaborator

@T-Dynamos T-Dynamos commented Jan 22, 2024

Description of the problem

Current color scheme generation gets top color from wallpaper. But in Android there are multiple options for wallpaper colors which leads to theme mismatch.

Click to view image

image
Multiple color options

Solution

This PR implements getting color scheme from android api.

image

Also this PR skips color quantization if Android already had done it. So this means we don't need color generation if Android is 8.1 or 8.1+.

test.mp4

Remaning things

Changes done to theming.py are minimal, it may require more changes (you can do it yourself in your own way).

Note: Please wait some time before merging so that testing can be done.

@T-Dynamos
Copy link
Collaborator Author

T-Dynamos commented Jan 22, 2024

Test apk: https://anonymfile.com/4Bxa/playground-6-armeabi-v7a-debug.apk
Test code:

from kivy.lang import Builder
from kivy.metrics import dp
from kivy.clock import Clock
from kivymd.uix.boxlayout import MDBoxLayout
from kivymd.app import MDApp

KV = """
<ColorView>:
    text:""
    color:app.theme_cls.surfaceContainerLowColor
    padding:dp(15)
    MDLabel:
        text:root.text
        padding:dp(10)
    MDBoxLayout:
        md_bg_color:root.color
        radius:[dp(10)] * 4
ScrollView:
    MDBoxLayout:
        adaptive_height:True
        orientation:"vertical"
        MDLabel:
            text:"Dynamic Colors"
            halign:"center"
            size_hint_y:None
            height:dp(100)
"""

class ColorView(MDBoxLayout):
    pass

class MainApp(MDApp):

    def build(self):
        self.theme_cls.theme_style = "Dark"
        self.theme_cls.dynamic_color = True
        return Builder.load_string(KV)
    
    def on_start(self):
        super().on_start()
        Clock.schedule_once(self.add_colors)

    def add_colors(self, instance):
        for color in dir(self.theme_cls):
            if color.endswith("Color"):
                _widget = ColorView( size_hint_y=None, height=dp(70))
                _widget.text = color
                _widget.color = getattr(self.theme_cls, color)
                self.root.children[0].add_widget(_widget)

MainApp().run()

@HeaTTheatR
Copy link
Member

Great! Good job!
But we will be able to merge this PR after I make a push with my local changes. I'll try to do it tomorrow.

@T-Dynamos T-Dynamos marked this pull request as draft January 22, 2024 18:34
@kulothunganug
Copy link
Contributor

Tested on Moto G62:-
Screenshot_20240123-100301
Screenshot_20240123-100313

Color mismatches

@T-Dynamos
Copy link
Collaborator Author

@kulothunganug Thanks for testing!

And yes I am aware of that, I was digging into android's src I and found that color's need to be scored first based on their proportions and then index is selected. But the problem is WallpaperColor doesn't expose any method to get them. Also in order to get all colors, you need to use toString() method and do manual spliting of hex codes ie. there is no direct way.

        /**
         * Filters and ranks colors from WallpaperColors.
         *
         * @param wallpaperColors Colors extracted from an image via quantization.
         * @param filter If false, allow colors that have low chroma, creating grayscale themes.
         * @return List of ARGB ints, ordered from highest scoring to lowest.
         */
        @JvmStatic
        @JvmOverloads
        fun getSeedColors(wallpaperColors: WallpaperColors, filter: Boolean = true): List<Int> {
            val totalPopulation =
                wallpaperColors.allColors.values.reduce { a, b -> a + b }.toDouble()

When I get WallpaperColors from getWallpaperColors().allColors , It fails (no attribute named...).

@T-Dynamos
Copy link
Collaborator Author

T-Dynamos commented Jan 23, 2024

@kulothunganug Can you post the logcat output also?

@kulothunganug
Copy link
Contributor

~ 
❯ adb logcat | rg python
01-23 13:08:14.443  7828  7862 V pythonutil: Unpacking private app
01-23 13:08:14.443  7828  7862 V pythonutil: Data version is e6de18d294c767ed339cc654a692fdc2c6e7ad95
01-23 13:08:14.444  7828  7862 V pythonutil: Unpacking /data/app/~~xWvCRPW8xTQ0CDwLS6iv1w==/org.pyjnius.playground-6GCXGoC_ZyZdKYocFLMlGw==/lib/arm/libpybundle app
01-23 13:08:14.445  7828  7862 V pythonutil: Data version is e6de18d294c767ed339cc654a692fdc2c6e7ad95
01-23 13:08:14.485  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libSDL2_ttf.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libfreetype.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libmain.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libSDL2_mixer.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libSDL2.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libffi.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libc++_shared.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libSDL2_image.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libpython3.11.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libcrypto1.1.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libpng16.so
01-23 13:08:14.486  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libsqlite3.so
01-23 13:08:14.487  7828  7828 V pythonutil: Pattern libsqlite3\.so matched file libsqlite3.so
01-23 13:08:14.487  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libssl1.1.so
01-23 13:08:14.487  7828  7828 V pythonutil: Checking pattern libsqlite3\.so against libpybundle.so
01-23 13:08:14.487  7828  7828 V pythonutil: Checking pattern libffi\.so against libSDL2_ttf.so
01-23 13:08:14.487  7828  7828 V pythonutil: Checking pattern libffi\.so against libfreetype.so
01-23 13:08:14.487  7828  7828 V pythonutil: Checking pattern libffi\.so against libmain.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libSDL2_mixer.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libSDL2.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libffi.so
01-23 13:08:14.488  7828  7828 V pythonutil: Pattern libffi\.so matched file libffi.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libc++_shared.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libSDL2_image.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libpython3.11.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libcrypto1.1.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libpng16.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libsqlite3.so
01-23 13:08:14.488  7828  7828 V pythonutil: Checking pattern libffi\.so against libssl1.1.so
01-23 13:08:14.489  7828  7828 V pythonutil: Checking pattern libffi\.so against libpybundle.so
01-23 13:08:14.489  7828  7828 V pythonutil: Checking pattern libpng16\.so against libSDL2_ttf.so
01-23 13:08:14.489  7828  7828 V pythonutil: Checking pattern libpng16\.so against libfreetype.so
01-23 13:08:14.489  7828  7828 V pythonutil: Checking pattern libpng16\.so against libmain.so
01-23 13:08:14.489  7828  7828 V pythonutil: Checking pattern libpng16\.so against libSDL2_mixer.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libSDL2.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libffi.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libc++_shared.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libSDL2_image.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libpython3.11.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libcrypto1.1.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libpng16.so
01-23 13:08:14.490  7828  7828 V pythonutil: Pattern libpng16\.so matched file libpng16.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libsqlite3.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libssl1.1.so
01-23 13:08:14.490  7828  7828 V pythonutil: Checking pattern libpng16\.so against libpybundle.so
01-23 13:08:14.491  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libSDL2_ttf.so
01-23 13:08:14.491  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libfreetype.so
01-23 13:08:14.491  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libmain.so
01-23 13:08:14.491  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libSDL2_mixer.so
01-23 13:08:14.491  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libSDL2.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libffi.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libc++_shared.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libSDL2_image.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libpython3.11.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libcrypto1.1.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libpng16.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libsqlite3.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libssl1.1.so
01-23 13:08:14.492  7828  7828 V pythonutil: Pattern libssl.*\.so matched file libssl1.1.so
01-23 13:08:14.492  7828  7828 V pythonutil: Checking pattern libssl.*\.so against libpybundle.so
01-23 13:08:14.493  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libSDL2_ttf.so
01-23 13:08:14.493  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libfreetype.so
01-23 13:08:14.493  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libmain.so
01-23 13:08:14.493  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libSDL2_mixer.so
01-23 13:08:14.493  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libSDL2.so
01-23 13:08:14.493  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libffi.so
01-23 13:08:14.493  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libc++_shared.so
01-23 13:08:14.494  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libSDL2_image.so
01-23 13:08:14.494  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libpython3.11.so
01-23 13:08:14.494  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libcrypto1.1.so
01-23 13:08:14.494  7828  7828 V pythonutil: Pattern libcrypto.*\.so matched file libcrypto1.1.so
01-23 13:08:14.494  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libpng16.so
01-23 13:08:14.494  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libsqlite3.so
01-23 13:08:14.494  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libssl1.1.so
01-23 13:08:14.494  7828  7828 V pythonutil: Checking pattern libcrypto.*\.so against libpybundle.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libSDL2_ttf.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libfreetype.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libmain.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libSDL2_mixer.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libSDL2.so
01-23 13:08:14.495  7828  7828 V pythonutil: Pattern libSDL2\.so matched file libSDL2.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libffi.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libc++_shared.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libSDL2_image.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libpython3.11.so
01-23 13:08:14.495  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libcrypto1.1.so
01-23 13:08:14.496  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libpng16.so
01-23 13:08:14.496  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libsqlite3.so
01-23 13:08:14.496  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libssl1.1.so
01-23 13:08:14.496  7828  7828 V pythonutil: Checking pattern libSDL2\.so against libpybundle.so
01-23 13:08:14.496  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libSDL2_ttf.so
01-23 13:08:14.496  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libfreetype.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libmain.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libSDL2_mixer.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libSDL2.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libffi.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libc++_shared.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libSDL2_image.so
01-23 13:08:14.497  7828  7828 V pythonutil: Pattern libSDL2_image\.so matched file libSDL2_image.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libpython3.11.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libcrypto1.1.so
01-23 13:08:14.497  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libpng16.so
01-23 13:08:14.498  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libsqlite3.so
01-23 13:08:14.498  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libssl1.1.so
01-23 13:08:14.498  7828  7828 V pythonutil: Checking pattern libSDL2_image\.so against libpybundle.so
01-23 13:08:14.498  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libSDL2_ttf.so
01-23 13:08:14.498  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libfreetype.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libmain.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libSDL2_mixer.so
01-23 13:08:14.499  7828  7828 V pythonutil: Pattern libSDL2_mixer\.so matched file libSDL2_mixer.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libSDL2.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libffi.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libc++_shared.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libSDL2_image.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libpython3.11.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libcrypto1.1.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libpng16.so
01-23 13:08:14.499  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libsqlite3.so
01-23 13:08:14.500  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libssl1.1.so
01-23 13:08:14.500  7828  7828 V pythonutil: Checking pattern libSDL2_mixer\.so against libpybundle.so
01-23 13:08:14.500  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libSDL2_ttf.so
01-23 13:08:14.501  7828  7828 V pythonutil: Pattern libSDL2_ttf\.so matched file libSDL2_ttf.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libfreetype.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libmain.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libSDL2_mixer.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libSDL2.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libffi.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libc++_shared.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libSDL2_image.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libpython3.11.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libcrypto1.1.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libpng16.so
01-23 13:08:14.501  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libsqlite3.so
01-23 13:08:14.502  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libssl1.1.so
01-23 13:08:14.502  7828  7828 V pythonutil: Checking pattern libSDL2_ttf\.so against libpybundle.so
01-23 13:08:14.502  7828  7828 V pythonutil: Loading library: sqlite3
01-23 13:08:14.503  7828  7828 V pythonutil: Loading library: ffi
01-23 13:08:14.503  7828  7828 V pythonutil: Loading library: png16
01-23 13:08:14.504  7828  7828 V pythonutil: Loading library: ssl1.1
01-23 13:08:14.505  7828  7828 V pythonutil: Loading library: crypto1.1
01-23 13:08:14.506  7828  7828 V pythonutil: Loading library: SDL2
01-23 13:08:14.507  7828  7828 V pythonutil: Loading library: SDL2_image
01-23 13:08:14.508  7828  7828 V pythonutil: Loading library: SDL2_mixer
01-23 13:08:14.509  7828  7828 V pythonutil: Loading library: SDL2_ttf
01-23 13:08:14.511  7828  7828 V pythonutil: Loading library: python3.5m
01-23 13:08:14.514  7828  7828 V pythonutil: Library loading error: dlopen failed: library "libpython3.5m.so" not found
01-23 13:08:14.514  7828  7828 V pythonutil: Loading library: python3.6m
01-23 13:08:14.515  7828  7828 V pythonutil: Library loading error: dlopen failed: library "libpython3.6m.so" not found
01-23 13:08:14.515  7828  7828 V pythonutil: Loading library: python3.7m
01-23 13:08:14.516  7828  7828 V pythonutil: Library loading error: dlopen failed: library "libpython3.7m.so" not found
01-23 13:08:14.516  7828  7828 V pythonutil: Loading library: python3.8
01-23 13:08:14.517  7828  7828 V pythonutil: Library loading error: dlopen failed: library "libpython3.8.so" not found
01-23 13:08:14.517  7828  7828 V pythonutil: Loading library: python3.9
01-23 13:08:14.518  7828  7828 V pythonutil: Library loading error: dlopen failed: library "libpython3.9.so" not found
01-23 13:08:14.518  7828  7828 V pythonutil: Loading library: python3.10
01-23 13:08:14.519  7828  7828 V pythonutil: Library loading error: dlopen failed: library "libpython3.10.so" not found
01-23 13:08:14.519  7828  7828 V pythonutil: Loading library: python3.11
01-23 13:08:14.521  7828  7828 V pythonutil: Loading library: main
01-23 13:08:14.522  7828  7828 V pythonutil: Loaded everything!
01-23 13:08:14.605  7828  7884 I python  : Initializing Python for Android
01-23 13:08:14.605  7828  7884 I python  : Setting additional env vars from p4a_env_vars.txt
01-23 13:08:14.606  7828  7884 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
01-23 13:08:14.606  7828  7884 I python  : /data/user/0/org.pyjnius.playground/files/app
01-23 13:08:14.606  7828  7884 I python  : Preparing to initialize python
01-23 13:08:14.606  7828  7884 I python  : _python_bundle dir exists
01-23 13:08:14.606  7828  7884 I python  : calculated paths to be...
01-23 13:08:14.606  7828  7884 I python  : /data/user/0/org.pyjnius.playground/files/app/_python_bundle/stdlib.zip:/data/user/0/org.pyjnius.playground/files/app/_python_bundle/modules
01-23 13:08:14.606  7828  7884 I python  : set wchar paths...
01-23 13:08:14.626  7828  7828 W SDLThread: type=1400 audit(0.0:9686): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/zlib.cpython-311.so" dev="dm-40" ino=438451 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:14.639  7828  7884 I python  : Initialized python
01-23 13:08:14.639  7828  7884 I python  : AND: Init threads
01-23 13:08:14.639  7828  7884 I python  : testing python print redirection
01-23 13:08:14.640  7828  7884 I python  : Android path ['.', '/data/user/0/org.pyjnius.playground/files/app/_python_bundle/stdlib.zip', '/data/user/0/org.pyjnius.playground/files/app/_python_bundle/modules', '/data/user/0/org.pyjnius.playground/files/app/_python_bundle/site-packages']
01-23 13:08:14.640  7828  7884 I python  : os.environ is environ({'PATH': '/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'ANDROID_ART_ROOT': '/apex/com.android.art', 'ANDROID_I18N_ROOT': '/apex/com.android.i18n', 'ANDROID_TZDATA_ROOT': '/apex/com.android.tzdata', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'DOWNLOAD_CACHE': '/data/cache', 'BOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/tcmiface.jar:/system/framework/qcom.fmradio.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/system/framework/moto-echolocateapi.jar:/system/framework/payjoy-api.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.wifi/javalib/framework-wifi.jar', 'DEX2OATBOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/tcmiface.jar:/system/framework/qcom.fmradio.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/system/framework/moto-echolocateapi.jar:/system/framework/payjoy-api.jar:/apex/com.android.i18n/javalib/core-icu4j.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/com.android.location.provider.jar:/system/framework/services.jar:/system/framework/moto-core_services-systemserver.jar:/system/framework/moto-settings-systemserver.jar:/system/framework/moto-telephony-systemserver.jar:/apex/com.android.adservices/javalib/service-adservices.jar:/apex/com.android.adservices/javalib/service-sdksandbox.jar:/apex/com.android.appsearch/javalib/service-appsearch.jar:/apex/com.android.art/javalib/service-art.jar:/apex/com.android.media/javalib/service-media-s.jar:/apex/com.android.permission/javalib/service-permission.jar', 'STANDALONE_SYSTEMSERVER_JARS': '/apex/com.android.os.statsd/javalib/service-statsd.jar:/apex/com.android.scheduling/javalib/service-scheduling.jar:/apex/com.android.tethering/javalib/service-connectivity.jar:/apex/com.android.uwb/javalib/service-uwb.jar:/apex/com.android.wifi/javalib/service-wifi.jar', 'ANDROID_SOCKET_zygote_seco
01-23 13:08:14.640  7828  7884 I python  : Android kivy bootstrap done. __name__ is __main__
01-23 13:08:14.640  7828  7884 I python  : AND: Ran string
01-23 13:08:14.640  7828  7884 I python  : Run user program, change dir and execute entrypoint
01-23 13:08:14.686  7828  7828 W SDLThread: type=1400 audit(0.0:9687): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/_typing.cpython-311.so" dev="dm-40" ino=452679 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:14.726  7828  7828 W SDLThread: type=1400 audit(0.0:9688): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/math.cpython-311.so" dev="dm-40" ino=319656 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:14.730  7828  7828 W SDLThread: type=1400 audit(0.0:9689): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/_heapq.cpython-311.so" dev="dm-40" ino=157823 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:14.730  7828  7828 W SDLThread: type=1400 audit(0.0:9690): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/_queue.cpython-311.so" dev="dm-40" ino=453246 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:14.746  7828  7828 W SDLThread: type=1400 audit(0.0:9691): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/_opcode.cpython-311.so" dev="dm-40" ino=66371 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:14.767  7828  7884 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.pyjnius.playground/files/app/.kivy/logs/kivy_24-01-23_3.txt
01-23 13:08:14.767  7828  7884 I python  : [INFO   ] [Kivy        ] v2.3.0
01-23 13:08:14.768  7828  7884 I python  : [INFO   ] [Kivy        ] Installed at "/data/user/0/org.pyjnius.playground/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
01-23 13:08:14.768  7828  7884 I python  : [INFO   ] [Python      ] v3.11.5 (main, Jan 20 2024, 16:08:16) [Clang 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0
01-23 13:08:14.768  7828  7884 I python  : [INFO   ] [Python      ] Interpreter at ""
01-23 13:08:14.769  7828  7884 I python  : [INFO   ] [Logger      ] Purge log fired. Processing...
01-23 13:08:14.769  7828  7884 I python  : [INFO   ] [Logger      ] Purge finished!
01-23 13:08:14.774  7828  7884 I python  : [INFO   ] [Factory     ] 195 symbols loaded
01-23 13:08:15.810  7828  7884 I python  : [INFO   ] [KivyMD      ] 2.0.1.dev0, git-c709657, 2024-01-20 (installed at "/data/data/org.pyjnius.playground/files/app/kivymd/__init__.pyc")
01-23 13:08:15.810  7828  7828 W SDLThread: type=1400 audit(0.0:9710): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/_bisect.cpython-311.so" dev="dm-40" ino=449316 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:15.814  7828  7828 W SDLThread: type=1400 audit(0.0:9711): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/_random.cpython-311.so" dev="dm-40" ino=445982 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:15.814  7828  7828 W SDLThread: type=1400 audit(0.0:9712): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/modules/_sha512.cpython-311.so" dev="dm-40" ino=263333 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:15.818  7828  7828 W SDLThread: type=1400 audit(0.0:9713): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/site-packages/kivy/graphics/instructions.so" dev="dm-40" ino=88915 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:15.818  7828  7828 W SDLThread: type=1400 audit(0.0:9714): avc: granted { execute } for path="/data/data/org.pyjnius.playground/files/app/_python_bundle/site-packages/kivy/graphics/buffer.so" dev="dm-40" ino=226533 scontext=u:r:untrusted_app:s0:c202,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c202,c256,c512,c768 tclass=file app=org.pyjnius.playground
01-23 13:08:15.852  7828  7884 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
01-23 13:08:15.870  7828  7884 I python  : [INFO   ] [Text        ] Provider: sdl2
01-23 13:08:15.978  7828  7884 I python  : [INFO   ] [Window      ] Provider: sdl2
01-23 13:08:15.998  7828  7884 I python  : [INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
01-23 13:08:16.001  7828  7884 I python  : [INFO   ] [GL          ] Backend used <sdl2>
01-23 13:08:16.002  7828  7884 I python  : [INFO   ] [GL          ] OpenGL version <b'OpenGL ES 3.2 [email protected] (GIT@eaa701cd06, I183f6321f0, 1666871261) (Date:10/27/22)'>
01-23 13:08:16.002  7828  7884 I python  : [INFO   ] [GL          ] OpenGL vendor <b'Qualcomm'>
01-23 13:08:16.002  7828  7884 I python  : [INFO   ] [GL          ] OpenGL renderer <b'Adreno (TM) 619'>
01-23 13:08:16.002  7828  7884 I python  : [INFO   ] [GL          ] OpenGL parsed version: 3, 2
01-23 13:08:16.002  7828  7884 I python  : [INFO   ] [GL          ] Texture max size <16384>
01-23 13:08:16.002  7828  7884 I python  : [INFO   ] [GL          ] Texture max units <16>
01-23 13:08:16.017  7828  7884 I python  : [INFO   ] [Window      ] auto add sdl2 input provider
01-23 13:08:16.018  7828  7884 I python  : [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
01-23 13:08:16.117  7828  7884 I python  : [INFO   ] [Clipboard   ] Provider: android
01-23 13:08:16.152  7828  7884 I python  : [INFO   ] [GL          ] NPOT texture support is available
01-23 13:08:16.169  7828  7884 I python  : [WARNING] [Base        ] Unknown <android> provider
01-23 13:08:16.169  7828  7884 I python  : [INFO   ] [Base        ] Start application main loop
01-23 13:08:16.372  7828  7884 I python  : {'android.theme.customization.color_source': 'preset', '_applied_timestamp': 1705984264120, 'android.theme.customization.adaptive_icon_shape': 'com.android.theme.icon.round', 'android.theme.customization.font': 'com.android.theme.font.Exo2Regular', 'android.theme.customization.color_both': '1', 'android.theme.customization.color_index': 0, 'android.theme.customization.system_palette': '#0089FF', 'android.theme.customization.accent_color': '#0089FF'}
01-23 13:08:16.395  7828  7884 I python  : [INFO   ] [KivyMD      ] Material You is not supported on this android version,using pre generated top color: '4292553053'
01-23 13:08:16.407  7828  7884 I python  : [INFO   ] [KivyMD      ] Color scheme generated. Get a color scheme using android api- 0.011387759994249791 sec.
^C⏎  

@kulothunganug
Copy link
Contributor

Color I used when recording the log

Screenshot_20240123-131659.png

@T-Dynamos
Copy link
Collaborator Author

@kulothunganug I sent you apk in discord DM.

@HeaTTheatR
Copy link
Member

Merge this PR?

@T-Dynamos
Copy link
Collaborator Author

@HeaTTheatR not yet. Needs some more testing. I will inform when to merge.

@HeaTTheatR
Copy link
Member

Ok

@kulothunganug
Copy link
Contributor

We should also handle name case and 2x "Color' word in some properties...
Screenshot_20240123-221640

@T-Dynamos
Copy link
Collaborator Author

T-Dynamos commented Jan 23, 2024

@kulothunganug Actually it's a internal color, not listed in https://kivymd.readthedocs.io/en/latest/components/dynamic-color. (Also for some reason the color which cotains "fixed" matches with android UI. For example colors in android QS panel excatly matches with fixed primary color)

@kulothunganug
Copy link
Contributor

Thanks for the info!
Haven't been using kivymd for quite some time.
I guess I should go through the docs...

@T-Dynamos T-Dynamos marked this pull request as ready for review February 16, 2024 13:30
kivymd/theming.py Outdated Show resolved Hide resolved
@HeaTTheatR HeaTTheatR merged commit 4b8f456 into kivymd:master Feb 18, 2024
3 of 9 checks passed
@HeaTTheatR
Copy link
Member

@T-Dynamos

02-19 12:28:56.435 29444 29518 I python  :    File "/content/.buildozer/android/app/main.py", line 4, in <module>
02-19 12:28:56.435 29444 29518 I python  :    File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/myapp/arm64-v8a/kivymd/app.py", line 67, in <module>
02-19 12:28:56.436 29444 29518 I python  :    File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/myapp/arm64-v8a/kivymd/theming.py", line 49, in <module>
02-19 12:28:56.436 29444 29518 I python  :  ImportError: cannot import name 'argb_from_rgba_01' from 'materialyoucolor.utils.color_utils' (/data/user/0/com.selfmanager.myapp/files/app/_python_bundle/site-packages/materialyoucolor/utils/color_utils.pyc)
02-19 12:28:56.436 29444 29518 I python  : Python for android ended.

https://discord.com/channels/566880874789076992/566880874789076994/1209062326133587968

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants