{"action":"created","comment":{"url":"https://api.github.com/repos/gnosis/heimdall-android/pulls/comments/157083921","pull_request_review_id":83668021,"id":157083921,"diff_hunk":"@@ -72,28 +80,62 @@ class SafeAdapter @Inject constructor(\n         abstract fun castedBind(data: T, payloads: List<Any>?)\n     }\n \n-    inner class ViewHolder(itemView: View) : CastingViewHolder<Safe>(Safe::class.java, itemView), View.OnClickListener {\n+    inner class ViewHolder(itemView: View) : CastingViewHolder<SafeWithInfo>(SafeWithInfo::class.java, itemView), View.OnClickListener {\n+        private val disposables = CompositeDisposable()\n \n         init {\n             itemView.setOnClickListener(this)\n             itemView.layout_safe_item_share.setOnClickListener {\n                 currentEntry?.let {\n                     it.let {\n-                        val addressString = it.address.asEthereumAddressString()\n-                        val title = context.getString(R.string.sharing_x, it.name ?: addressString)\n-                        context.shareExternalText(addressString, title)\n+                        val addressString = it.safe.address.asEthereumAddressString()\n+                        shareSelection.onNext(addressString)\n                     }\n                 }\n             }\n         }\n \n-        private var currentEntry: Safe? = null\n+        private var currentEntry: SafeWithInfo? = null\n \n-        override fun castedBind(data: Safe, payloads: List<Any>?) {\n+        override fun castedBind(data: SafeWithInfo, payloads: List<Any>?) {\n             currentEntry = data\n-            itemView.layout_safe_item_address.text = data.address.asEthereumAddressString()\n-            itemView.layout_safe_item_name.text = data.name\n-            itemView.layout_safe_item_name.visibility = if (data.name.isNullOrEmpty()) View.GONE else View.VISIBLE\n+            itemView.layout_safe_item_address.text = data.safe.address.asEthereumAddressString()\n+            itemView.layout_safe_item_name.text = data.safe.name\n+            itemView.layout_safe_item_name.visibility = if (data.safe.name.isNullOrEmpty()) View.GONE else View.VISIBLE\n+            if (data.info != null) {\n+                itemView.layout_safe_item_authorizations.text = \"${data.info.requiredConfirmations}/${data.info.owners.count()}\"\n+                itemView.layout_safe_item_ether.text = data.info.balance.toEther().stringWithNoTrailingZeroes()\n+\n+                itemView.layout_safe_item_owner.visibility =\n+                        if (data.info.owners.map { it.hexAsBigIntegerOrNull() }.any { accountAddress == it }) View.VISIBLE\n+                        else View.GONE\n+            } else {\n+                itemView.layout_safe_item_authorizations.text = \"-\"\n+                itemView.layout_safe_item_ether.text = \"-\"\n+            }\n+        }\n+\n+        @OnLifecycleEvent(Lifecycle.Event.ON_START)\n+        fun start() {\n+            // Make sure no disposable are left over\n+            disposables.clear()\n+            if (currentEntry?.info == null) {\n+                currentEntry?.safe?.address?.let { address ->\n+                    disposables += safeRepository.loadInfo(address)","path":"app/src/main/java/pm/gnosis/heimdall/ui/safe/overview/SafeAdapter.kt","position":111,"original_position":111,"commit_id":"c8110f08ad7d8062badcf663d5148c367953edd3","original_commit_id":"c8110f08ad7d8062badcf663d5148c367953edd3","user":{"login":"rmeissner","id":2896048,"avatar_url":"https://avatars1.githubusercontent.com/u/2896048?v=4","gravatar_id":"","url":"https://api.github.com/users/rmeissner","html_url":"https://github.com/rmeissner","followers_url":"https://api.github.com/users/rmeissner/followers","following_url":"https://api.github.com/users/rmeissner/following{/other_user}","gists_url":"https://api.github.com/users/rmeissner/gists{/gist_id}","starred_url":"https://api.github.com/users/rmeissner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmeissner/subscriptions","organizations_url":"https://api.github.com/users/rmeissner/orgs","repos_url":"https://api.github.com/users/rmeissner/repos","events_url":"https://api.github.com/users/rmeissner/events{/privacy}","received_events_url":"https://api.github.com/users/rmeissner/received_events","type":"User","site_admin":false},"body":"Shouldn't we use a viewmodel here?\r\n\r\nI know we talked about it, but maybe it makes sense to implement a simple cache in the viewmodel instead of the viewholder. So the viewmodel could have a HashMap<BigInteger, Info>.  Not sure if that might be too much work for now. Or we directly do it in the repo and use shared observables (there is an exension method for that)","created_at":"2017-12-14T22:50:19Z","updated_at":"2017-12-14T23:02:43Z","html_url":"https://github.com/gnosis/heimdall-android/pull/95#discussion_r157083921","pull_request_url":"https://api.github.com/repos/gnosis/heimdall-android/pulls/95","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gnosis/heimdall-android/pulls/comments/157083921"},"html":{"href":"https://github.com/gnosis/heimdall-android/pull/95#discussion_r157083921"},"pull_request":{"href":"https://api.github.com/repos/gnosis/heimdall-android/pulls/95"}}},"pull_request":{"url":"https://api.github.com/repos/gnosis/heimdall-android/pulls/95","id":158479754,"html_url":"https://github.com/gnosis/heimdall-android/pull/95","diff_url":"https://github.com/gnosis/heimdall-android/pull/95.diff","patch_url":"https://github.com/gnosis/heimdall-android/pull/95.patch","issue_url":"https://api.github.com/repos/gnosis/heimdall-android/issues/95","number":95,"state":"open","locked":false,"title":"WA-74: Adjust safes overview screen","user":{"login":"fmrsabino","id":3332770,"avatar_url":"https://avatars3.githubusercontent.com/u/3332770?v=4","gravatar_id":"","url":"https://api.github.com/users/fmrsabino","html_url":"https://github.com/fmrsabino","followers_url":"https://api.github.com/users/fmrsabino/followers","following_url":"https://api.github.com/users/fmrsabino/following{/other_user}","gists_url":"https://api.github.com/users/fmrsabino/gists{/gist_id}","starred_url":"https://api.github.com/users/fmrsabino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmrsabino/subscriptions","organizations_url":"https://api.github.com/users/fmrsabino/orgs","repos_url":"https://api.github.com/users/fmrsabino/repos","events_url":"https://api.github.com/users/fmrsabino/events{/privacy}","received_events_url":"https://api.github.com/users/fmrsabino/received_events","type":"User","site_admin":false},"body":"Changes proposed in this pull request:\r\n- Adjust safes overview screen\r\n\r\n@gnosis/mobile-devs\r\n","created_at":"2017-12-14T22:31:40Z","updated_at":"2017-12-14T23:02:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6303a0ee0bd1dcb41e18b4eca8855cf926112793","assignee":{"login":"fmrsabino","id":3332770,"avatar_url":"https://avatars3.githubusercontent.com/u/3332770?v=4","gravatar_id":"","url":"https://api.github.com/users/fmrsabino","html_url":"https://github.com/fmrsabino","followers_url":"https://api.github.com/users/fmrsabino/followers","following_url":"https://api.github.com/users/fmrsabino/following{/other_user}","gists_url":"https://api.github.com/users/fmrsabino/gists{/gist_id}","starred_url":"https://api.github.com/users/fmrsabino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmrsabino/subscriptions","organizations_url":"https://api.github.com/users/fmrsabino/orgs","repos_url":"https://api.github.com/users/fmrsabino/repos","events_url":"https://api.github.com/users/fmrsabino/events{/privacy}","received_events_url":"https://api.github.com/users/fmrsabino/received_events","type":"User","site_admin":false},"assignees":[{"login":"fmrsabino","id":3332770,"avatar_url":"https://avatars3.githubusercontent.com/u/3332770?v=4","gravatar_id":"","url":"https://api.github.com/users/fmrsabino","html_url":"https://github.com/fmrsabino","followers_url":"https://api.github.com/users/fmrsabino/followers","following_url":"https://api.github.com/users/fmrsabino/following{/other_user}","gists_url":"https://api.github.com/users/fmrsabino/gists{/gist_id}","starred_url":"https://api.github.com/users/fmrsabino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmrsabino/subscriptions","organizations_url":"https://api.github.com/users/fmrsabino/orgs","repos_url":"https://api.github.com/users/fmrsabino/repos","events_url":"https://api.github.com/users/fmrsabino/events{/privacy}","received_events_url":"https://api.github.com/users/fmrsabino/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/gnosis/heimdall-android/pulls/95/commits","review_comments_url":"https://api.github.com/repos/gnosis/heimdall-android/pulls/95/comments","review_comment_url":"https://api.github.com/repos/gnosis/heimdall-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gnosis/heimdall-android/issues/95/comments","statuses_url":"https://api.github.com/repos/gnosis/heimdall-android/statuses/c8110f08ad7d8062badcf663d5148c367953edd3","head":{"label":"gnosis:feature/WA-74","ref":"feature/WA-74","sha":"c8110f08ad7d8062badcf663d5148c367953edd3","user":{"login":"gnosis","id":24954468,"avatar_url":"https://avatars1.githubusercontent.com/u/24954468?v=4","gravatar_id":"","url":"https://api.github.com/users/gnosis","html_url":"https://github.com/gnosis","followers_url":"https://api.github.com/users/gnosis/followers","following_url":"https://api.github.com/users/gnosis/following{/other_user}","gists_url":"https://api.github.com/users/gnosis/gists{/gist_id}","starred_url":"https://api.github.com/users/gnosis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnosis/subscriptions","organizations_url":"https://api.github.com/users/gnosis/orgs","repos_url":"https://api.github.com/users/gnosis/repos","events_url":"https://api.github.com/users/gnosis/events{/privacy}","received_events_url":"https://api.github.com/users/gnosis/received_events","type":"Organization","site_admin":false},"repo":{"id":96440096,"name":"heimdall-android","full_name":"gnosis/heimdall-android","owner":{"login":"gnosis","id":24954468,"avatar_url":"https://avatars1.githubusercontent.com/u/24954468?v=4","gravatar_id":"","url":"https://api.github.com/users/gnosis","html_url":"https://github.com/gnosis","followers_url":"https://api.github.com/users/gnosis/followers","following_url":"https://api.github.com/users/gnosis/following{/other_user}","gists_url":"https://api.github.com/users/gnosis/gists{/gist_id}","starred_url":"https://api.github.com/users/gnosis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnosis/subscriptions","organizations_url":"https://api.github.com/users/gnosis/orgs","repos_url":"https://api.github.com/users/gnosis/repos","events_url":"https://api.github.com/users/gnosis/events{/privacy}","received_events_url":"https://api.github.com/users/gnosis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gnosis/heimdall-android","description":"🔐 App to manage and interact with the Gnosis Safe","fork":false,"url":"https://api.github.com/repos/gnosis/heimdall-android","forks_url":"https://api.github.com/repos/gnosis/heimdall-android/forks","keys_url":"https://api.github.com/repos/gnosis/heimdall-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gnosis/heimdall-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gnosis/heimdall-android/teams","hooks_url":"https://api.github.com/repos/gnosis/heimdall-android/hooks","issue_events_url":"https://api.github.com/repos/gnosis/heimdall-android/issues/events{/number}","events_url":"https://api.github.com/repos/gnosis/heimdall-android/events","assignees_url":"https://api.github.com/repos/gnosis/heimdall-android/assignees{/user}","branches_url":"https://api.github.com/repos/gnosis/heimdall-android/branches{/branch}","tags_url":"https://api.github.com/repos/gnosis/heimdall-android/tags","blobs_url":"https://api.github.com/repos/gnosis/heimdall-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gnosis/heimdall-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gnosis/heimdall-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/gnosis/heimdall-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gnosis/heimdall-android/statuses/{sha}","languages_url":"https://api.github.com/repos/gnosis/heimdall-android/languages","stargazers_url":"https://api.github.com/repos/gnosis/heimdall-android/stargazers","contributors_url":"https://api.github.com/repos/gnosis/heimdall-android/contributors","subscribers_url":"https://api.github.com/repos/gnosis/heimdall-android/subscribers","subscription_url":"https://api.github.com/repos/gnosis/heimdall-android/subscription","commits_url":"https://api.github.com/repos/gnosis/heimdall-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/gnosis/heimdall-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/gnosis/heimdall-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/gnosis/heimdall-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/gnosis/heimdall-android/contents/{+path}","compare_url":"https://api.github.com/repos/gnosis/heimdall-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gnosis/heimdall-android/merges","archive_url":"https://api.github.com/repos/gnosis/heimdall-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gnosis/heimdall-android/downloads","issues_url":"https://api.github.com/repos/gnosis/heimdall-android/issues{/number}","pulls_url":"https://api.github.com/repos/gnosis/heimdall-android/pulls{/number}","milestones_url":"https://api.github.com/repos/gnosis/heimdall-android/milestones{/number}","notifications_url":"https://api.github.com/repos/gnosis/heimdall-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gnosis/heimdall-android/labels{/name}","releases_url":"https://api.github.com/repos/gnosis/heimdall-android/releases{/id}","deployments_url":"https://api.github.com/repos/gnosis/heimdall-android/deployments","created_at":"2017-07-06T14:37:24Z","updated_at":"2017-11-29T10:56:01Z","pushed_at":"2017-12-14T22:31:41Z","git_url":"git://github.com/gnosis/heimdall-android.git","ssh_url":"git@github.com:gnosis/heimdall-android.git","clone_url":"https://github.com/gnosis/heimdall-android.git","svn_url":"https://github.com/gnosis/heimdall-android","homepage":"https://github.com/gnosis/gnosis-safe","size":2444,"stargazers_count":6,"watchers_count":6,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":3,"open_issues":11,"watchers":6,"default_branch":"master"}},"base":{"label":"gnosis:master","ref":"master","sha":"3ef6b478c53ba3f7ec5777f58ee8c7e9789f5670","user":{"login":"gnosis","id":24954468,"avatar_url":"https://avatars1.githubusercontent.com/u/24954468?v=4","gravatar_id":"","url":"https://api.github.com/users/gnosis","html_url":"https://github.com/gnosis","followers_url":"https://api.github.com/users/gnosis/followers","following_url":"https://api.github.com/users/gnosis/following{/other_user}","gists_url":"https://api.github.com/users/gnosis/gists{/gist_id}","starred_url":"https://api.github.com/users/gnosis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnosis/subscriptions","organizations_url":"https://api.github.com/users/gnosis/orgs","repos_url":"https://api.github.com/users/gnosis/repos","events_url":"https://api.github.com/users/gnosis/events{/privacy}","received_events_url":"https://api.github.com/users/gnosis/received_events","type":"Organization","site_admin":false},"repo":{"id":96440096,"name":"heimdall-android","full_name":"gnosis/heimdall-android","owner":{"login":"gnosis","id":24954468,"avatar_url":"https://avatars1.githubusercontent.com/u/24954468?v=4","gravatar_id":"","url":"https://api.github.com/users/gnosis","html_url":"https://github.com/gnosis","followers_url":"https://api.github.com/users/gnosis/followers","following_url":"https://api.github.com/users/gnosis/following{/other_user}","gists_url":"https://api.github.com/users/gnosis/gists{/gist_id}","starred_url":"https://api.github.com/users/gnosis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnosis/subscriptions","organizations_url":"https://api.github.com/users/gnosis/orgs","repos_url":"https://api.github.com/users/gnosis/repos","events_url":"https://api.github.com/users/gnosis/events{/privacy}","received_events_url":"https://api.github.com/users/gnosis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gnosis/heimdall-android","description":"🔐 App to manage and interact with the Gnosis Safe","fork":false,"url":"https://api.github.com/repos/gnosis/heimdall-android","forks_url":"https://api.github.com/repos/gnosis/heimdall-android/forks","keys_url":"https://api.github.com/repos/gnosis/heimdall-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gnosis/heimdall-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gnosis/heimdall-android/teams","hooks_url":"https://api.github.com/repos/gnosis/heimdall-android/hooks","issue_events_url":"https://api.github.com/repos/gnosis/heimdall-android/issues/events{/number}","events_url":"https://api.github.com/repos/gnosis/heimdall-android/events","assignees_url":"https://api.github.com/repos/gnosis/heimdall-android/assignees{/user}","branches_url":"https://api.github.com/repos/gnosis/heimdall-android/branches{/branch}","tags_url":"https://api.github.com/repos/gnosis/heimdall-android/tags","blobs_url":"https://api.github.com/repos/gnosis/heimdall-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gnosis/heimdall-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gnosis/heimdall-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/gnosis/heimdall-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gnosis/heimdall-android/statuses/{sha}","languages_url":"https://api.github.com/repos/gnosis/heimdall-android/languages","stargazers_url":"https://api.github.com/repos/gnosis/heimdall-android/stargazers","contributors_url":"https://api.github.com/repos/gnosis/heimdall-android/contributors","subscribers_url":"https://api.github.com/repos/gnosis/heimdall-android/subscribers","subscription_url":"https://api.github.com/repos/gnosis/heimdall-android/subscription","commits_url":"https://api.github.com/repos/gnosis/heimdall-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/gnosis/heimdall-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/gnosis/heimdall-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/gnosis/heimdall-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/gnosis/heimdall-android/contents/{+path}","compare_url":"https://api.github.com/repos/gnosis/heimdall-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gnosis/heimdall-android/merges","archive_url":"https://api.github.com/repos/gnosis/heimdall-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gnosis/heimdall-android/downloads","issues_url":"https://api.github.com/repos/gnosis/heimdall-android/issues{/number}","pulls_url":"https://api.github.com/repos/gnosis/heimdall-android/pulls{/number}","milestones_url":"https://api.github.com/repos/gnosis/heimdall-android/milestones{/number}","notifications_url":"https://api.github.com/repos/gnosis/heimdall-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gnosis/heimdall-android/labels{/name}","releases_url":"https://api.github.com/repos/gnosis/heimdall-android/releases{/id}","deployments_url":"https://api.github.com/repos/gnosis/heimdall-android/deployments","created_at":"2017-07-06T14:37:24Z","updated_at":"2017-11-29T10:56:01Z","pushed_at":"2017-12-14T22:31:41Z","git_url":"git://github.com/gnosis/heimdall-android.git","ssh_url":"git@github.com:gnosis/heimdall-android.git","clone_url":"https://github.com/gnosis/heimdall-android.git","svn_url":"https://github.com/gnosis/heimdall-android","homepage":"https://github.com/gnosis/gnosis-safe","size":2444,"stargazers_count":6,"watchers_count":6,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":3,"open_issues":11,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gnosis/heimdall-android/pulls/95"},"html":{"href":"https://github.com/gnosis/heimdall-android/pull/95"},"issue":{"href":"https://api.github.com/repos/gnosis/heimdall-android/issues/95"},"comments":{"href":"https://api.github.com/repos/gnosis/heimdall-android/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/gnosis/heimdall-android/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/gnosis/heimdall-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gnosis/heimdall-android/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/gnosis/heimdall-android/statuses/c8110f08ad7d8062badcf663d5148c367953edd3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rmeissner"}}