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

AccordionItem color not work on Android #4843

Open
Tungsteno74 opened this issue Dec 25, 2016 · 1 comment
Open

AccordionItem color not work on Android #4843

Tungsteno74 opened this issue Dec 25, 2016 · 1 comment
Labels
Component: Widgets kivy/uix, style.kv Status: Needs-analysis Issue needs to be analyzed if it's real

Comments

@Tungsteno74
Copy link

Tungsteno74 commented Dec 25, 2016

This code not work as expected on Android devices:

<AccordionItem>
	color: .55,.5,.95,.25
	background_normal: 'assets/button_normal.png'
	background_selected: 'assets/button_down.png'

The image below is how it appears on Android devices:
accordition_color_bad

Instead this image is as looks on Windows/Linux (correct):
accordition_color_ok

After several try and tests i found a partial fix for this problem:

[AccordionItemTitle@Label]:
    text: ctx.title
    canvas.before:
        Color:
            rgba: 
                #the fix part
                ctx.item.color \
		if ctx.item.color \
		else (1,1,1,1)
                ###
        BorderImage:
            source:
                ctx.item.background_normal \
                if ctx.item.collapse \
                else ctx.item.background_selected
            pos: self.pos
            size: self.size
        PushMatrix
        Translate:
            xy: self.center_x, self.center_y
        Rotate:
            angle: 90 if ctx.item.orientation == 'horizontal' else 0
            axis: 0, 0, 1
        Translate:
            xy: -self.center_x, -self.center_y
    canvas.after:
        PopMatrix

This fix works for all systems (and also with the object set as disabled) but, if i remove the color propriety from the AccorditionItem the program crash. Thus i'm not able to fix that completely.
I also tried to include this improvement in style.kv file located in kivy/data, but with no positive results.

Someone else has encountered the same problem?

thanks


tested with:
android 4.4.2
kivy 1.9.1 stable

@dessant dessant added Status: Needs-analysis Issue needs to be analyzed if it's real Component: Widgets kivy/uix, style.kv labels Dec 27, 2016
@stale
Copy link

stale bot commented Oct 7, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 7, 2017
@dessant dessant removed the stale label May 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Widgets kivy/uix, style.kv Status: Needs-analysis Issue needs to be analyzed if it's real
Projects
None yet
Development

No branches or pull requests

2 participants