{"id":418674,"date":"2024-06-30T02:21:28","date_gmt":"2024-06-30T02:21:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=418674"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-30T02:21:28","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=418674","title":{"rendered":"<span>\u0417\u0430\u043f\u0438\u0441\u044c \u0437\u0432\u0443\u043a\u0430 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u043d\u0430 Android<\/span>"},"content":{"rendered":"<div><!--[--><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/www.facebook.com\/tr?id=981564558927545&amp;ev=Habr\" style=\"display:none;\" width=\"1\"><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u042e\u0440\u0438\u0439 \u0414\u043e\u0440\u043e\u0444\u0435\u0435\u0432, \u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u044c \u0432 Mail.ru Group. \u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0430\u0443\u0434\u0438\u043e\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0442\u043e \u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u044d\u0442\u043e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442:<\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/615c507aad041b3b9bfdc77a\" data-style=\"\" id=\"615c507aad041b3b9bfdc77a\" width=\"\"><\/div>\n<\/div>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d\u0443<\/h2>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0438 Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 Android-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0442\u0435\u0433 <code>uses-permission<\/code> \u0438 \u0443\u043a\u0430\u0436\u0435\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 <code>RECORD_AUDIO<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;uses-permission android:name=\"android.permission.RECORD_AUDIO\" \/> <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u0432 runtime\u2019\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>ActivityCompat.requestPermission<\/code>:<\/p>\n<pre><code class=\"kotlin\">ActivityCompat.requestPermissions(     this,     arrayOf(android.Manifest.permission.RECORD_AUDIO),     777, ) <\/code><\/pre>\n<h3>\u0417\u0430\u043f\u0438\u0441\u044c \u0437\u0432\u0443\u043a\u0430<\/h3>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0437\u0432\u0443\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 <code>RecordController<\/code>. \u0423 \u043d\u0435\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430: <code>start<\/code> \u0438 <code>stop<\/code>. \u0414\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0433\u043e\u043b\u043e\u0441\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u0434\u0435\u043a \u0410\u0410\u0421:<\/p>\n<pre><code class=\"kotlin\">fun start() {     Log.d(TAG, \"Start\")     audioRecorder = MediaRecorder().apply{         setAudioSource(MediaRecorder.AudioSource.MIC)         setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS)         setAudioEncoder(MediaRecorder.AudioEncoder.AAC)         setOutputFile(getAudioPath())         prepare()         start()         } } <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0430\u0443\u0434\u0438\u043e \u0431\u0443\u0434\u0435\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:<\/p>\n<pre><code class=\"kotlin\">private fun getAudioPath(): String {     return \"${context.cacheDir.absolutePath}${File.pathSeparator}${System.currentTimeMillis()}.wav\" } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u043c\u0435\u0434\u0438\u0430\u0440\u0435\u043a\u043e\u0440\u0434\u0435\u0440\u0443 <code>stop<\/code> \u0438 <code>release<\/code>:<\/p>\n<pre><code class=\"kotlin\">fun stop() {     audioRecorder?.let {         Log.d(TAG, \"Stop\")         it.stop()         it.release()     }     audioRecorder = null   } <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c, \u0432\u0435\u0434\u0451\u0442\u0441\u044f \u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u0437\u0430\u043f\u0438\u0441\u044c:<\/p>\n<pre><code class=\"kotlin\">fun isAudioRecording() = audioRecorder != null <\/code><\/pre>\n<p>  <\/p>\n<h3>\u041a\u043d\u043e\u043f\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0437\u0430\u043f\u0438\u0441\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0435 <code>View<\/code> \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0435\u0433\u043e \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u044d\u043a\u0440\u0430\u043d\u0430. \u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435 \u043a\u043d\u043e\u043f\u043a\u0430, \u0430 <code>View<\/code>? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u0443\u0434\u0435\u043c \u0435\u0451 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u043d\u0430\u0436\u0430\u0442\u0438\u044f, \u0442\u0435\u043d\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e.<\/p>\n<pre><code class=\"kotlin\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"&lt;http:\/\/schemas.android.com\/apk\/res\/android>\"     xmlns:app=\"&lt;http:\/\/schemas.android.com\/apk\/res-auto>\"     xmlns:tools=\"&lt;http:\/\/schemas.android.com\/tools>\"     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"     tools:context=\".MainActivity\">      &lt;View         android:id=\"@+id\/start_button\"         android:layout_width=\"100dp\"         android:layout_height=\"100dp\"         android:background=\"@drawable\/oval\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\" \/>  &lt;\/androidx.constraintlayout.widget.ConstraintLayout> <\/code><\/pre>\n<p>  \u041f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b <code>start<\/code> \u0438\u043b\u0438 <code>stop<\/code>. \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043a\u043b\u0438\u043a\u0435 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c, \u0430 \u043f\u0440\u0438 \u0432\u0442\u043e\u0440\u043e\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0440\u0451\u043c \u0438\u0437 \u0440\u0435\u043a\u043e\u0440\u0434\u0435\u0440\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443:<\/p>\n<pre><code class=\"kotlin\">private fun onButtonClicked() {     if (recordController.isAudioRecording()) {         recordController.stop()     } else {         recordController.start()     } } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u043e \u043a\u043d\u043e\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0438\u043a\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u0430\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0430\u0443\u0434\u0438\u043e, \u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<h3>\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0438\u0441\u0438. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"kotlin\">fun getVolume() = audioRecorder?.maxAmplitude ?: 0 <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<p>  \u041f\u0440\u0438 \u043d\u0430\u0447\u0430\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0442\u0430\u0439\u043c\u0435\u0440 \u0434\u043b\u044f \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438. \u041f\u0443\u0441\u0442\u044c \u043e\u043d \u043a\u0430\u0436\u0434\u044b\u0435 100 \u043c\u0441 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"kotlin\">private fun onButtonClicked() {     if (recordController.isAudioRecording()) {         recordController.stop()         countDownTimer?.cancel()         countDownTimer = null     } else {         recordController.start()         countDownTimer = object : CountDownTimer(60_000, 100) {             override fun onTick(p0: Long) {                 val volume = recordController.getVolume()                 Log.d(TAG, \"Volume = $volume\")                 handleVolume(volume)             }              override fun onFinish() {             }         }.apply{             start()         }     } } <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0448\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443: \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0438\u0434\u0451\u0442 \u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u043e\u043c\u043a\u043e. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 <code>handleVolume<\/code>, \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043d\u0430 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c \u0438 \u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043d\u043e\u043f\u043a\u0438. \u0423 <code>View<\/code> \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u2014 \u044d\u0442\u043e <code>animate<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443? <code>MediaRecorder<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/stackoverflow.com\/a\/12932264\">16-\u0442\u0438 \u0431\u0438\u0442\u043d\u043e\u0433\u043e int<\/a> \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 32767. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443:<\/p>\n<pre><code class=\"kotlin\">private fun handleVolume(volume: Int) {     val scale = min(8.0, volume \/ MAX_RECORD_AMPLITUDE + 1.0).toFloat()     Log.d(TAG, \"Scale = $scale\")      audioButton.animate()         .scaleX(scale)         .scaleY(scale)         .setInterpolator(interpolator)         .duration= VOLUME_UPDATE_DURATION } <\/code><\/pre>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438: \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c <code>animate<\/code>, \u0442\u043e \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u043a\u0430\u0436\u0434\u0430\u044f \u043d\u043e\u0432\u0430\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e. \u0422\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0434\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 <code>onDestroy<\/code> \u0438\u043b\u0438 <code>onPause<\/code> \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 <code>Activity<\/code>.<\/p>\n<p>  \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0436\u0438\u0432\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <code>OvershootInterpolator<\/code>&#8216;\u043e\u043c, \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430: \u043a\u043d\u043e\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0432\u043d\u043e \u043f\u0443\u043b\u044c\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0440\u0430\u0442\u043a\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u044b\u0445\u043e\u0434\u044f \u0437\u0430 \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443:<\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/615c507bedd610f626b80ca2\" data-style=\"\" id=\"615c507bedd610f626b80ca2\" width=\"\"><\/div>\n<\/div>\n<p>  \u0412\u0441\u0451 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u041c\u043e\u0436\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0435\u0449\u0451 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0432\u0430\u043c \u0438\u043b\u0438 \u0432\u0430\u0448\u0435\u043c\u0443 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0443 ?<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/otopba\/record_view\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=c5iClfCaPrw\">\u0421\u043a\u0440\u0438\u043d\u043a\u0430\u0441\u0442 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/581626\/\"> https:\/\/habr.com\/ru\/articles\/581626\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/www.facebook.com\/tr?id=981564558927545&amp;ev=Habr\" style=\"display:none;\" width=\"1\"><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u042e\u0440\u0438\u0439 \u0414\u043e\u0440\u043e\u0444\u0435\u0435\u0432, \u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u044c \u0432 Mail.ru Group. \u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0430\u0443\u0434\u0438\u043e\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0442\u043e \u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u044d\u0442\u043e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442:<\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/615c507aad041b3b9bfdc77a\" data-style=\"\" id=\"615c507aad041b3b9bfdc77a\" width=\"\"><\/div>\n<\/div>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-418674","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/418674","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=418674"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/418674\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=418674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=418674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}