mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
This commit is contained in:
parent
0f906b20c9
commit
840e126652
2 changed files with 0 additions and 39 deletions
|
|
@ -149,7 +149,6 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
|||
private boolean categoriesPresent = false;
|
||||
private boolean depictionLoaded = false;
|
||||
private ViewTreeObserver.OnGlobalLayoutListener layoutListener; // for layout stuff, only used once!
|
||||
private ViewTreeObserver.OnScrollChangedListener scrollListener;
|
||||
|
||||
//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
|
||||
private Media media;
|
||||
|
|
@ -211,9 +210,6 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
|||
authorLayout.setVisibility(GONE);
|
||||
}
|
||||
|
||||
// Progressively darken the image in the background when we scroll detail pane up
|
||||
scrollListener = this::updateTheDarkness;
|
||||
view.getViewTreeObserver().addOnScrollChangedListener(scrollListener);
|
||||
locale = getResources().getConfiguration().locale;
|
||||
return view;
|
||||
}
|
||||
|
|
@ -313,10 +309,6 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
|||
getView().getViewTreeObserver().removeGlobalOnLayoutListener(layoutListener); // old Android was on crack. CRACK IS WHACK
|
||||
layoutListener = null;
|
||||
}
|
||||
if (scrollListener != null && getView() != null) {
|
||||
getView().getViewTreeObserver().removeOnScrollChangedListener(scrollListener);
|
||||
scrollListener = null;
|
||||
}
|
||||
|
||||
compositeDisposable.clear();
|
||||
super.onDestroyView();
|
||||
|
|
@ -583,18 +575,6 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
|||
return item;
|
||||
}
|
||||
|
||||
private void updateTheDarkness() {
|
||||
// You must face the darkness alone
|
||||
int scrollY = scrollView.getScrollY();
|
||||
int scrollMax = getView().getHeight();
|
||||
float scrollPercentage = (float) scrollY / (float) scrollMax;
|
||||
final float transparencyMax = 0.75f;
|
||||
if (scrollPercentage > transparencyMax) {
|
||||
scrollPercentage = transparencyMax;
|
||||
}
|
||||
image.setAlpha(1.0f - scrollPercentage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns captions for media details
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
package fr.free.nrw.commons.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class MediaDetailSpacer extends View {
|
||||
public MediaDetailSpacer(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public MediaDetailSpacer(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public MediaDetailSpacer(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue