{"id":313629,"date":"2020-11-23T15:02:12","date_gmt":"2020-11-23T15:02:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=313629"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=313629","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 Python. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 Kivy. Part 2"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2k\/bf\/dl\/2kbfdlxwtm7q-y_btkp6hlis3va.png\"><\/div>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0438 \u0437\u043d\u0430\u0442\u043e\u043a\u043e\u0432 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Python!<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u0434\u043b\u044f \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u0443\u043b\u044c\u0442\u0438\u0442\u0430\u0447 \u2014 <a href=\"https:\/\/github.com\/kivy\/kivy\" rel=\"nofollow\">Kivy<\/a> \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 <i>Google Material Design<\/i> \u2014 <a href=\"https:\/\/github.com\/kivymd\/KivyMD\" rel=\"nofollow\">KivyMD<\/a>. \u0412 <a href=\"https:\/\/habr.com\/ru\/post\/528154\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Python\/Kivy\/KivyMD, \u0432 \u044d\u0442\u043e\u0439 \u2014 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0442\u0435\u043c\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u0441\u0430\u043c\u0438 \u043f\u043e\u0449\u0443\u043f\u0430\u0442\u044c, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 Kivy\/KivyMD \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e GIF \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0438 \u0432\u0438\u0434\u0435\u043e, \u0430 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043b\u0438\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u0444\u0435 \u0438 \u043f\u043e\u0433\u043d\u0430\u043b\u0438!<a name=\"habracut\"><\/a><\/p>\n<p>  Kivy \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Linux, Windows, OS X, Android, iOS \u0438 Raspberry Pi. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 \u0431\u0435\u0437 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443. Kivy \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432\u0432\u043e\u0434\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f WM_Touch, WM_Pen, Mac OS X Trackpad \u0438 Magic Mouse, Mtdev, Linux Kernel HID, TUIO \u0438 \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 Flutter, \u043d\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412\u0441\u0435 \u0435\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Kivy \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445. \u041d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u044b Kivy \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <i>KivyMD<\/i>. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u0437\u043e\u0440 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Kivy:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0440\u043e\u043b\u0438\u043a\u0438 Kivy \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\"><iframe id=\"5fb951192c0608e1441a4092\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5fb951192c0608e1441a4092\"><\/iframe><\/div>\n<p>  <\/p>\n<div class=\"oembed\"><iframe id=\"5fba09b2102304e11bb8d60c\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5fba09b2102304e11bb8d60c\"><\/iframe><\/div>\n<p>  <\/p>\n<div class=\"oembed\"><iframe id=\"5fba0a2dcb79a1e12d666436\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5fba0a2dcb79a1e12d666436\"><\/iframe><\/div>\n<p>  <\/p>\n<div class=\"oembed\"><iframe id=\"5fba0e0f2cbf1a1445b35328\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5fba0e0f2cbf1a1445b35328\"><\/iframe><\/div>\n<p>  <\/p>\n<div class=\"oembed\"><iframe id=\"5fbb37c0102304e11bb8d60d\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5fbb37c0102304e11bb8d60d\"><\/iframe><\/div>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412 \u044d\u0442\u0438\u0445 \u0440\u043e\u043b\u0438\u043a\u0430\u0445 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 Kivy \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0436\u0435\u0441\u0442\u043e\u0432 \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u0432\u0443\u0445 \u043b\u0435\u0439\u0431\u043b\u043e\u0432:<\/p>\n<pre><code class=\"python\">from kivy.animation import Animation from kivy.lang import Builder  from kivymd.app import MDApp   KV = &quot;&quot;&quot; &lt;CommonLabel@MDLabel&gt;     opacity: 0     adaptive_height: True     halign: &quot;center&quot;     y: -self.height   MDScreen:     on_touch_down: app.start_animation()      CommonLabel:         id: lbl_1         font_size: &quot;32sp&quot;         text: &quot;M A R S&quot;      CommonLabel:         id: lbl_2         font_size: &quot;12sp&quot;         text: &quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit&quot; &quot;&quot;&quot;   class TestAnimation(MDApp):     def build(self):         return Builder.load_string(KV)      def start_animation(self):         lbl_1 = self.root.ids.lbl_1         lbl_2 = self.root.ids.lbl_2          Animation(             opacity=1, y=lbl_1.height * 2, d=0.9, t=&quot;in_out_back&quot;         ).start(lbl_1)         Animation(             opacity=1, y=lbl_2.height + ids.lbl_1.height, d=1, t=&quot;in_out_back&quot;         ).start(lbl_2)   TestAnimation().run() <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0441\u043b\u0435\u0433\u043a\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041f\u0440\u0430\u0432\u0438\u043b\u043e <i>CommonLabel<\/i> \u0432 <i>KV<\/i> \u0441\u0442\u0440\u043e\u043a\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 Python \u043a\u043e\u0434\u0435. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/za\/df\/dr\/zadfdrwj1thm2593xegetib3k90.png\"><\/div>\n<p>  \u041a\u043e\u0434 \u0432 <a href=\"https:\/\/kivy.org\/doc\/stable\/guide\/lang.html\" rel=\"nofollow\">Kivy Language<\/a> \u0432\u0441\u0435\u0433\u0434\u0430 \u043a\u043e\u0440\u043e\u0447\u0435 \u0438 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u0435\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 Python \u043a\u043e\u0434\u0435 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438\u043a\u0430. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0434\u0432\u0435 \u043c\u0435\u0442\u043a\u0438 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0435 <i>CommonLabel<\/i>: \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c (<i>opacity<\/i>), \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043a\u0438 (<i>adaptive_height<\/i>), \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 (<i>halign<\/i>), \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043e\u0441\u0438 <i>Y<\/i> (<i>y<\/i> ) \u0438 \u0434\u0430\u043b\u0438 \u044d\u0442\u0438\u043c \u043c\u0435\u0442\u043a\u0430\u043c id-\u0448\u043d\u0438\u043a\u0438 (<i>lbl_1<\/i>, <i>lbl_2<\/i>), \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0435\u0442\u043e\u043a \u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0438 \u0438\u0437 Python \u043a\u043e\u0434\u0430. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043b\u0438 \u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044e <i>on_touch_down<\/i> (\u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043a \u044d\u043a\u0440\u0430\u043d\u0443 \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435) \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <i>start_animation<\/i>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0434\u0432\u0435 \u043c\u0435\u0442\u043a\u0438.<\/p>\n<h3>Animation<\/h3>\n<p>  \u0414\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 Kivy \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/kivy.org\/doc\/stable\/api-kivy.animation.html\" rel=\"nofollow\">Animation<\/a>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 Animation \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u043c\u0435\u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0441 \u0446\u0435\u043b\u0435\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044b \u0432 \u043a\u043e\u043d\u0446\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">    def start_animation(self):         # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u0435\u0442\u043e\u043a \u0438\u0437 KV \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438         lbl_1 = self.root.ids.lbl_1         lbl_2 = self.root.ids.lbl_2         # \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0435\u0442\u043a\u0438         Animation(             opacity=1,  # \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 1             y=lbl_1.height * 2,  # \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043f\u043e \u043e\u0441\u0438 Y             d=0.9,  # \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f             t=&quot;in_out_back&quot;  # \u0442\u0438\u043f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438         ).start(lbl_1)  # \u0432 \u043c\u0435\u0442\u043e\u0434 start \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0430\u043d\u0438\u043c\u0430\u0440\u043e\u0432\u0430\u0442\u044c         # \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043a\u0438         Animation(             opacity=1, y=lbl_2.height + lbl_1.height, d=1, t=&quot;in_out_back&quot;         ).start(lbl_2) <\/code><\/pre>\n<p>  \u041d\u0430 \u043d\u0438\u0436\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438, \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ol>\n<li><a href=\"https:\/\/kivy.org\/doc\/stable\/api-kivy.animation.html#kivy.animation.AnimationTransition.in_out_back\" rel=\"nofollow\">in_out_back<\/a><\/li>\n<li><a href=\"https:\/\/kivy.org\/doc\/stable\/api-kivy.animation.html#kivy.animation.AnimationTransition.in_out_elastic\" rel=\"nofollow\">out_elastic<\/a><\/li>\n<li><a href=\"https:\/\/kivy.org\/doc\/stable\/api-kivy.animation.html#kivy.animation.AnimationTransition.linear\" rel=\"nofollow\">linear<\/a><\/li>\n<\/ol>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tbody>\n<tr>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mw\/ch\/va\/mwchvaz1hzex40uatslwcxdsiqg.gif\"><\/div>\n<\/td>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/aa\/uz\/ne\/aauznedgafcqdoaiyiltcjaphgs.gif\"><\/div>\n<\/td>\n<td>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qw\/z9\/8a\/qwz98asmowkfiuuvkomofaevykm.gif\"><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u043a \u043d\u0430 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 (<i>PushMatrix, PopMatrix, Rotate, Translate, Scale<\/i>). \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u043e\u0431\u0449\u0435\u0439 \u043c\u0435\u0442\u043a\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <i>canvas<\/i>:<\/p>\n<pre><code class=\"json\">&lt;CommonLabel@MDLabel&gt;     angle: 180  # \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f     [...]      canvas.before:         PushMatrix         Rotate:             angle: self.angle             origin: self.center     canvas.after:         PopMatrix <\/code><\/pre>\n<p>  \u0410 \u0432 Python \u043a\u043e\u0434\u0435 \u0432 \u043a\u043b\u0430\u0441\u0441 Animation \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <i>angle<\/i> \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">    def start_animation(self):         lbl_1 = self.root.ids.lbl_1         lbl_2 = self.root.ids.lbl_2          Animation(angle=0, [...]).start(lbl_1)         Animation(angle=0, [...]).start(lbl_2) <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/86\/x5\/7p\/86x57px1modrnjt8yepn3qvcnao.gif\"><\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u043c\u0435\u0442\u043e\u043a:<\/p>\n<pre><code class=\"json\">&lt;CommonLabel@MDLabel&gt;     scale: 5  # \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0448\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f     [...]      canvas.before:         PushMatrix         [...]         Scale:             # \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0442\u0440\u0435\u043c \u043e\u0441\u044f\u043c             x: self.scale             y: self.scale             z: self.scale             origin: self.center     canvas.after:         PopMatrix <\/code><\/pre>\n<p>  \u0412 Python \u043a\u043e\u0434\u0435 \u0432 \u043a\u043b\u0430\u0441\u0441 Animation \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <i>scale<\/i> \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">    def start_animation(self):         lbl_1 = self.root.ids.lbl_1         lbl_2 = self.root.ids.lbl_2          Animation(scale=1, [...]).start(lbl_1)         Animation(scale=1, [...]).start(lbl_2) <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-h\/41\/3k\/-h413kdjmtihlecs9dakci3tf4i.gif\"><\/div>\n<p>  \u041a\u043b\u0430\u0441\u0441 <i>Animation<\/i> \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438: <i>on_start, on_progress, on_complete<\/i>. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439. <i>on_complete<\/i> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u041f\u0440\u0438\u0432\u044f\u0436\u0435\u043c \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043a \u043c\u0435\u0442\u043e\u0434\u0443 <i>complete_animation<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c:<\/p>\n<pre><code class=\"python\">[...]   class TestAnimation(MDApp):     [...]      def complete_animation(self, animation, animated_instance):         &quot;&quot;&quot;         :type animation: &lt;kivy.animation.Animation object&gt;         :type animated_instance: &lt;WeakProxy to &lt;kivy.factory.CommonLabel object&gt;&gt;         &quot;&quot;&quot;          # \u0410\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431 \u0438 \u0446\u0432\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0435\u0442\u043a\u0438.         Animation(scale=1.4, d=1, t=&quot;in_out_back&quot;).start(animated_instance)         Animation(color=(1, 0, 1, 1), d=1).start(animated_instance) <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435:<\/p>\n<pre><code class=\"python\">    def start_animation(self):         [...]          animation = Animation(             angle=0, scale=1, opacity=1, y=lbl_1.height * 2, d=0.9, t=&quot;in_out_back&quot;         )         animation.bind(on_complete=self.complete_animation)         animation.start(lbl_1)          [....] <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/iy\/tx\/7y\/iytx7ysjanzvfq3j6t7sadskfes.gif\"><\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u0432\u0441\u0435. \u041f\u0440\u043e\u0441\u0438\u043b\u0438:  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/if\/y-\/uh\/ify-uhi_mbicv8cxypgmjbjud04.png\"><\/div>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u044e \u043f\u0440\u0435\u0432\u044c\u044e Kivy\/KivyMD \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <i>APK<\/i> \u0438 \u043f\u043e\u0449\u0443\u043f\u0430\u0442\u044c:  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mz\/nn\/ho\/mznnhoihcel_rkqlrmq8bexiwlc.gif\"><\/div>\n<p>  \u2192 <a href=\"https:\/\/github.com\/HeaTTheatR\/Articles\" rel=\"nofollow\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a><\/p>\n<p>  APK \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u2014 <i>StarTest\/bin<\/i><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/529364\/\"> https:\/\/habr.com\/ru\/post\/529364\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2k\/bf\/dl\/2kbfdlxwtm7q-y_btkp6hlis3va.png\"><\/div>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0438 \u0437\u043d\u0430\u0442\u043e\u043a\u043e\u0432 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Python!<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u0434\u043b\u044f \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u0443\u043b\u044c\u0442\u0438\u0442\u0430\u0447 \u2014 <a href=\"https:\/\/github.com\/kivy\/kivy\" rel=\"nofollow\">Kivy<\/a> \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 <i>Google Material Design<\/i> \u2014 <a href=\"https:\/\/github.com\/kivymd\/KivyMD\" rel=\"nofollow\">KivyMD<\/a>. \u0412 <a href=\"https:\/\/habr.com\/ru\/post\/528154\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Python\/Kivy\/KivyMD, \u0432 \u044d\u0442\u043e\u0439 \u2014 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0442\u0435\u043c\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u0441\u0430\u043c\u0438 \u043f\u043e\u0449\u0443\u043f\u0430\u0442\u044c, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 Kivy\/KivyMD \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e GIF \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0438 \u0432\u0438\u0434\u0435\u043e, \u0430 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043b\u0438\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u0444\u0435 \u0438 \u043f\u043e\u0433\u043d\u0430\u043b\u0438!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-313629","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313629"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313629\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}