mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
Fixed Gray Overlay in Image (#1111)
* Added a clear search bar text button * Made caption disappear/show when tapping on image and removed gray overlay when no caption.
This commit is contained in:
parent
0a18220998
commit
a87704b00d
@ -215,6 +215,12 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment {
|
|||||||
|
|
||||||
loadImage();
|
loadImage();
|
||||||
|
|
||||||
|
String caption = media.caption;
|
||||||
|
String captionUrl = media.captionUrl;
|
||||||
|
boolean captionIsEmpty = TextUtils.isEmpty(caption);
|
||||||
|
boolean captionUrlIsEmpty = TextUtils.isEmpty(captionUrl);
|
||||||
|
boolean captionTextOrUrlIsNotEmpty = !captionIsEmpty || !captionUrlIsEmpty;
|
||||||
|
|
||||||
imageView.setOnClickListener(view -> {
|
imageView.setOnClickListener(view -> {
|
||||||
if (activity.isActionBarHidden()) {
|
if (activity.isActionBarHidden()) {
|
||||||
activity.getWindow().getDecorView().setSystemUiVisibility(0);
|
activity.getWindow().getDecorView().setSystemUiVisibility(0);
|
||||||
@ -222,6 +228,9 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment {
|
|||||||
if (activity.isUseBottomAppBar()) {
|
if (activity.isUseBottomAppBar()) {
|
||||||
bottomAppBarMenu.setVisibility(View.VISIBLE);
|
bottomAppBarMenu.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
if (captionTextOrUrlIsNotEmpty){
|
||||||
|
bottomAppBar.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
hideAppBar();
|
hideAppBar();
|
||||||
}
|
}
|
||||||
@ -263,11 +272,7 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String caption = media.caption;
|
if (captionTextOrUrlIsNotEmpty) {
|
||||||
String captionUrl = media.captionUrl;
|
|
||||||
boolean captionIsEmpty = TextUtils.isEmpty(caption);
|
|
||||||
boolean captionUrlIsEmpty = TextUtils.isEmpty(captionUrl);
|
|
||||||
if (!captionIsEmpty || !captionUrlIsEmpty) {
|
|
||||||
isUseBottomCaption = true;
|
isUseBottomCaption = true;
|
||||||
|
|
||||||
if (!activity.isUseBottomAppBar()) {
|
if (!activity.isUseBottomAppBar()) {
|
||||||
@ -314,6 +319,8 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment {
|
|||||||
captionUrlTextView.setVisibility(View.VISIBLE);
|
captionUrlTextView.setVisibility(View.VISIBLE);
|
||||||
captionUrlTextView.setHighlightColor(Color.TRANSPARENT);
|
captionUrlTextView.setHighlightColor(Color.TRANSPARENT);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
bottomAppBar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rootView;
|
return rootView;
|
||||||
@ -331,6 +338,7 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment {
|
|||||||
if (activity.isUseBottomAppBar()) {
|
if (activity.isUseBottomAppBar()) {
|
||||||
bottomAppBarMenu.setVisibility(View.GONE);
|
bottomAppBarMenu.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
bottomAppBar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadImage() {
|
private void loadImage() {
|
||||||
|
Loading…
Reference in New Issue
Block a user