Show "remote profile" message. (#873)

* Show "remote profile" message. Closes #806

* Improve remote message look
This commit is contained in:
Ivan Kupalov 2018-10-03 21:53:31 +02:00 committed by Konrad Pozniak
commit 6051ffe0b3
6 changed files with 30 additions and 10 deletions

View file

@ -361,6 +361,13 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportF
accountFragmentViewPager.hide()
}
if (account.isRemote()) {
accountRemoveView.show()
accountRemoveView.setOnClickListener {
LinkHelper.openLink(account.url, this)
}
}
val numberFormat = NumberFormat.getNumberInstance()
accountFollowersTextView.text = numberFormat.format(account.followersCount)
accountFollowingTextView.text = numberFormat.format(account.followingCount)

View file

@ -64,6 +64,7 @@ data class Account(
return account?.id == this.id
}
fun isRemote(): Boolean = this.username != this.localUsername
}
@Parcelize

View file

@ -11,9 +11,5 @@ fun View.hide() {
}
fun View.visible(visible: Boolean) {
this.visibility = if(visible) {
View.VISIBLE
} else {
View.GONE
}
this.visibility = if (visible) View.VISIBLE else View.GONE
}