{"action":"created","comment":{"url":"https://api.github.com/repos/cortinico/slidetoact/pulls/comments/232849899","pull_request_review_id":174138160,"id":232849899,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjg0OTg5OQ==","diff_hunk":"@@ -436,82 +440,88 @@ class SlideToActView @JvmOverloads constructor (\n      * Private method that is performed when user completes the slide\n      */\n     private fun startAnimationComplete() {\n-        val animSet = AnimatorSet()\n-\n-        // Animator that moves the cursor\n-        val finalPositionAnimator = ValueAnimator.ofInt(mPosition, mAreaWidth - mAreaHeight)\n-        finalPositionAnimator.addUpdateListener {\n-            mPosition = it.animatedValue as Int\n-            invalidateArea()\n-        }\n-\n-        // Animator that bounce away the cursors\n-        val marginAnimator = ValueAnimator.ofInt(mActualAreaMargin, (mInnerRect.width() / 2).toInt() + mActualAreaMargin)\n-        marginAnimator.addUpdateListener {\n-            mActualAreaMargin = it.animatedValue as Int\n-            invalidateArea()\n-        }\n-        marginAnimator.interpolator = AnticipateOvershootInterpolator(2f)\n+        if (!isAnimateComplete) {\n+            mIsCompleted = true\n+            onSlideToActAnimationEventListener?.onSlideCompleteAnimationEnded(this@SlideToActView)\n+            onSlideCompleteListener?.onSlideComplete(this@SlideToActView)\n+        } else {\n+            val animSet = AnimatorSet()\n \n-        // Animator that reduces the outer area (to right)\n-        val areaAnimator = ValueAnimator.ofInt(0, (mAreaWidth - mAreaHeight) / 2)\n-        areaAnimator.addUpdateListener {\n-            mActualAreaWidth = it.animatedValue as Int\n-            if (Build.VERSION.SDK_INT >= 21) {\n-                invalidateOutline()\n+            // Animator that moves the cursor\n+            val finalPositionAnimator = ValueAnimator.ofInt(mPosition, mAreaWidth - mAreaHeight)\n+            finalPositionAnimator.addUpdateListener {\n+                mPosition = it.animatedValue as Int\n+                invalidateArea()\n             }\n-            invalidateArea()\n-        }\n \n-        val tickAnimator: ValueAnimator\n-        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) {\n-            // Fallback not using AVD.\n-            tickAnimator = ValueAnimator.ofInt(0, 255)\n-            tickAnimator.addUpdateListener {\n-                mTickMargin = mIconMargin\n-                mFlagDrawTick = true\n-                mDrawableTick.alpha = it.animatedValue as Int\n+            // Animator that bounce away the cursors\n+            val marginAnimator = ValueAnimator.ofInt(mActualAreaMargin, (mInnerRect.width() / 2).toInt() + mActualAreaMargin)\n+            marginAnimator.addUpdateListener {\n+                mActualAreaMargin = it.animatedValue as Int\n                 invalidateArea()\n             }\n-        } else {\n-            // Used AVD Animation.\n-            tickAnimator = ValueAnimator.ofInt(0)\n-            tickAnimator.addUpdateListener {\n-                if (!mFlagDrawTick) {\n+            marginAnimator.interpolator = AnticipateOvershootInterpolator(2f)\n+\n+            // Animator that reduces the outer area (to right)\n+            val areaAnimator = ValueAnimator.ofInt(0, (mAreaWidth - mAreaHeight) / 2)\n+            areaAnimator.addUpdateListener {\n+                mActualAreaWidth = it.animatedValue as Int\n+                if (Build.VERSION.SDK_INT >= 21) {\n+                    invalidateOutline()\n+                }\n+                invalidateArea()\n+            }\n+\n+            val tickAnimator: ValueAnimator\n+            if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) {\n+                // Fallback not using AVD.\n+                tickAnimator = ValueAnimator.ofInt(0, 255)\n+                tickAnimator.addUpdateListener {\n                     mTickMargin = mIconMargin\n                     mFlagDrawTick = true\n-                    startTickAnimation()\n+                    mDrawableTick.alpha = it.animatedValue as Int\n                     invalidateArea()\n                 }\n+            } else {\n+                // Used AVD Animation.\n+                tickAnimator = ValueAnimator.ofInt(0)\n+                tickAnimator.addUpdateListener {\n+                    if (!mFlagDrawTick) {\n+                        mTickMargin = mIconMargin\n+                        mFlagDrawTick = true\n+                        startTickAnimation()\n+                        invalidateArea()\n+                    }\n+                }\n             }\n-        }\n \n-        if (mPosition >= mAreaWidth - mAreaHeight) {\n-            animSet.playSequentially(marginAnimator, areaAnimator, tickAnimator)\n-        } else {\n-            animSet.playSequentially(finalPositionAnimator, marginAnimator, areaAnimator, tickAnimator)\n-        }\n+            if (mPosition >= mAreaWidth - mAreaHeight) {","path":"slidetoact/src/main/java/com/ncorti/slidetoact/SlideToActView.kt","position":121,"original_position":121,"commit_id":"2b53442c04395d234fa12164d770207fef77609b","original_commit_id":"2b53442c04395d234fa12164d770207fef77609b","user":{"login":"cortinico","id":3001957,"node_id":"MDQ6VXNlcjMwMDE5NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/3001957?v=4","gravatar_id":"","url":"https://api.github.com/users/cortinico","html_url":"https://github.com/cortinico","followers_url":"https://api.github.com/users/cortinico/followers","following_url":"https://api.github.com/users/cortinico/following{/other_user}","gists_url":"https://api.github.com/users/cortinico/gists{/gist_id}","starred_url":"https://api.github.com/users/cortinico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cortinico/subscriptions","organizations_url":"https://api.github.com/users/cortinico/orgs","repos_url":"https://api.github.com/users/cortinico/repos","events_url":"https://api.github.com/users/cortinico/events{/privacy}","received_events_url":"https://api.github.com/users/cortinico/received_events","type":"User","site_admin":false},"body":"What do you think about something like this:\r\n\r\n```kotlin\r\nval animators = mutableListOf<Animator>()\r\nif (mPosition < mAreaWidth - mAreaHeight) {\r\n    animators.add(finalPositionAnimator)\r\n}\r\nif (isAnimateComplete){\r\n    animators.add(marginAnimator)\r\n    animators.add(areaAnimator)\r\n    animators.add(tickAnimator)\r\n}\r\nanimSet.playSequentially()\r\n```\r\n\r\nAnd for the `startResetAnimation` you probably need something like this:\r\n```\r\nif (isAnimateComplete) {\r\n    animSet.playSequentially(tickAnimator, areaAnimator, positionAnimator, marginAnimator, arrowAnimator)\r\n} else {\r\n    animSet.playSequentially(positionAnimator)\r\n}\r\n```","created_at":"2018-11-12T23:42:09Z","updated_at":"2018-11-12T23:42:12Z","html_url":"https://github.com/cortinico/slidetoact/pull/38#discussion_r232849899","pull_request_url":"https://api.github.com/repos/cortinico/slidetoact/pulls/38","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/cortinico/slidetoact/pulls/comments/232849899"},"html":{"href":"https://github.com/cortinico/slidetoact/pull/38#discussion_r232849899"},"pull_request":{"href":"https://api.github.com/repos/cortinico/slidetoact/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/cortinico/slidetoact/pulls/38","id":230043206,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwMDQzMjA2","html_url":"https://github.com/cortinico/slidetoact/pull/38","diff_url":"https://github.com/cortinico/slidetoact/pull/38.diff","patch_url":"https://github.com/cortinico/slidetoact/pull/38.patch","issue_url":"https://api.github.com/repos/cortinico/slidetoact/issues/38","number":38,"state":"open","locked":false,"title":"Add ability to turn off complete animation","user":{"login":"sgcodigo","id":10543804,"node_id":"MDQ6VXNlcjEwNTQzODA0","avatar_url":"https://avatars3.githubusercontent.com/u/10543804?v=4","gravatar_id":"","url":"https://api.github.com/users/sgcodigo","html_url":"https://github.com/sgcodigo","followers_url":"https://api.github.com/users/sgcodigo/followers","following_url":"https://api.github.com/users/sgcodigo/following{/other_user}","gists_url":"https://api.github.com/users/sgcodigo/gists{/gist_id}","starred_url":"https://api.github.com/users/sgcodigo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgcodigo/subscriptions","organizations_url":"https://api.github.com/users/sgcodigo/orgs","repos_url":"https://api.github.com/users/sgcodigo/repos","events_url":"https://api.github.com/users/sgcodigo/events{/privacy}","received_events_url":"https://api.github.com/users/sgcodigo/received_events","type":"User","site_admin":false},"body":"## Status\r\n**READY**\r\n\r\n## Description\r\nAllow slide completion animation to be turned off\r\n\r\n## Related PRs/Issues\r\n#21 \r\n\r\n## Todos\r\n- [ ] Tests\r\n- [ ] Documentation\r\n- [ ] Screenshots\r\n\r\n## Feedback Reviews\r\n\r\n@cortinico","created_at":"2018-11-12T07:42:39Z","updated_at":"2018-11-12T23:42:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93b4b28459a434ddc494f94c5507b7608c45ce2c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cortinico/slidetoact/pulls/38/commits","review_comments_url":"https://api.github.com/repos/cortinico/slidetoact/pulls/38/comments","review_comment_url":"https://api.github.com/repos/cortinico/slidetoact/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cortinico/slidetoact/issues/38/comments","statuses_url":"https://api.github.com/repos/cortinico/slidetoact/statuses/2b53442c04395d234fa12164d770207fef77609b","head":{"label":"sgcodigo:disable_animation_complete","ref":"disable_animation_complete","sha":"2b53442c04395d234fa12164d770207fef77609b","user":{"login":"sgcodigo","id":10543804,"node_id":"MDQ6VXNlcjEwNTQzODA0","avatar_url":"https://avatars3.githubusercontent.com/u/10543804?v=4","gravatar_id":"","url":"https://api.github.com/users/sgcodigo","html_url":"https://github.com/sgcodigo","followers_url":"https://api.github.com/users/sgcodigo/followers","following_url":"https://api.github.com/users/sgcodigo/following{/other_user}","gists_url":"https://api.github.com/users/sgcodigo/gists{/gist_id}","starred_url":"https://api.github.com/users/sgcodigo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgcodigo/subscriptions","organizations_url":"https://api.github.com/users/sgcodigo/orgs","repos_url":"https://api.github.com/users/sgcodigo/repos","events_url":"https://api.github.com/users/sgcodigo/events{/privacy}","received_events_url":"https://api.github.com/users/sgcodigo/received_events","type":"User","site_admin":false},"repo":{"id":144953951,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ5NTM5NTE=","name":"slidetoact","full_name":"sgcodigo/slidetoact","private":false,"owner":{"login":"sgcodigo","id":10543804,"node_id":"MDQ6VXNlcjEwNTQzODA0","avatar_url":"https://avatars3.githubusercontent.com/u/10543804?v=4","gravatar_id":"","url":"https://api.github.com/users/sgcodigo","html_url":"https://github.com/sgcodigo","followers_url":"https://api.github.com/users/sgcodigo/followers","following_url":"https://api.github.com/users/sgcodigo/following{/other_user}","gists_url":"https://api.github.com/users/sgcodigo/gists{/gist_id}","starred_url":"https://api.github.com/users/sgcodigo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgcodigo/subscriptions","organizations_url":"https://api.github.com/users/sgcodigo/orgs","repos_url":"https://api.github.com/users/sgcodigo/repos","events_url":"https://api.github.com/users/sgcodigo/events{/privacy}","received_events_url":"https://api.github.com/users/sgcodigo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sgcodigo/slidetoact","description":"A simple 'Slide to Unlock' Material widget for Android, written in Kotlin 📱🎨🦄","fork":true,"url":"https://api.github.com/repos/sgcodigo/slidetoact","forks_url":"https://api.github.com/repos/sgcodigo/slidetoact/forks","keys_url":"https://api.github.com/repos/sgcodigo/slidetoact/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgcodigo/slidetoact/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgcodigo/slidetoact/teams","hooks_url":"https://api.github.com/repos/sgcodigo/slidetoact/hooks","issue_events_url":"https://api.github.com/repos/sgcodigo/slidetoact/issues/events{/number}","events_url":"https://api.github.com/repos/sgcodigo/slidetoact/events","assignees_url":"https://api.github.com/repos/sgcodigo/slidetoact/assignees{/user}","branches_url":"https://api.github.com/repos/sgcodigo/slidetoact/branches{/branch}","tags_url":"https://api.github.com/repos/sgcodigo/slidetoact/tags","blobs_url":"https://api.github.com/repos/sgcodigo/slidetoact/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgcodigo/slidetoact/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgcodigo/slidetoact/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgcodigo/slidetoact/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgcodigo/slidetoact/statuses/{sha}","languages_url":"https://api.github.com/repos/sgcodigo/slidetoact/languages","stargazers_url":"https://api.github.com/repos/sgcodigo/slidetoact/stargazers","contributors_url":"https://api.github.com/repos/sgcodigo/slidetoact/contributors","subscribers_url":"https://api.github.com/repos/sgcodigo/slidetoact/subscribers","subscription_url":"https://api.github.com/repos/sgcodigo/slidetoact/subscription","commits_url":"https://api.github.com/repos/sgcodigo/slidetoact/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgcodigo/slidetoact/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgcodigo/slidetoact/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgcodigo/slidetoact/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgcodigo/slidetoact/contents/{+path}","compare_url":"https://api.github.com/repos/sgcodigo/slidetoact/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgcodigo/slidetoact/merges","archive_url":"https://api.github.com/repos/sgcodigo/slidetoact/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgcodigo/slidetoact/downloads","issues_url":"https://api.github.com/repos/sgcodigo/slidetoact/issues{/number}","pulls_url":"https://api.github.com/repos/sgcodigo/slidetoact/pulls{/number}","milestones_url":"https://api.github.com/repos/sgcodigo/slidetoact/milestones{/number}","notifications_url":"https://api.github.com/repos/sgcodigo/slidetoact/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgcodigo/slidetoact/labels{/name}","releases_url":"https://api.github.com/repos/sgcodigo/slidetoact/releases{/id}","deployments_url":"https://api.github.com/repos/sgcodigo/slidetoact/deployments","created_at":"2018-08-16T07:38:53Z","updated_at":"2018-11-12T07:07:25Z","pushed_at":"2018-11-12T07:50:27Z","git_url":"git://github.com/sgcodigo/slidetoact.git","ssh_url":"git@github.com:sgcodigo/slidetoact.git","clone_url":"https://github.com/sgcodigo/slidetoact.git","svn_url":"https://github.com/sgcodigo/slidetoact","homepage":"","size":5239,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cortinico:master","ref":"master","sha":"de12e300fd85300a1c7990bdd1c29962a00b93f9","user":{"login":"cortinico","id":3001957,"node_id":"MDQ6VXNlcjMwMDE5NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/3001957?v=4","gravatar_id":"","url":"https://api.github.com/users/cortinico","html_url":"https://github.com/cortinico","followers_url":"https://api.github.com/users/cortinico/followers","following_url":"https://api.github.com/users/cortinico/following{/other_user}","gists_url":"https://api.github.com/users/cortinico/gists{/gist_id}","starred_url":"https://api.github.com/users/cortinico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cortinico/subscriptions","organizations_url":"https://api.github.com/users/cortinico/orgs","repos_url":"https://api.github.com/users/cortinico/repos","events_url":"https://api.github.com/users/cortinico/events{/privacy}","received_events_url":"https://api.github.com/users/cortinico/received_events","type":"User","site_admin":false},"repo":{"id":58338361,"node_id":"MDEwOlJlcG9zaXRvcnk1ODMzODM2MQ==","name":"slidetoact","full_name":"cortinico/slidetoact","private":false,"owner":{"login":"cortinico","id":3001957,"node_id":"MDQ6VXNlcjMwMDE5NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/3001957?v=4","gravatar_id":"","url":"https://api.github.com/users/cortinico","html_url":"https://github.com/cortinico","followers_url":"https://api.github.com/users/cortinico/followers","following_url":"https://api.github.com/users/cortinico/following{/other_user}","gists_url":"https://api.github.com/users/cortinico/gists{/gist_id}","starred_url":"https://api.github.com/users/cortinico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cortinico/subscriptions","organizations_url":"https://api.github.com/users/cortinico/orgs","repos_url":"https://api.github.com/users/cortinico/repos","events_url":"https://api.github.com/users/cortinico/events{/privacy}","received_events_url":"https://api.github.com/users/cortinico/received_events","type":"User","site_admin":false},"html_url":"https://github.com/cortinico/slidetoact","description":"A simple 'Slide to Unlock' Material widget for Android, written in Kotlin 📱🎨🦄","fork":false,"url":"https://api.github.com/repos/cortinico/slidetoact","forks_url":"https://api.github.com/repos/cortinico/slidetoact/forks","keys_url":"https://api.github.com/repos/cortinico/slidetoact/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cortinico/slidetoact/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cortinico/slidetoact/teams","hooks_url":"https://api.github.com/repos/cortinico/slidetoact/hooks","issue_events_url":"https://api.github.com/repos/cortinico/slidetoact/issues/events{/number}","events_url":"https://api.github.com/repos/cortinico/slidetoact/events","assignees_url":"https://api.github.com/repos/cortinico/slidetoact/assignees{/user}","branches_url":"https://api.github.com/repos/cortinico/slidetoact/branches{/branch}","tags_url":"https://api.github.com/repos/cortinico/slidetoact/tags","blobs_url":"https://api.github.com/repos/cortinico/slidetoact/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cortinico/slidetoact/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cortinico/slidetoact/git/refs{/sha}","trees_url":"https://api.github.com/repos/cortinico/slidetoact/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cortinico/slidetoact/statuses/{sha}","languages_url":"https://api.github.com/repos/cortinico/slidetoact/languages","stargazers_url":"https://api.github.com/repos/cortinico/slidetoact/stargazers","contributors_url":"https://api.github.com/repos/cortinico/slidetoact/contributors","subscribers_url":"https://api.github.com/repos/cortinico/slidetoact/subscribers","subscription_url":"https://api.github.com/repos/cortinico/slidetoact/subscription","commits_url":"https://api.github.com/repos/cortinico/slidetoact/commits{/sha}","git_commits_url":"https://api.github.com/repos/cortinico/slidetoact/git/commits{/sha}","comments_url":"https://api.github.com/repos/cortinico/slidetoact/comments{/number}","issue_comment_url":"https://api.github.com/repos/cortinico/slidetoact/issues/comments{/number}","contents_url":"https://api.github.com/repos/cortinico/slidetoact/contents/{+path}","compare_url":"https://api.github.com/repos/cortinico/slidetoact/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cortinico/slidetoact/merges","archive_url":"https://api.github.com/repos/cortinico/slidetoact/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cortinico/slidetoact/downloads","issues_url":"https://api.github.com/repos/cortinico/slidetoact/issues{/number}","pulls_url":"https://api.github.com/repos/cortinico/slidetoact/pulls{/number}","milestones_url":"https://api.github.com/repos/cortinico/slidetoact/milestones{/number}","notifications_url":"https://api.github.com/repos/cortinico/slidetoact/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cortinico/slidetoact/labels{/name}","releases_url":"https://api.github.com/repos/cortinico/slidetoact/releases{/id}","deployments_url":"https://api.github.com/repos/cortinico/slidetoact/deployments","created_at":"2016-05-09T00:47:18Z","updated_at":"2018-11-12T23:15:45Z","pushed_at":"2018-11-12T23:15:44Z","git_url":"git://github.com/cortinico/slidetoact.git","ssh_url":"git@github.com:cortinico/slidetoact.git","clone_url":"https://github.com/cortinico/slidetoact.git","svn_url":"https://github.com/cortinico/slidetoact","homepage":"","size":5241,"stargazers_count":252,"watchers_count":252,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":47,"open_issues":3,"watchers":252,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cortinico/slidetoact/pulls/38"},"html":{"href":"https://github.com/cortinico/slidetoact/pull/38"},"issue":{"href":"https://api.github.com/repos/cortinico/slidetoact/issues/38"},"comments":{"href":"https://api.github.com/repos/cortinico/slidetoact/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/cortinico/slidetoact/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/cortinico/slidetoact/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cortinico/slidetoact/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/cortinico/slidetoact/statuses/2b53442c04395d234fa12164d770207fef77609b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cortinico"}}