different transitions for different screens
This commit is contained in:
parent
3069e37d28
commit
a2b5a04487
@ -1,5 +1,6 @@
|
||||
#:import random random.random
|
||||
#:import RiseInTransition kivy.uix.screenmanager.RiseInTransition
|
||||
#:import SlideTransition kivy.uix.screenmanager.SlideTransition
|
||||
#:import facade plyer.compass
|
||||
#:import rgba kivy.utils.get_color_from_hex
|
||||
|
||||
@ -66,7 +67,7 @@
|
||||
pos_hint: {"x":.8, "top":0.95}
|
||||
size_hint: 0.2, 0.2
|
||||
source: 'assets/dark_to_compass_icon.png'
|
||||
on_press: root.manager.current = 'compass'; app.set_destination()
|
||||
on_press: root.manager.transition = RiseInTransition(); root.manager.current = 'compass'; app.set_destination()
|
||||
IconButton:
|
||||
source: 'assets/to_self.png'
|
||||
pos_hint: {"x":0.4, "bottom":0.1}
|
||||
@ -76,8 +77,7 @@
|
||||
pos_hint: {"x":0.8, "bottom":0.1}
|
||||
size_hint: 0.2, 0.2
|
||||
source: 'assets/to_settings.png'
|
||||
on_press: root.manager.current = 'settings';
|
||||
|
||||
on_press: root.manager.transition = SlideTransition(direction='right'); root.manager.current = 'settings'
|
||||
|
||||
|
||||
<CompassScreen>:
|
||||
|
||||
4
main.py
4
main.py
@ -6,7 +6,7 @@ from kivy.properties import DictProperty, NumericProperty, StringProperty
|
||||
from kivy.clock import mainthread
|
||||
from kivy.utils import platform
|
||||
from kivy_garden.mapview import MapView
|
||||
from kivy.uix.screenmanager import ScreenManager, Screen, RiseInTransition
|
||||
from kivy.uix.screenmanager import ScreenManager, Screen, RiseInTransition, SlideTransition
|
||||
from kivy.uix.behaviors import ButtonBehavior
|
||||
from kivy.uix.image import Image
|
||||
from kivy.vector import Vector
|
||||
@ -44,8 +44,8 @@ class SettingsScreen(Screen):
|
||||
Window.bind(on_keyboard=self.android_back_click)
|
||||
|
||||
def android_back_click(self, window, key, *largs):
|
||||
|
||||
if key == 27 and self.parent is not None:
|
||||
self.parent.transition = SlideTransition(direction='left')
|
||||
self.parent.current='map'
|
||||
return True
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user