hiding the fake top big image
This commit is contained in:
parent
d1ebf226cd
commit
a996a40f82
|
@ -8,10 +8,6 @@ import android.provider.ContactsContract
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.widget.RelativeLayout
|
import android.widget.RelativeLayout
|
||||||
import com.bumptech.glide.Glide
|
|
||||||
import com.bumptech.glide.load.resource.bitmap.FitCenter
|
|
||||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
|
||||||
import com.bumptech.glide.request.RequestOptions
|
|
||||||
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.CONTACT_ID
|
import com.simplemobiletools.commons.helpers.CONTACT_ID
|
||||||
|
@ -80,14 +76,6 @@ class ViewContactActivity : ContactActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackPressed() {
|
|
||||||
if (contact_photo_big.alpha == 1f) {
|
|
||||||
hideBigContactPhoto()
|
|
||||||
} else {
|
|
||||||
super.onBackPressed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setupMenu() {
|
private fun setupMenu() {
|
||||||
(activity_track_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight
|
(activity_track_appbar.layoutParams as RelativeLayout.LayoutParams).topMargin = statusBarHeight
|
||||||
activity_track_toolbar.menu.apply {
|
activity_track_toolbar.menu.apply {
|
||||||
|
@ -182,23 +170,6 @@ class ViewContactActivity : ContactActivity() {
|
||||||
showPhotoPlaceholder(contact_photo)
|
showPhotoPlaceholder(contact_photo)
|
||||||
} else {
|
} else {
|
||||||
updateContactPhoto(contact!!.photoUri, contact_photo, contact!!.photo)
|
updateContactPhoto(contact!!.photoUri, contact_photo, contact!!.photo)
|
||||||
val options = RequestOptions()
|
|
||||||
.transform(FitCenter(), RoundedCorners(resources.getDimension(R.dimen.normal_margin).toInt()))
|
|
||||||
|
|
||||||
Glide.with(this)
|
|
||||||
.load(contact!!.photo ?: currentContactPhotoPath)
|
|
||||||
.apply(options)
|
|
||||||
.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 {
|
|
||||||
hideBigContactPhoto()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val textColor = config.textColor
|
val textColor = config.textColor
|
||||||
|
@ -634,10 +605,6 @@ 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)
|
||||||
|
|
|
@ -427,18 +427,6 @@
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/contact_photo_big"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:alpha="0"
|
|
||||||
android:background="#88000000"
|
|
||||||
android:clickable="true"
|
|
||||||
android:padding="@dimen/activity_margin"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:src="@drawable/img_write_storage"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/activity_track_top_shadow"
|
android:id="@+id/activity_track_top_shadow"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue