use some view visiblity extension functions

This commit is contained in:
tibbi 2017-11-09 19:14:51 +01:00
parent ae9cce880a
commit 96065615b4
4 changed files with 5 additions and 5 deletions

View file

@ -45,7 +45,7 @@ ext {
} }
dependencies { dependencies {
compile 'com.simplemobiletools:commons:2.38.1' compile 'com.simplemobiletools:commons:2.38.2'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.7.2' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.7.2'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'

View file

@ -372,7 +372,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
fun bindView(medium: Medium, displayFilenames: Boolean, scrollHorizontally: Boolean, isListViewType: Boolean, textColor: Int, fun bindView(medium: Medium, displayFilenames: Boolean, scrollHorizontally: Boolean, isListViewType: Boolean, textColor: Int,
animateGifs: Boolean, cropThumbnails: Boolean): View { animateGifs: Boolean, cropThumbnails: Boolean): View {
itemView.apply { itemView.apply {
play_outline.visibility = if (medium.video) View.VISIBLE else View.GONE play_outline.beVisibleIf(medium.video)
photo_name.beVisibleIf(displayFilenames || isListViewType) photo_name.beVisibleIf(displayFilenames || isListViewType)
photo_name.text = medium.name photo_name.text = medium.name
activity.loadImage(medium.path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails) activity.loadImage(medium.path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)

View file

@ -221,7 +221,7 @@ class PhotoFragment : ViewPagerFragment() {
} }
private fun addZoomableView() { private fun addZoomableView() {
if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.visibility == View.GONE) { if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.isGone()) {
view.subsampling_view.apply { view.subsampling_view.apply {
setBitmapDecoderClass(GlideDecoder::class.java) setBitmapDecoderClass(GlideDecoder::class.java)
maxScale = 10f maxScale = 10f
@ -320,7 +320,7 @@ class PhotoFragment : ViewPagerFragment() {
override fun fullscreenToggled(isFullscreen: Boolean) { override fun fullscreenToggled(isFullscreen: Boolean) {
this.isFullscreen = isFullscreen this.isFullscreen = isFullscreen
view.photo_details.apply { view.photo_details.apply {
if (visibility == View.VISIBLE) { if (isVisible()) {
animate().y(getExtendedDetailsY(height)) animate().y(getExtendedDetailsY(height))
} }
} }

View file

@ -594,7 +594,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mIsFullscreen = isFullscreen mIsFullscreen = isFullscreen
checkFullscreen() checkFullscreen()
mView.video_details.apply { mView.video_details.apply {
if (visibility == View.VISIBLE) { if (isVisible()) {
animate().y(getExtendedDetailsY(height)) animate().y(getExtendedDetailsY(height))
} }
} }