Skip to content

Commit 612b4e7

Browse files
committed
fix : snappy jump of media detail on launch
1 parent ed4ed9f commit 612b4e7

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ class MediaDetailFragment : CommonsDaggerSupportFragment(), CategoryEditHelper.C
704704
spacerParams.height = finalHeight
705705
binding.mediaDetailImageView.layoutParams = params
706706
binding.mediaDetailImageViewSpacer.layoutParams = spacerParams
707+
if(finalHeight>0)
708+
binding.mediaDetailScrollView.visibility = View.VISIBLE
707709
}
708710
}
709711

app/src/main/res/layout/fragment_media_detail.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<com.facebook.drawee.view.SimpleDraweeView
2828
android:id="@+id/mediaDetailImageView"
29-
android:layout_width="wrap_content"
29+
android:layout_width="0dp"
3030
android:layout_height="@dimen/dimen_250"
3131
android:layout_gravity="center_horizontal"
3232
app:actualImageScaleType="none" />
@@ -37,7 +37,9 @@
3737
android:layout_height="wrap_content"
3838
android:background="@android:color/transparent"
3939
android:cacheColorHint="@android:color/transparent"
40-
android:fillViewport="true">
40+
android:fillViewport="true"
41+
android:visibility="invisible"
42+
tools:visibility="visible">
4143

4244
<LinearLayout
4345
android:layout_width="match_parent"

0 commit comments

Comments
 (0)