@@ -149,7 +149,6 @@ public static MediaDetailFragment forMedia(int index, boolean editable, boolean
149
149
private boolean categoriesPresent = false ;
150
150
private boolean depictionLoaded = false ;
151
151
private ViewTreeObserver .OnGlobalLayoutListener layoutListener ; // for layout stuff, only used once!
152
- private ViewTreeObserver .OnScrollChangedListener scrollListener ;
153
152
154
153
//Had to make this class variable, to implement various onClicks, which access the media, also I fell why make separate variables when one can serve the purpose
155
154
private Media media ;
@@ -211,9 +210,6 @@ && getParentFragment() instanceof MediaDetailPagerFragment) {
211
210
authorLayout .setVisibility (GONE );
212
211
}
213
212
214
- // Progressively darken the image in the background when we scroll detail pane up
215
- scrollListener = this ::updateTheDarkness ;
216
- view .getViewTreeObserver ().addOnScrollChangedListener (scrollListener );
217
213
locale = getResources ().getConfiguration ().locale ;
218
214
return view ;
219
215
}
@@ -313,10 +309,6 @@ public void onDestroyView() {
313
309
getView ().getViewTreeObserver ().removeGlobalOnLayoutListener (layoutListener ); // old Android was on crack. CRACK IS WHACK
314
310
layoutListener = null ;
315
311
}
316
- if (scrollListener != null && getView () != null ) {
317
- getView ().getViewTreeObserver ().removeOnScrollChangedListener (scrollListener );
318
- scrollListener = null ;
319
- }
320
312
321
313
compositeDisposable .clear ();
322
314
super .onDestroyView ();
@@ -583,18 +575,6 @@ private View buildCatLabel(final String catName, ViewGroup categoryContainer) {
583
575
return item ;
584
576
}
585
577
586
- private void updateTheDarkness () {
587
- // You must face the darkness alone
588
- int scrollY = scrollView .getScrollY ();
589
- int scrollMax = getView ().getHeight ();
590
- float scrollPercentage = (float ) scrollY / (float ) scrollMax ;
591
- final float transparencyMax = 0.75f ;
592
- if (scrollPercentage > transparencyMax ) {
593
- scrollPercentage = transparencyMax ;
594
- }
595
- image .setAlpha (1.0f - scrollPercentage );
596
- }
597
-
598
578
/**
599
579
* Returns captions for media details
600
580
*
0 commit comments