add tab transition animation in the example

This commit is contained in:
Qua-non 2012-01-25 04:12:31 +05:30
parent b273fe5c7d
commit 084b894ee7
2 changed files with 13 additions and 7 deletions

View File

@ -6,12 +6,14 @@ Test of the widget TabbedPannel.
'''
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.animation import Animation
from kivy.clock import Clock
from kivy.uix.button import Button
from kivy.lang import Builder
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.tabbedpannel import TabbedPannel
from kivy.properties import ObjectProperty
from kivy.lang import Builder
Builder.load_string('''
<cut_copy_paste>
size_hint: (None, None)
@ -54,8 +56,16 @@ class cut_copy_paste(TabbedPannel):
self.change_tab_contents(self.default_content)
def change_tab_contents(self, *l):
anim = Animation( color=(1, 1, 1, 0), d =.27, t = 'in_back')
def start_anim(*l):
anim.start(self.content.children[0])
start_anim()
self.clear_widgets()
self.add_widget(l[0])
anim = Animation( color = (1, 1, 1, 1), d =.27, t = 'in_quad')
start_anim()
class TabShowcase(FloatLayout):

View File

@ -2,7 +2,7 @@
TabbedPannel
============
.. versionadded:: 1.0.1?
.. versionadded:: 1.0.10
.. image:: images/tabbed_pannel.jpg
:align: right
@ -100,10 +100,6 @@ by default The tab strip takes it's background image, color from the
TabbedPannel's background_image and background_color respectively.
'''
#TODO: overall percentage done[====-]%
# animation
#change added version[====-]%
# move load_string to style.kv
__all__ = ('TabbedPannel', 'Tab_Content', 'Tab_Heading', 'Tab_Strip')