{"id":324589,"date":"2021-06-08T15:01:29","date_gmt":"2021-06-08T15:01:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=324589"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=324589","title":{"rendered":"\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0430\u0432\u0442\u043e\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RecyclerView \u0438 LazyLists \u0432 Compose"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h4>\u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u043d\u0430 Android<\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c0e\/e8e\/315\/c0ee8e315845a7aa0adb31624ccf517e.gif\" alt=\"\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RecyclerView (\u0441\u043b\u0435\u0432\u0430) \u0438 LazyRow (\u0441\u043f\u0440\u0430\u0432\u0430)\" title=\"\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RecyclerView (\u0441\u043b\u0435\u0432\u0430) \u0438 LazyRow (\u0441\u043f\u0440\u0430\u0432\u0430)\" width=\"1196\" height=\"125\"><figcaption>\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RecyclerView (\u0441\u043b\u0435\u0432\u0430) \u0438 LazyRow (\u0441\u043f\u0440\u0430\u0432\u0430)<\/figcaption><\/figure>\n<h3>\u0418\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f RecyclerView + ListAdapter<\/h3>\n<p><a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/layout\/recyclerview\"><u>RecyclerView<\/u><\/a> &#8212; \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439 \u0438 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430(\u043e\u0432) \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043d\u0430 Android. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 RecyclerView, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0435\u043b\u0435\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u043e\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ce\/326\/edb\/5ce326edbc22a334b13172c09e763410.gif\" alt=\"\u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043b\u044e\u0431\u043e\u0432\u044c\u044e \u200b\ufe0f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f RecyclerView (\u0412 GIF \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u0430\u0434\u0440\u043e\u0432)\" title=\"\u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043b\u044e\u0431\u043e\u0432\u044c\u044e \u200b\ufe0f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f RecyclerView (\u0412 GIF \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u0430\u0434\u0440\u043e\u0432)\" width=\"596\" height=\"125\"><figcaption>\u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043b\u044e\u0431\u043e\u0432\u044c\u044e \u200b\ufe0f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f RecyclerView (\u0412 GIF \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u0430\u0434\u0440\u043e\u0432)<\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443?<\/p>\n<p>\u041e\u0434\u043d\u0430 \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0443\u043c, &#8212; \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439. \u0425\u043e\u0442\u044f \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e, \u043e\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0442\u043e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438? <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043a\u043e\u0434\u0443 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 <code>FeaturesAdapter<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442&nbsp; <a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/ListAdapter\"><u>ListAdapte<\/u><\/a><u>r<\/u>.<\/p>\n<pre><code class=\"kotlin\">data class Feature(     @DrawableRes val iconResource: Int,     val contentDescription: String, )<\/code><\/pre>\n<pre><code class=\"kotlin\">class FeaturesAdapter : ListAdapter&lt;Feature, RecyclerView.ViewHolder&gt;(FeatureDiffCallback()) {      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {         val view = LayoutInflater             .from(parent.context)             .inflate(R.layout.item_feature_tile, parent, false)         return FeatureItemViewHolder(view)     }      override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {         val itemViewHolder = holder as FeatureItemViewHolder         itemViewHolder.bind(getItem(position))     }      inner class FeatureItemViewHolder(view: View) : RecyclerView.ViewHolder(view) {          fun bind(feature: Feature) {             with(itemView) {                 imageFeature.setImageResource(feature.iconResource)                 imageFeature.contentDescription = feature.contentDescription             }         }     } }  class FeatureDiffCallback : DiffUtil.ItemCallback&lt;Feature&gt;() {      override fun areItemsTheSame(oldItem: Feature, newItem: Feature): Boolean =         oldItem.iconResource == newItem.iconResource      override fun areContentsTheSame(oldItem: Feature, newItem: Feature): Boolean =         oldItem == newItem }<\/code><\/pre>\n<p>\u0410\u0434\u0430\u043f\u0442\u0435\u0440, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 ListAdapter, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 ListAdapter?<\/h3>\n<blockquote>\n<p><a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/RecyclerView.Adapter\"><em><u>RecyclerView.Adapter<\/u><\/em><\/a><em> &#8212; \u044d\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 <\/em><a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/RecyclerView\"><em><u>RecyclerView<\/u><\/em><\/a><em>, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439 \u0432\u043e\u043a\u0440\u0443\u0433 <\/em><a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/AsyncListDiffer\"><em><u>AsyncListDiffer<\/u><\/em><\/a><em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 Adapter \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430.<\/em><\/p>\n<\/blockquote>\n<p>\u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 (diff, diffing) \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0446\u0438\u043a\u043b\u0435? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u043a\u043e\u0434 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c.<\/p>\n<pre><code class=\"kotlin\">private fun setupFeatureTiles(featuresList: List&lt;Features&gt;) {     with(recyclerFeatures) {   \tlayoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)         adapter = featuresAdapter     }     featuresAdapter.submitList(featuresList)      lifecycleScope.launch { autoScrollFeaturesList() } }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b <code>ViewModel<\/code>. \u042d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u0441 \u0432\u044b\u0437\u043e\u0432\u043e\u043c <code>autoScrollFeaturesList<\/code>. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"kotlin\">private tailrec suspend fun autoScrollFeaturesList() {     if (recyclerFeatures.canScrollHorizontally(DIRECTION_RIGHT)) {         recyclerFeatures.smoothScrollBy(SCROLL_DX, 0)     } else {         val firstPosition =              (recyclerFeatures.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition()         if (firstPosition != RecyclerView.NO_POSITION) {             val currentList = featuresAdapter.currentList             val secondPart = currentList.subList(0, firstPosition)             val firstPart = currentList.subList(firstPosition, currentList.size)             featuresAdapter.submitList(firstPart + secondPart)         }     }     delay(DELAY_BETWEEN_SCROLL_MS)     autoScrollFeaturesList() }   private const val DELAY_BETWEEN_SCROLL_MS = 25L private const val SCROLL_DX = 5 private const val DIRECTION_RIGHT = 1<\/code><\/pre>\n<h4>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c<\/h4>\n<ol>\n<li>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"https:\/\/kotlinlang.org\/docs\/functions.html#tail-recursive-functions\"><u>\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f<\/u><\/a> \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0430\u043c\u0430 \u0441\u0435\u0431\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 RecyclerView \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>RecyclerView \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 5 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0434\u043e\u0448\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 RecyclerView \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d \u0434\u043e\u0441\u0442\u0438\u0433 \u043a\u043e\u043d\u0446\u0430 \u0441\u043f\u0438\u0441\u043a\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438:<br \/>\u2014 \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e.<br \/>\u2014 \u0412\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443. \u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f (diff, diffing) \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435. \u0410\u0434\u0430\u043f\u0442\u0435\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e \u0432\u0438\u0434\u0438\u043c\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 RecyclerView \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0441\u043f\u0440\u0430\u0432\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0448\u0430\u0433 2, \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430 5 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430 \u043f\u0440\u0438 \u0438\u0441\u0447\u0435\u0437\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0438 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0435\u0435 \u044f\u0432\u043d\u043e\u043c \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0438.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/458\/6d2\/6ad\/4586d26ad8a523c7548902d4b26773b7.gif\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0433\u0430 3 \u0438 4.\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0433\u0430 3 \u0438 4.\" width=\"461\" height=\"50\"><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0433\u0430 3 \u0438 4.<\/figcaption><\/figure>\n<p>\u042d\u0442\u043e\u0442 GIF \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440. <em>\u0415\u0441\u043b\u0438 \u043e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u043e\u0432, \u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 GIF, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e&#8230; \u043d\u0443<\/em>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p><strong>. &nbsp; &nbsp; . &nbsp; &nbsp; .<\/strong><\/p>\n<h2>\u0422\u0435\u043f\u0435\u0440\u044c \u0441 Compose<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/06a\/8cd\/166\/06a8cd166f538f03ddbc5872dbd5d2f4.gif\" alt=\" \u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043b\u044e\u0431\u043e\u0432\u044c\u044e \u200b\ufe0f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Compose (\u0412 GIF \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u0430\u0434\u0440\u043e\u0432)\" title=\" \u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043b\u044e\u0431\u043e\u0432\u044c\u044e \u200b\ufe0f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Compose (\u0412 GIF \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u0430\u0434\u0440\u043e\u0432)\" width=\"600\" height=\"125\"><figcaption> \u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043b\u044e\u0431\u043e\u0432\u044c\u044e \u200b\ufe0f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Compose (\u0412 GIF \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u0430\u0434\u0440\u043e\u0432)<\/figcaption><\/figure>\n<p><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/lists\"><u>LazyList<\/u><\/a> &#8212; \u044d\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0432 Compose. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/lazy\/package-summary#lazyrow\"><strong><u>LazyRow<\/u><\/strong><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c<em> <\/em>\u043a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u043c\u044b\u0435 (Composables)<em> <\/em><code>FeatureTile<\/code> \u0438 <code>FeatureList<\/code>.<\/p>\n<pre><code class=\"kotlin\">@Composable fun FeatureTile(feature: Feature) {     Card(         shape = MaterialTheme.shapes.small,         modifier = Modifier             .size(Dimens.grid_6)             .aspectRatio(1f)             .padding(1.dp),         elevation = Dimens.plane_2     ) {         Image(             painter = painterResource(id = feature.iconResource),             contentDescription = feature.contentDescription,             alignment = Alignment.Center,             modifier = Modifier.padding(Dimens.grid_1_5)         )     } }<\/code><\/pre>\n<p><em>FeatureTile &#8212; \u0430\u043d\u0430\u043b\u043e\u0433 FeaturesAdapter.kt<\/em><\/p>\n<pre><code class=\"kotlin\">@Composable fun FeatureList(     list: List&lt;Feature&gt;,     modifier: Modifier, ) {     var itemsListState by remember { mutableStateOf(list) }     val lazyListState = rememberLazyListState()      LazyRow(         state = lazyListState,         modifier = modifier,     ) {         items(itemsListState) {             FeatureTile(feature = it)             Spacer(modifier = Modifier.width(Dimens.grid_1))              if (it == itemsListState.last()) {                 val currentList = itemsListState                  val secondPart = currentList.subList(0, lazyListState.firstVisibleItemIndex)                 val firstPart = currentList.subList(lazyListState.firstVisibleItemIndex, currentList.size)                  rememberCoroutineScope().launch {                     lazyListState.scrollToItem(0, maxOf(0, lazyListState.firstVisibleItemScrollOffset - SCROLL_DX_INT))                 }                  itemsListState = firstPart + secondPart             }         }     }     LaunchedEffect(Unit) {         autoScroll(lazyListState)     } }  private tailrec suspend fun autoScroll(lazyListState: LazyListState) {     lazyListState.scroll(MutatePriority.PreventUserInput) {         scrollBy(SCROLL_DX)     }     delay(DELAY_BETWEEN_SCROLL_MS)      autoScroll(lazyListState) }  private const val DELAY_BETWEEN_SCROLL_MS = 8L private const val SCROLL_DX = 1f<\/code><\/pre>\n<p><em>FeatureList \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u043e\u0439<\/em><\/p>\n<h4>\u0427\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/h4>\n<p>FeatureList \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 LazyRow. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 <a href=\"https:\/\/developer.android.com\/jetpack\/compose\/state\"><u>State<\/u><\/a>.<\/p>\n<blockquote>\n<p><em>&#8230; \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, Jetpack Compose \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e. \u0420\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0438 Jetpack Compose \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u0434\u043b\u044f \u0438\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/em> &#8212; <u>State<\/u><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/state\"><u> and Jetpack Compose<\/u><\/a><\/p>\n<\/blockquote>\n<h4>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u043c \u0432\u0441\u0435 \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c<\/h4>\n<ol>\n<li>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442 <code>MutableState<\/code> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u043c\u044b\u043c <code>FeatureList<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d, \u0441\u0431\u043e\u0440\u043d\u044b\u0439 <code>LazyRow<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0430\u043d \u0441 \u043d\u043e\u0432\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/lazy\/package-summary#items(androidx.compose.foundation.lazy.LazyListScope,kotlin.collections.List,kotlin.Function1,kotlin.Function2)\"><em><u>items()<\/u><\/em><\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u044f\u043c\u0431\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, <code>itemsListState<\/code> \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0443 <code>RecyclerView<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u044b\u0448\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <code>itemsListState<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u043e\u0439, \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0434\u0430 \u0432\u044b \u0443\u0433\u0430\u0434\u0430\u043b\u0438, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0434\u043b\u044f <code>LazyRow<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435\u043c \u043c\u0435\u0436\u0434\u0443 <code>LazyLists<\/code> \u0438 <code>RecyclerView<\/code> (\u0441 <code>ListAdapter<\/code>) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>LazyLists<\/code> \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043f\u0438\u0441\u043a\u0430, \u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043f\u0438\u0441\u043a\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430. \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 0 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0435 \u0432\u0438\u0434\u0438\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 <code>FeaturesList<\/code> \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u043b\u043e\u043a <a href=\"https:\/\/developer.android.com\/jetpack\/compose\/side-effects?hl=en#launchedeffect\"><u>LaunchedEffect <\/u><\/a>&nbsp;\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>autoScroll<\/code>. \u041a\u043e\u0440\u0443\u0442\u0438\u043d \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u043c\u044b\u0439 <code>FeaturesList<\/code> \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 <code>autoScroll<\/code> \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043f\u0435\u0440\u0435\u0434 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u043c \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0443 <code>RecyclerView<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p><strong>. &nbsp; &nbsp; . &nbsp; &nbsp; .<\/strong><\/p>\n<p><strong>\u0411\u043e\u043d\u0443\u0441: AutoScrollingLazyRow<\/strong><\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e <code>AutoScrollingLazyRow<\/code>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e.<\/p>\n<pre><code class=\"kotlin\">@Composable fun &lt;T : Any&gt; AutoScrollingLazyRow(     list: List&lt;T&gt;,     modifier: Modifier = Modifier,     scrollDx: Float = SCROLL_DX,     delayBetweenScrollMs: Long = DELAY_BETWEEN_SCROLL_MS,     divider: @Composable () -&gt; Unit = { Spacer(modifier = Modifier.width(Dimens.grid_1)) },     itemContent: @Composable (item: T) -&gt; Unit, ) {     var itemsListState by remember { mutableStateOf(list) }     val lazyListState = rememberLazyListState()      LazyRow(         state = lazyListState,         modifier = modifier,     ) {         items(itemsListState) {             itemContent(item = it)             divider()              if (it == itemsListState.last()) {                 val currentList = itemsListState                  val secondPart = currentList.subList(0, lazyListState.firstVisibleItemIndex)                 val firstPart = currentList.subList(lazyListState.firstVisibleItemIndex, currentList.size)                  rememberCoroutineScope().launch {                     lazyListState.scrollToItem(0, maxOf(0, lazyListState.firstVisibleItemScrollOffset - scrollDx.toInt()))                 }                  itemsListState = firstPart + secondPart             }         }      }     LaunchedEffect(Unit) {         autoScroll(lazyListState, scrollDx, delayBetweenScrollMs)     } }  private tailrec suspend fun autoScroll(     lazyListState: LazyListState,     scrollDx: Float,     delayBetweenScrollMs: Long, ) {     lazyListState.scroll(MutatePriority.PreventUserInput) {         scrollBy(scrollDx)     }     delay(delayBetweenScrollMs)      autoScroll(lazyListState, scrollDx, delayBetweenScrollMs) }  private const val DELAY_BETWEEN_SCROLL_MS = 8L private const val SCROLL_DX = 1f<\/code><\/pre>\n<pre><code class=\"kotlin\">AutoScrollingLazyRow(list = featuresList) {     FeatureTile(feature = it) }<\/code><\/pre>\n<p><em>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <\/em><code>AutoScrollingLazyRow<\/code><\/p>\n<p><strong>. &nbsp; &nbsp; . &nbsp; &nbsp; .<\/strong><\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u044b\u0441\u043b\u0438 \u0438 \u0442\u0430\u043d\u0433\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>LaunchedEffect<\/code> \u0441 \u043a\u043b\u044e\u0447\u043e\u043c Unit \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e <code>LazyRow<\/code>, \u044d\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f <code>LaunchedEffect<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 <code>itemsListState<\/code>, \u0441\u043f\u0438\u0441\u043e\u043a Features List \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u0442\u0441\u044f. <code>LaunchedEffect<\/code> \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043b\u044e\u0447\u0430, \u043d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0438\u0447\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 <code>FeaturesList<\/code> \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>itemsListState<\/code>, \u0432\u0430\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f <code>LaunchedEffect<\/code> \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438.<\/p>\n<p>\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u043e\u0439 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438. \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u044e\u0430\u043d\u0441 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 Compose \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0432\u0432\u043e\u0434 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b. \u0412 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432, \u043d\u043e \u0432 Compose \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0433\u043e!<\/p>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/layout\/recyclerview\"><u>RecyclerView<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/ListAdapter\"><u>ListAdapter<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/lists\"><u>\u0421\u043f\u0438\u0441\u043a\u0438 \u0432 Compose<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/state\"><u>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/side-effects\"><u>\u041f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0432 Compose<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/jorgecastillo.dev\/jetpack-compose-effect-handlers\"><u>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 Jetpack Compose<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/kotlinlang.org\/docs\/functions.html#tail-recursive-functions\"><u>\u0425\u0432\u043e\u0441\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 Kotlin<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<hr>\n<blockquote>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/KVq6\/\"><strong>&#171;Android Developer. Professional&#187;<\/strong><\/a>. \u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 <a href=\"https:\/\/otus.pw\/653Q\/\">\u0434\u0435\u043d\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0434\u0432\u0435\u0440\u0435\u0439<\/a> \u043e\u043d\u043b\u0430\u0439\u043d, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u0443\u0440\u0441\u0430. <\/p>\n<\/blockquote>\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\/company\/otus\/blog\/561522\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/561522\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h4>\u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u043d\u0430 Android<\/h4>\n<figure class=\"full-width\"><figcaption>\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RecyclerView (\u0441\u043b\u0435\u0432\u0430) \u0438 LazyRow (\u0441\u043f\u0440\u0430\u0432\u0430)<\/figcaption><\/figure>\n<h3>\u0418\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f RecyclerView + ListAdapter<\/h3>\n<p><a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/layout\/recyclerview\"><u>RecyclerView<\/u><\/a> &#8212; \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439 \u0438 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430(\u043e\u0432) \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043d\u0430 Android. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 RecyclerView, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0435\u043b\u0435\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u043e\u0439.<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043b\u044e\u0431\u043e\u0432\u044c\u044e \u200b\ufe0f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f RecyclerView (\u0412 GIF \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u0430\u0434\u0440\u043e\u0432)<\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443?<\/p>\n<p>\u041e\u0434\u043d\u0430 \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0443\u043c, &#8212; \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439. \u0425\u043e\u0442\u044f \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e, \u043e\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0442\u043e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438? <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043a\u043e\u0434\u0443 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 <code>FeaturesAdapter<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442&nbsp; <a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/ListAdapter\"><u>ListAdapte<\/u><\/a><u>r<\/u>.<\/p>\n<pre><code class=\"kotlin\">data class Feature(     @DrawableRes val iconResource: Int,     val contentDescription: String, )<\/code><\/pre>\n<pre><code class=\"kotlin\">class FeaturesAdapter : ListAdapter&lt;Feature, RecyclerView.ViewHolder&gt;(FeatureDiffCallback()) {      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {         val view = LayoutInflater             .from(parent.context)             .inflate(R.layout.item_feature_tile, parent, false)         return FeatureItemViewHolder(view)     }      override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {         val itemViewHolder = holder as FeatureItemViewHolder         itemViewHolder.bind(getItem(position))     }      inner class FeatureItemViewHolder(view: View) : RecyclerView.ViewHolder(view) {          fun bind(feature: Feature) {             with(itemView) {                 imageFeature.setImageResource(feature.iconResource)                 imageFeature.contentDescription = feature.contentDescription             }         }     } }  class FeatureDiffCallback : DiffUtil.ItemCallback&lt;Feature&gt;() {      override fun areItemsTheSame(oldItem: Feature, newItem: Feature): Boolean =         oldItem.iconResource == newItem.iconResource      override fun areContentsTheSame(oldItem: Feature, newItem: Feature): Boolean =         oldItem == newItem }<\/code><\/pre>\n<p>\u0410\u0434\u0430\u043f\u0442\u0435\u0440, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 ListAdapter, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 ListAdapter?<\/h3>\n<blockquote>\n<p><a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/RecyclerView.Adapter\"><em><u>RecyclerView.Adapter<\/u><\/em><\/a><em> &#8212; \u044d\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 <\/em><a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/RecyclerView\"><em><u>RecyclerView<\/u><\/em><\/a><em>, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439 \u0432\u043e\u043a\u0440\u0443\u0433 <\/em><a href=\"https:\/\/developer.android.com\/reference\/androidx\/recyclerview\/widget\/AsyncListDiffer\"><em><u>AsyncListDiffer<\/u><\/em><\/a><em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 Adapter \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430.<\/em><\/p>\n<\/blockquote>\n<p>\u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 (diff, diffing) \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0446\u0438\u043a\u043b\u0435? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u043a\u043e\u0434 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c.<\/p>\n<pre><code class=\"kotlin\">private fun setupFeatureTiles(featuresList: List&lt;Features&gt;) {     with(recyclerFeatures) {   \tlayoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)         adapter = featuresAdapter     }     featuresAdapter.submitList(featuresList)      lifecycleScope.launch { autoScrollFeaturesList() } }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b <code>ViewModel<\/code>. \u042d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u0441 \u0432\u044b\u0437\u043e\u0432\u043e\u043c <code>autoScrollFeaturesList<\/code>. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"kotlin\">private tailrec suspend fun autoScrollFeaturesList() {     if (recyclerFeatures.canScrollHorizontally(DIRECTION_RIGHT)) {         recyclerFeatures.smoothScrollBy(SCROLL_DX, 0)     } else {         val firstPosition =              (recyclerFeatures.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition()         if (firstPosition != RecyclerView.NO_POSITION) {             val currentList = featuresAdapter.currentList             val secondPart = currentList.subList(0, firstPosition)             val firstPart = currentList.subList(firstPosition, currentList.size)             featuresAdapter.submitList(firstPart + secondPart)         }     }     delay(DELAY_BETWEEN_SCROLL_MS)     autoScrollFeaturesList() }   private const val DELAY_BETWEEN_SCROLL_MS = 25L private const val SCROLL_DX = 5 private const val DIRECTION_RIGHT = 1<\/code><\/pre>\n<h4>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c<\/h4>\n<ol>\n<li>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"https:\/\/kotlinlang.org\/docs\/functions.html#tail-recursive-functions\"><u>\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f<\/u><\/a> \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0430\u043c\u0430 \u0441\u0435\u0431\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 RecyclerView \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>RecyclerView \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 5 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0434\u043e\u0448\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 RecyclerView \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d \u0434\u043e\u0441\u0442\u0438\u0433 \u043a\u043e\u043d\u0446\u0430 \u0441\u043f\u0438\u0441\u043a\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438:<br \/>\u2014 \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e.<br \/>\u2014 \u0412\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443. \u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f (diff, diffing) \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435. \u0410\u0434\u0430\u043f\u0442\u0435\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e \u0432\u0438\u0434\u0438\u043c\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 RecyclerView \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0441\u043f\u0440\u0430\u0432\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0448\u0430\u0433 2, \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430 5 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430 \u043f\u0440\u0438 \u0438\u0441\u0447\u0435\u0437\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0438 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0435\u0435 \u044f\u0432\u043d\u043e\u043c \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0438.<\/p>\n<figure class=\"\"><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0433\u0430 3 \u0438 4.<\/figcaption><\/figure>\n<p>\u042d\u0442\u043e\u0442 GIF \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440. <em>\u0415\u0441\u043b\u0438 \u043e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u043e\u0432, \u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 GIF, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e&#8230; \u043d\u0443<\/em>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p><strong>. &nbsp; &nbsp; . &nbsp; &nbsp; .<\/strong><\/p>\n<h2>\u0422\u0435\u043f\u0435\u0440\u044c \u0441 Compose<\/h2>\n<figure class=\"full-width\"><figcaption> \u0421\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043b\u044e\u0431\u043e\u0432\u044c\u044e \u200b\ufe0f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Compose (\u0412 GIF \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u0430\u0434\u0440\u043e\u0432)<\/figcaption><\/figure>\n<p><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/lists\"><u>LazyList<\/u><\/a> &#8212; \u044d\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0432 Compose. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/lazy\/package-summary#lazyrow\"><strong><u>LazyRow<\/u><\/strong><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c<em> <\/em>\u043a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u043c\u044b\u0435 (Composables)<em> <\/em><code>FeatureTile<\/code> \u0438 <code>FeatureList<\/code>.<\/p>\n<pre><code class=\"kotlin\">@Composable fun FeatureTile(feature: Feature) {     Card(         shape = MaterialTheme.shapes.small,         modifier = Modifier             .size(Dimens.grid_6)             .aspectRatio(1f)             .padding(1.dp),         elevation = Dimens.plane_2     ) {         Image(             painter = painterResource(id = feature.iconResource),             contentDescription = feature.contentDescription,             alignment = Alignment.Center,             modifier = Modifier.padding(Dimens.grid_1_5)         )     } }<\/code><\/pre>\n<p><em>FeatureTile &#8212; \u0430\u043d\u0430\u043b\u043e\u0433 FeaturesAdapter.kt<\/em><\/p>\n<pre><code class=\"kotlin\">@Composable fun FeatureList(     list: List&lt;Feature&gt;,     modifier: Modifier, ) {     var itemsListState by remember { mutableStateOf(list) }     val lazyListState = rememberLazyListState()      LazyRow(         state = lazyListState,         modifier = modifier,     ) {         items(itemsListState) {             FeatureTile(feature = it)             Spacer(modifier = Modifier.width(Dimens.grid_1))              if (it == itemsListState.last()) {                 val currentList = itemsListState                  val secondPart = currentList.subList(0, lazyListState.firstVisibleItemIndex)                 val firstPart = currentList.subList(lazyListState.firstVisibleItemIndex, currentList.size)                  rememberCoroutineScope().launch {                     lazyListState.scrollToItem(0, maxOf(0, lazyListState.firstVisibleItemScrollOffset - SCROLL_DX_INT))                 }                  itemsListState = firstPart + secondPart             }         }     }     LaunchedEffect(Unit) {         autoScroll(lazyListState)     } }  private tailrec suspend fun autoScroll(lazyListState: LazyListState) {     lazyListState.scroll(MutatePriority.PreventUserInput) {         scrollBy(SCROLL_DX)     }     delay(DELAY_BETWEEN_SCROLL_MS)      autoScroll(lazyListState) }  private const val DELAY_BETWEEN_SCROLL_MS = 8L private const val SCROLL_DX = 1f<\/code><\/pre>\n<p><em>FeatureList \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u043e\u0439<\/em><\/p>\n<h4>\u0427\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/h4>\n<p>FeatureList \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 LazyRow. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 <a href=\"https:\/\/developer.android.com\/jetpack\/compose\/state\"><u>State<\/u><\/a>.<\/p>\n<blockquote>\n<p><em>&#8230; \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, Jetpack Compose \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e. \u0420\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0438 Jetpack Compose \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u0434\u043b\u044f \u0438\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/em> &#8212; <u>State<\/u><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/state\"><u> and Jetpack Compose<\/u><\/a><\/p>\n<\/blockquote>\n<h4>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u043c \u0432\u0441\u0435 \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c<\/h4>\n<ol>\n<li>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442 <code>MutableState<\/code> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u043c\u044b\u043c <code>FeatureList<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d, \u0441\u0431\u043e\u0440\u043d\u044b\u0439 <code>LazyRow<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0430\u043d \u0441 \u043d\u043e\u0432\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/lazy\/package-summary#items(androidx.compose.foundation.lazy.LazyListScope,kotlin.collections.List,kotlin.Function1,kotlin.Function2)\"><em><u>items()<\/u><\/em><\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u044f\u043c\u0431\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, <code>itemsListState<\/code> \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0443 <code>RecyclerView<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u044b\u0448\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <code>itemsListState<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u043e\u0439, \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0434\u0430 \u0432\u044b \u0443\u0433\u0430\u0434\u0430\u043b\u0438, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0434\u043b\u044f <code>LazyRow<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435\u043c \u043c\u0435\u0436\u0434\u0443 <code>LazyLists<\/code> \u0438 <code>RecyclerView<\/code> (\u0441 <code>ListAdapter<\/code>) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>LazyLists<\/code> \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043f\u0438\u0441\u043a\u0430, \u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u043f\u0438\u0441\u043a\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430. \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 0 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0435 \u0432\u0438\u0434\u0438\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 <code>FeaturesList<\/code> \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u043b\u043e\u043a <a href=\"https:\/\/developer.android.com\/jetpack\/compose\/side-effects?hl=en#launchedeffect\"><u>LaunchedEffect <\/u><\/a>&nbsp;\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>autoScroll<\/code>. \u041a\u043e\u0440\u0443\u0442\u0438\u043d \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u043c\u044b\u0439 <code>FeaturesList<\/code> \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 <code>autoScroll<\/code><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\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-324589","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/324589","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=324589"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/324589\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=324589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=324589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=324589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}