mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-05-07 20:58:47 +02:00
hide big contact photo on pressing Back, if it is open
This commit is contained in:
parent
96ec75e545
commit
58924763a0
@ -73,6 +73,14 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (contact_photo_big.isVisible()) {
|
||||||
|
hideBigContactPhoto()
|
||||||
|
} else {
|
||||||
|
super.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
menuInflater.inflate(R.menu.menu_view_contact, menu)
|
menuInflater.inflate(R.menu.menu_view_contact, menu)
|
||||||
menu.apply {
|
menu.apply {
|
||||||
@ -177,7 +185,7 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
contact_photo_big.setOnClickListener {
|
contact_photo_big.setOnClickListener {
|
||||||
contact_photo_big.animate().alpha(0f).withEndAction { it.beGone() }.start()
|
hideBigContactPhoto()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,6 +623,10 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
|
|
||||||
private fun getStarDrawable(on: Boolean) = resources.getDrawable(if (on) R.drawable.ic_star_on_vector else R.drawable.ic_star_off_vector)
|
private fun getStarDrawable(on: Boolean) = resources.getDrawable(if (on) R.drawable.ic_star_on_vector else R.drawable.ic_star_off_vector)
|
||||||
|
|
||||||
|
private fun hideBigContactPhoto() {
|
||||||
|
contact_photo_big.animate().alpha(0f).withEndAction { contact_photo_big.beGone() }.start()
|
||||||
|
}
|
||||||
|
|
||||||
private fun View.copyOnLongClick(value: String) {
|
private fun View.copyOnLongClick(value: String) {
|
||||||
setOnLongClickListener {
|
setOnLongClickListener {
|
||||||
copyToClipboard(value)
|
copyToClipboard(value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user