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

Update expansionpanel.py #1724

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Sahil-pixel
Copy link

@Sahil-pixel Sahil-pixel commented Jul 29, 2024

def _set_content_height(self, *args):
self._original_content_height = self._content.height - dp(88)
self._content.height = 0
IN THIS LINE self._original_content_height = self._content.height - dp(88)
dp(88) subtraction is not required .
If we add widgets in MDExpansionPanelContent widget then there is some error for calculation and MDExpansionPanelContent's children not set in boxlayout properly ,

```def _set_content_height(self, *args):
        **self._original_content_height = self._content.height - dp(88)**
        self._content.height = 0
```
If we add widgets in MDExpansionPanelContent widget then there is some error for calculation and MDExpansionPanelContent's children not set in boxlayout properly ,
@Sahil-pixel
Copy link
Author

Sahil-pixel commented Jul 29, 2024

Also see panel._original_content_height is updated after some frame . so please check it . properly . MDExpansionPanel need to be fixed . see i use Clock to get updated value panel._original_content_height. in Desktop it not needed but in mobile device it is needed . please see those things properly .

def tap_expansion_chevron(self,panel,content,header,chevron):
		Animation(
     		padding=[0, dp(12), 0, dp(12)]
            if not panel.is_open
            else [0, 0, 0, 0],
            d=0.2,
       	 	).start(panel)
		
		
		print(panel._content)#=content
		print(panel._header) #=header
		print(panel._original_content_height)
		#panel._header = ObjectProperty()  # MDExpansionPanelHeader object
    	#_content = 
		#panel.open() if not panel.is_open else panel.close()
		Clock.schedule_once(partial(self._call,panel))


        
def _call(self,panel,dt):
		
          print(panel._content)#=content
          print(panel._header) #=header
          print(panel._original_content_height)
          panel.open() if not panel.is_open else panel.close()

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

Successfully merging this pull request may close these issues.

1 participant