{"id":321924,"date":"2021-04-22T21:00:33","date_gmt":"2021-04-22T21:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=321924"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2021-04-22T21:00:33","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=321924","title":{"rendered":"\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0430 Jetpack \u0431\u0435\u0437 \u043c\u0430\u0433\u0438\u0438 \u0438 DI"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fde\/5cd\/d7d\/fde5cdd7d9c1119f7c8cbe8ab468e29e.jpg\" width=\"600\" height=\"340\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0441\u0442\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e. \u0412\u043e\u043f\u0440\u043e\u0441 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u043b\u0442\u043e\u0440\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434 \u044f <a href=\"https:\/\/habr.com\/ru\/post\/475104\/\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b<\/a> \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e c \u043f\u043e\u043c\u043e\u0449\u044c\u044e Jetpack \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0418 \u0432\u043e\u0442 \u0441\u043f\u0443\u0441\u0442\u044f \u0432\u0440\u0435\u043c\u044f, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 Jetpack \u043b\u0435\u0442\u0430\u0442\u044c \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u043f\u0440\u043e\u0449\u0435: \u0431\u0435\u0437 \u043c\u0430\u0433\u0438\u0438 \u0438 DI.<\/p>\n<hr>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/35c\/ab7\/0b6\/35cab70b6d2042c0c5ec4c060e22b10b.png\" width=\"1073\" height=\"644\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Android \u043f\u0440\u043e\u0435\u043a\u0442\u0430: feature-\u043c\u043e\u0434\u0443\u043b\u0438 c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 shared-\u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441 \u043e\u0431\u0449\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u0418 app \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 feature \u0438 shared.<\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u043f\u043e\u0434\u0445\u043e\u0434 Single Activity, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 Activity \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u0445\u043e\u0441\u0442\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ac\/0c1\/c04\/6ac0c1c04b11cf3f32b295f3d4c15ae8.PNG\" width=\"376\" height=\"253\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u041e\u0442 \u043c\u043e\u0434\u0443\u043b\u044f <strong>shared:navigation<\/strong> \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a. \u0412 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432.<\/p>\n<pre><code class=\"kotlin\">fun Fragment.navigate(actionId: Int, hostId: Int? = null, data: Serializable? = null) { \tval navController = if (hostId == null) { \t\tfindNavController() \t} else { \t\tNavigation.findNavController(requireActivity(), hostId) \t}  \tval bundle = Bundle().apply { putSerializable(\"navigation data\", data) }  \tnavController.navigate(actionId, bundle) }<\/code><\/pre>\n<p>\u0423 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>actionId &#8212; id \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0433\u0440\u0430\u0444\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>hostId &#8212; id \u0445\u043e\u0441\u0442\u0430 \u0433\u0440\u0430\u0444\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0445\u043e\u0441\u0442<\/p>\n<\/li>\n<li>\n<p>data &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430 Serializable<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. <\/p>\n<pre><code class=\"kotlin\">val Fragment.navigationData: Serializable? \tget() = arguments?.getSerializable(\"navigation data\")<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u043d\u0430\u0434\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c id \u0445\u043e\u0441\u0442\u043e\u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043a \u043d\u0438\u043c \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 feature \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b <strong>res\/value\/ids.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;resources&gt; \t&lt;item name=\"host_global\" type=\"id\"\/&gt; \t&lt;item name=\"host_main\" type=\"id\"\/&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0441\u0430\u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0432 feature-\u043c\u043e\u0434\u0443\u043b\u044f\u0445<\/h2>\n<p>\u0421\u044d\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u0430 <strong>splash<\/strong>. \u041e\u0431\u044b\u0447\u043d\u043e \u0441 \u044d\u0442\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043b\u0438\u0431\u043e \u043a \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u0443, \u043b\u0438\u0431\u043e \u043a \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u044d\u043a\u0440\u0430\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u043a \u044d\u043a\u0440\u0430\u043d\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435: \u043f\u0443\u0441\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0444\u0438\u0447\u0438 <strong>splash<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0443\u043c\u0435\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u0430 \u0438 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438 id \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439: \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0438\u0445 \u0432 <strong>res\/value\/ids.xml <\/strong>\u043c\u043e\u0434\u0443\u043b\u044f <strong>splash<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;resources&gt; \t&lt;item name=\"action_splashFragment_to_mainFragment\" type=\"id\"\/&gt; \t&lt;item name=\"action_splashFragment_to_onboardingFragment\" type=\"id\"\/&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>Id \u0434\u043b\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 \u0444\u0438\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0430 \u043d\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>shared:navigation. <\/strong>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044e \u0437\u043d\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 id \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432.<\/p>\n<pre><code class=\"kotlin\">import com.example.smmn.shared.navigation.navigate  class SplashFragment : Fragment(R.layout.fragment_splash) {      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {         super.onViewCreated(view, savedInstanceState)          buttonToOnboarding.setOnClickListener {             navigate(R.id.action_splashFragment_to_onboardingFragment)         }          buttonToMain.setOnClickListener {             navigate(R.id.action_splashFragment_to_mainFragment)         }     } }<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <strong>shared:navigation<\/strong>.<\/p>\n<p>\u041d\u043e \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e.<\/p>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442<\/h2>\n<p>\u0412 \u043d\u0430\u0448\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 Activity. \u041e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442 \u0434\u043b\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u0434\u0435 Activity.<\/p>\n<pre><code class=\"kotlin\">class MainActivity : AppCompatActivity(R.layout.activity_main)<\/code><\/pre>\n<p>\u0425\u043e\u0441\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0434\u043e \u0432 \u0435\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 <strong>activity_main.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.fragment.app.FragmentContainerView xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     xmlns:tools=\"http:\/\/schemas.android.com\/tools\"     android:id=\"@id\/host_global\"     android:name=\"androidx.navigation.fragment.NavHostFragment\"     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"     app:defaultNavHost=\"true\"     app:navGraph=\"@navigation\/navigation_global\"     tools:ignore=\"FragmentTagUsage\" \/&gt;<\/code><\/pre>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f<\/h2>\n<p>\u042d\u0442\u043e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435. \u0414\u043b\u044f \u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>app <\/strong>\u0433\u0440\u0430\u0444 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 <strong>res\/navigation\/navigation_global.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;navigation xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     android:id=\"@+id\/navigation_global\"     app:startDestination=\"@id\/splashFragment\"&gt;      &lt;fragment         android:id=\"@+id\/splashFragment\"         android:name=\"com.example.smmn.feature.splash.SplashFragment\"         android:label=\"SplashFragment\"&gt;         &lt;action             android:id=\"@id\/action_splashFragment_to_mainFragment\"             app:destination=\"@id\/mainFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;         &lt;action             android:id=\"@id\/action_splashFragment_to_onboardingFragment\"             app:destination=\"@id\/onboardingFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;     &lt;\/fragment&gt;     &lt;fragment         android:id=\"@+id\/mainFragment\"         android:name=\"com.example.smmn.feature.main.MainFragment\"         android:label=\"MainFragment\" &gt;         &lt;action             android:id=\"@id\/action_mainFragment_to_splashFragment\"             app:popUpTo=\"@id\/navigation_global\"             app:destination=\"@id\/splashFragment\" \/&gt;     &lt;\/fragment&gt;     &lt;fragment         android:id=\"@+id\/onboardingFragment\"         android:name=\"com.example.smmn.feature.onboarding.OnboardingFragment\"         android:label=\"OnboardingFragment\"&gt;         &lt;action             android:id=\"@id\/action_onboardingFragment_to_mainFragment\"             app:destination=\"@id\/mainFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;     &lt;\/fragment&gt; &lt;\/navigation&gt;<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0435\u0441\u0442\u044c \u043d\u0430\u0431\u043e\u0440 action (\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u0412 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0438 \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430\u0437\u0430\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 &#171;Back&#187;.<\/p>\n<p>\u0418 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e id \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430 +, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c id \u0432 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0435, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c id, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 <strong>feature <\/strong>\u043c\u043e\u0434\u0443\u043b\u0435.<\/p>\n<p>\u041f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 id \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>splash<\/strong><\/p>\n<pre><code class=\"xml\">&lt;item name=\"action_splashFragment_to_mainFragment\" type=\"id\"\/&gt; &lt;item name=\"action_splashFragment_to_onboardingFragment\" type=\"id\"\/&gt;<\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430<\/p>\n<pre><code class=\"xml\">        &lt;action             android:id=\"@id\/action_splashFragment_to_mainFragment\"             app:destination=\"@id\/mainFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;         &lt;action             android:id=\"@id\/action_splashFragment_to_onboardingFragment\"             app:destination=\"@id\/onboardingFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;<\/code><\/pre>\n<h2>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0445\u043e\u0441\u0442<\/h2>\n<p>\u0412 Jetpack \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0445\u043e\u0441\u0442. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0435\u043d\u044e \u0442\u0438\u043f\u0430 BottomNavigation \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0431\u0443\u0434\u0443\u0442 \u0444\u0438\u0447\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6a3\/b6e\/c8c\/6a3b6ec8c6a57ca4a3c27bf837d87f74.jpg\" width=\"185\" height=\"400\"><figcaption><\/figcaption><\/figure>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 navigation-ui, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>main <\/strong>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u043d\u044e \u0434\u043b\u044f BottomNavigation \u0432 <strong>res\/menu\/menu_main.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;menu xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;     &lt;item         android:id=\"@+id\/profileFragment\"         android:icon=\"@drawable\/ic_baseline_account_circle_24\"         android:title=\"@string\/main_menu_title_profile\" \/&gt;     &lt;item         android:id=\"@+id\/settingsFragment\"         android:icon=\"@drawable\/ic_baseline_settings_24\"         android:title=\"@string\/main_menu_title_settings\" \/&gt; &lt;\/menu&gt;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0433\u0440\u0430\u0444 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0432 <strong>res\/navigation\/navigation_main.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;navigation xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     android:id=\"@+id\/navigation_main\"     app:startDestination=\"@id\/profileFragment\"&gt;      &lt;fragment         android:id=\"@+id\/profileFragment\"         android:name=\"com.example.smmn.feature.profile.ProfileFragment\"         android:label=\"ProfileFragment\"&gt;         &lt;action             android:id=\"@id\/action_profileFragment_to_infoFragment\"             app:destination=\"@id\/infoFragment\" \/&gt;     &lt;\/fragment&gt;     &lt;fragment         android:id=\"@+id\/settingsFragment\"         android:name=\"com.example.smmn.feature.settings.SettingsFragment\"         android:label=\"SettingsFragment\" \/&gt;     &lt;fragment         android:id=\"@+id\/infoFragment\"         android:name=\"com.example.smmn.feature.info.InfoFragment\"         android:label=\"InfoFragment\" \/&gt; &lt;\/navigation&gt;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0435 \u0436\u0435 id \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0435\u043d\u044e <strong>res\/menu\/menu_main.xml<\/strong>. \u0418 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e id \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0444\u0438\u0447.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0441\u0442 \u0438 \u043c\u0435\u043d\u044e \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 <strong>res\/layout\/fragment_main.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"&gt;      &lt;fragment         android:id=\"@id\/host_main\"         android:name=\"androidx.navigation.fragment.NavHostFragment\"         android:layout_width=\"match_parent\"         android:layout_height=\"0dp\"         app:defaultNavHost=\"true\"         app:layout_constraintBottom_toTopOf=\"@+id\/bottomNavigationView\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"         app:navGraph=\"@navigation\/navigation_main\" \/&gt;      &lt;com.google.android.material.bottomnavigation.BottomNavigationView         android:id=\"@+id\/bottomNavigationView\"         android:layout_width=\"match_parent\"         android:layout_height=\"wrap_content\"         android:background=\"@android:color\/white\"         app:elevation=\"8dp\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:menu=\"@menu\/menu_main\" \/&gt; &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/code><\/pre>\n<p>\u0418 \u0432 \u0441\u0430\u043c\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c bottomNavigationView<\/p>\n<pre><code class=\"kotlin\">class MainFragment : Fragment(R.layout.fragment_main) {      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {         super.onViewCreated(view, savedInstanceState)          NavigationUI.setupWithNavController(             bottomNavigationView,             Navigation.findNavController(requireActivity(), R.id.host_main)         )     } }<\/code><\/pre>\n<h2>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043c\u0435\u0436\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u043e\u0432<\/h2>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0441 \u044d\u043a\u0440\u0430\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430, \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d c \u0445\u043e\u0441\u0442\u043e\u043c \u0434\u043b\u044f \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0444\u0438\u0447: \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u044f.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d44\/950\/a72\/d44950a72bacdec80333a0b01cda2ffd.jpg\" width=\"185\" height=\"400\"><figcaption><\/figcaption><\/figure>\n<p>\u0418 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0445\u043e\u0441\u0442\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 (\u043d\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442, \u0430 \u0433\u043b\u0443\u0431\u0436\u0435) \u043d\u0430\u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0441\u043f\u043b\u044d\u0448\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u0440\u0430\u0437\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430, \u043d\u043e \u0443\u043a\u0430\u0436\u0435\u043c id \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430. \u041c\u044b \u0438\u043c\u0435\u0435\u043c \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 \u0444\u0438\u0447\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>shared:navigation<\/strong>.<\/p>\n<pre><code class=\"kotlin\">class SettingsFragment : Fragment(R.layout.fragment_settings) {      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {         super.onViewCreated(view, savedInstanceState)          buttonToSplash.setOnClickListener {             navigate(R.id.action_mainFragment_to_splashFragment, R.id.host_global)         }     } }<\/code><\/pre>\n<p>Id \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u0430\u043c\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0444\u0438\u0447\u0438 <strong>res\/values\/ids.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;resources&gt; \t&lt;item name=\"action_mainFragment_to_splashFragment\" type=\"id\"\/&gt; &lt;\/resources&gt;<\/code><\/pre>\n<h2>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043c\u0435\u0436\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 bundle. \u042d\u0442\u043e \u043c\u043e\u0433\u0443\u0433 \u0431\u044b\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b Serializable \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<p>\u0412\u044b\u0448\u0435 \u044f \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Serializable \u043a\u043b\u0430\u0441\u0441\u0430. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Serializable \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0434\u043e \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0443\u043b\u044c \u0444\u0438\u0447\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434, \u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0444\u0438\u0447\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434, \u0438\u043c\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u043e\u0434\u0443\u043b\u044e \u0441 \u0442\u0430\u043a\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c <strong>shared:model <\/strong>\u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c Serializable \u043a\u043b\u0430\u0441\u0441 <strong>Info.<\/strong><\/p>\n<pre><code class=\"kotlin\">data class Info(     val name: String,     val surname: String ) : Serializable<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441 \u044d\u043a\u0440\u0430\u043d\u0430 <strong>profile<\/strong> \u043d\u0430 \u044d\u043a\u0440\u0430\u043d <strong>info<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 Info \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0435\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430.<\/p>\n<pre><code class=\"kotlin\">class ProfileFragment : Fragment(R.layout.fragment_profile) {      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {         super.onViewCreated(view, savedInstanceState)          buttonToInfo.setOnClickListener {             navigate(R.id.action_profileFragment_to_infoFragment, data = Info(\"name\", \"surname\"))         }     } }<\/code><\/pre>\n<p>\u0418 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0440\u0443\u0433\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u043d\u0435\u0435.<\/p>\n<pre><code class=\"kotlin\">class InfoFragment : Fragment(R.layout.fragment_info) {      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {         super.onViewCreated(view, savedInstanceState)          val info = navigationData as? Info ?: return         textView.text = info.toString()     } }<\/code><\/pre>\n<p>\u0422\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b64\/7f7\/03d\/b647f703d47284b694faf6d0581de64e.jpg\" width=\"185\" height=\"400\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434, \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0445\u043e\u0441\u0442\u0435.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0422\u0430\u043a\u0438\u043c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432 \u0432\u0430\u0448\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Jetpack \u0438 \u043f\u0430\u0440\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u043d\u043e \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043d \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435.<\/p>\n<p>\u041e\u0441\u0442\u0430\u0432\u043b\u044f\u044e <a href=\"https:\/\/github.com\/MrSwimmer\/smmn\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0443<\/a> \u043d\u0430 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438!<\/p>\n<\/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\/553818\/\"> https:\/\/habr.com\/ru\/post\/553818\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0441\u0442\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e. \u0412\u043e\u043f\u0440\u043e\u0441 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u043b\u0442\u043e\u0440\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434 \u044f <a href=\"https:\/\/habr.com\/ru\/post\/475104\/\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b<\/a> \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e c \u043f\u043e\u043c\u043e\u0449\u044c\u044e Jetpack \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0418 \u0432\u043e\u0442 \u0441\u043f\u0443\u0441\u0442\u044f \u0432\u0440\u0435\u043c\u044f, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 Jetpack \u043b\u0435\u0442\u0430\u0442\u044c \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u043f\u0440\u043e\u0449\u0435: \u0431\u0435\u0437 \u043c\u0430\u0433\u0438\u0438 \u0438 DI.<\/p>\n<hr>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Android \u043f\u0440\u043e\u0435\u043a\u0442\u0430: feature-\u043c\u043e\u0434\u0443\u043b\u0438 c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 shared-\u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441 \u043e\u0431\u0449\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u0418 app \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 feature \u0438 shared.<\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u043f\u043e\u0434\u0445\u043e\u0434 Single Activity, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 Activity \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u0445\u043e\u0441\u0442\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u041e\u0442 \u043c\u043e\u0434\u0443\u043b\u044f <strong>shared:navigation<\/strong> \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a. \u0412 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432.<\/p>\n<pre><code class=\"kotlin\">fun Fragment.navigate(actionId: Int, hostId: Int? = null, data: Serializable? = null) { \tval navController = if (hostId == null) { \t\tfindNavController() \t} else { \t\tNavigation.findNavController(requireActivity(), hostId) \t}  \tval bundle = Bundle().apply { putSerializable(\"navigation data\", data) }  \tnavController.navigate(actionId, bundle) }<\/code><\/pre>\n<p>\u0423 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>actionId &#8212; id \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0433\u0440\u0430\u0444\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>hostId &#8212; id \u0445\u043e\u0441\u0442\u0430 \u0433\u0440\u0430\u0444\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0445\u043e\u0441\u0442<\/p>\n<\/li>\n<li>\n<p>data &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430 Serializable<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. <\/p>\n<pre><code class=\"kotlin\">val Fragment.navigationData: Serializable? \tget() = arguments?.getSerializable(\"navigation data\")<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u043d\u0430\u0434\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c id \u0445\u043e\u0441\u0442\u043e\u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043a \u043d\u0438\u043c \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 feature \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b <strong>res\/value\/ids.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;resources&gt; \t&lt;item name=\"host_global\" type=\"id\"\/&gt; \t&lt;item name=\"host_main\" type=\"id\"\/&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0441\u0430\u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0432 feature-\u043c\u043e\u0434\u0443\u043b\u044f\u0445<\/h2>\n<p>\u0421\u044d\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u0430 <strong>splash<\/strong>. \u041e\u0431\u044b\u0447\u043d\u043e \u0441 \u044d\u0442\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043b\u0438\u0431\u043e \u043a \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u0443, \u043b\u0438\u0431\u043e \u043a \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u044d\u043a\u0440\u0430\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u043a \u044d\u043a\u0440\u0430\u043d\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435: \u043f\u0443\u0441\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0444\u0438\u0447\u0438 <strong>splash<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0443\u043c\u0435\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u0430 \u0438 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438 id \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439: \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0438\u0445 \u0432 <strong>res\/value\/ids.xml <\/strong>\u043c\u043e\u0434\u0443\u043b\u044f <strong>splash<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;resources&gt; \t&lt;item name=\"action_splashFragment_to_mainFragment\" type=\"id\"\/&gt; \t&lt;item name=\"action_splashFragment_to_onboardingFragment\" type=\"id\"\/&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>Id \u0434\u043b\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 \u0444\u0438\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0430 \u043d\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>shared:navigation. <\/strong>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044e \u0437\u043d\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 id \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432.<\/p>\n<pre><code class=\"kotlin\">import com.example.smmn.shared.navigation.navigate  class SplashFragment : Fragment(R.layout.fragment_splash) {      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {         super.onViewCreated(view, savedInstanceState)          buttonToOnboarding.setOnClickListener {             navigate(R.id.action_splashFragment_to_onboardingFragment)         }          buttonToMain.setOnClickListener {             navigate(R.id.action_splashFragment_to_mainFragment)         }     } }<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <strong>shared:navigation<\/strong>.<\/p>\n<p>\u041d\u043e \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e.<\/p>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442<\/h2>\n<p>\u0412 \u043d\u0430\u0448\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 Activity. \u041e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442 \u0434\u043b\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u0434\u0435 Activity.<\/p>\n<pre><code class=\"kotlin\">class MainActivity : AppCompatActivity(R.layout.activity_main)<\/code><\/pre>\n<p>\u0425\u043e\u0441\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0434\u043e \u0432 \u0435\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 <strong>activity_main.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.fragment.app.FragmentContainerView xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     xmlns:tools=\"http:\/\/schemas.android.com\/tools\"     android:id=\"@id\/host_global\"     android:name=\"androidx.navigation.fragment.NavHostFragment\"     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"     app:defaultNavHost=\"true\"     app:navGraph=\"@navigation\/navigation_global\"     tools:ignore=\"FragmentTagUsage\" \/&gt;<\/code><\/pre>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f<\/h2>\n<p>\u042d\u0442\u043e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435. \u0414\u043b\u044f \u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>app <\/strong>\u0433\u0440\u0430\u0444 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 <strong>res\/navigation\/navigation_global.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;navigation xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     android:id=\"@+id\/navigation_global\"     app:startDestination=\"@id\/splashFragment\"&gt;      &lt;fragment         android:id=\"@+id\/splashFragment\"         android:name=\"com.example.smmn.feature.splash.SplashFragment\"         android:label=\"SplashFragment\"&gt;         &lt;action             android:id=\"@id\/action_splashFragment_to_mainFragment\"             app:destination=\"@id\/mainFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;         &lt;action             android:id=\"@id\/action_splashFragment_to_onboardingFragment\"             app:destination=\"@id\/onboardingFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;     &lt;\/fragment&gt;     &lt;fragment         android:id=\"@+id\/mainFragment\"         android:name=\"com.example.smmn.feature.main.MainFragment\"         android:label=\"MainFragment\" &gt;         &lt;action             android:id=\"@id\/action_mainFragment_to_splashFragment\"             app:popUpTo=\"@id\/navigation_global\"             app:destination=\"@id\/splashFragment\" \/&gt;     &lt;\/fragment&gt;     &lt;fragment         android:id=\"@+id\/onboardingFragment\"         android:name=\"com.example.smmn.feature.onboarding.OnboardingFragment\"         android:label=\"OnboardingFragment\"&gt;         &lt;action             android:id=\"@id\/action_onboardingFragment_to_mainFragment\"             app:destination=\"@id\/mainFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;     &lt;\/fragment&gt; &lt;\/navigation&gt;<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0435\u0441\u0442\u044c \u043d\u0430\u0431\u043e\u0440 action (\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u0412 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0438 \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430\u0437\u0430\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 &#171;Back&#187;.<\/p>\n<p>\u0418 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e id \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430 +, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c id \u0432 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0435, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c id, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 <strong>feature <\/strong>\u043c\u043e\u0434\u0443\u043b\u0435.<\/p>\n<p>\u041f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 id \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>splash<\/strong><\/p>\n<pre><code class=\"xml\">&lt;item name=\"action_splashFragment_to_mainFragment\" type=\"id\"\/&gt; &lt;item name=\"action_splashFragment_to_onboardingFragment\" type=\"id\"\/&gt;<\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430<\/p>\n<pre><code class=\"xml\">        &lt;action             android:id=\"@id\/action_splashFragment_to_mainFragment\"             app:destination=\"@id\/mainFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;         &lt;action             android:id=\"@id\/action_splashFragment_to_onboardingFragment\"             app:destination=\"@id\/onboardingFragment\"             app:popUpTo=\"@id\/navigation_global\" \/&gt;<\/code><\/pre>\n<h2>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0445\u043e\u0441\u0442<\/h2>\n<p>\u0412 Jetpack \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0445\u043e\u0441\u0442. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0435\u043d\u044e \u0442\u0438\u043f\u0430 BottomNavigation \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0431\u0443\u0434\u0443\u0442 \u0444\u0438\u0447\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 navigation-ui, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>main <\/strong>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u043d\u044e \u0434\u043b\u044f BottomNavigation \u0432 <strong>res\/menu\/menu_main.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;menu xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;     &lt;item         android:id=\"@+id\/profileFragment\"         android:icon=\"@drawable\/ic_baseline_account_circle_24\"         android:title=\"@string\/main_menu_title_profile\" \/&gt;     &lt;item         android:id=\"@+id\/settingsFragment\"         android:icon=\"@drawable\/ic_baseline_settings_24\"         android:title=\"@string\/main_menu_title_settings\" \/&gt; &lt;\/menu&gt;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0433\u0440\u0430\u0444 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0432 <strong>res\/navigation\/navigation_main.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;navigation xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     android:id=\"@+id\/navigation_main\"     app:startDestination=\"@id\/profileFragment\"&gt;      &lt;fragment         android:id=\"@+id\/profileFragment\"         android:name=\"com.example.smmn.feature.profile.ProfileFragment\"         android:label=\"ProfileFragment\"&gt;         &lt;action             android:id=\"@id\/action_profileFragment_to_infoFragment\"             app:destination=\"@id\/infoFragment\" \/&gt;     &lt;\/fragment&gt;     &lt;fragment         android:id=\"@+id\/settingsFragment\"         android:name=\"com.example.smmn.feature.settings.SettingsFragment\"         android:label=\"SettingsFragment\" \/&gt;     &lt;fragment         android:id=\"@+id\/infoFragment\"         android:name=\"com.example.smmn.feature.info.InfoFragment\"         android:label=\"InfoFragment\" \/&gt; &lt;\/navigation&gt;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0435 \u0436\u0435 id \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0435\u043d\u044e <strong>res\/menu\/menu_main.xml<\/strong>. \u0418 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e id \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0444\u0438\u0447.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0441\u0442 \u0438 \u043c\u0435\u043d\u044e \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 <strong>res\/layout\/fragment_main.xml<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"&gt;      &lt;fragment         android:id=\"@id\/host_main\"         android:name=\"androidx.navigation.fragment.NavHostFragment\"         android:layout_width=\"match_parent\"         android:layout_height=\"0dp\"         app:defaultNavHost=\"true\"<\/code><\/pre>\n<\/hr>\n<\/div>\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-321924","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321924","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=321924"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321924\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}