fix #416, allow viewing bigger contact photos on the View screen

This commit is contained in:
tibbi 2019-08-14 16:11:53 +02:00
parent 71d9f740f0
commit 5eba2ff251
2 changed files with 398 additions and 369 deletions

View file

@ -8,6 +8,7 @@ import android.view.MenuItem
import android.view.View
import android.view.WindowManager
import android.widget.RelativeLayout
import com.bumptech.glide.Glide
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS
import com.simplemobiletools.contacts.pro.R
@ -146,6 +147,16 @@ class ViewContactActivity : ContactActivity() {
showPhotoPlaceholder(contact_photo)
} else {
updateContactPhoto(contact!!.photoUri, contact_photo, contact!!.photo)
Glide.with(this).load(currentContactPhotoPath).into(contact_photo_big)
contact_photo.setOnClickListener {
contact_photo_big.alpha = 0f
contact_photo_big.beVisible()
contact_photo_big.animate().alpha(1f).start()
}
contact_photo_big.setOnClickListener {
contact_photo_big.animate().alpha(0f).withEndAction { it.beGone() }.start()
}
}
val textColor = config.textColor

View file

@ -1,7 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/contact_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/contact_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -409,3 +414,16 @@
</RelativeLayout>
</ScrollView>
<ImageView
android:id="@+id/contact_photo_big"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#88000000"
android:clickable="true"
android:padding="@dimen/activity_margin"
android:src="@drawable/img_write_storage"
android:scaleType="fitCenter"
android:visibility="gone"/>
</RelativeLayout>