mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
* ic_map_dark_24dp: map icon for white background * ic_info_outline_dark_24dp: info icon for dark background * MediaDetailFragment: update the spacer as per image aspect ratio * fragment_media_detail: design overhaul * fragment_media_detail: remove redundant background color statements * make requested changes * add dark mode support * minor ui tweak * white map icon in dark mode * make rquested changes * make requested changes to layout * fix misalignment of category list * subtle amendments * convert comments to javadocs * minor amendments * minor changes * add styles for media detail * Media detail fragment refactored * make suggested changes * minor name fix * fix the delete button border
This commit is contained in:
parent
fcd2867d26
commit
81e12a9e1f
10 changed files with 194 additions and 178 deletions
|
|
@ -104,6 +104,8 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
|||
|
||||
@BindView(R.id.mediaDetailImageView)
|
||||
SimpleDraweeView image;
|
||||
@BindView(R.id.mediaDetailImageViewSpacer)
|
||||
LinearLayout imageSpacer;
|
||||
@BindView(R.id.mediaDetailTitle)
|
||||
TextView title;
|
||||
@BindView(R.id.mediaDetailDesc)
|
||||
|
|
@ -204,7 +206,7 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
|||
return view;
|
||||
}
|
||||
|
||||
@OnClick(R.id.mediaDetailImageView)
|
||||
@OnClick(R.id.mediaDetailImageViewSpacer)
|
||||
public void launchZoomActivity(View view) {
|
||||
Context ctx = view.getContext();
|
||||
ctx.startActivity(
|
||||
|
|
@ -248,13 +250,22 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
|||
compositeDisposable.add(disposable);
|
||||
}
|
||||
|
||||
/**
|
||||
* The imageSpacer is Basically a transparent overlay for the SimpleDraweeView
|
||||
* which holds the image to be displayed( moreover this image is out of
|
||||
* the scroll view )
|
||||
* @param imageInfo used to calculate height of the ImageSpacer
|
||||
*/
|
||||
private void updateAspectRatio(ImageInfo imageInfo) {
|
||||
if (imageInfo != null) {
|
||||
int screenWidth = scrollView.getWidth();
|
||||
int finalHeight = (screenWidth*imageInfo.getHeight()) / imageInfo.getWidth();
|
||||
ViewGroup.LayoutParams params = image.getLayoutParams();
|
||||
ViewGroup.LayoutParams spacerParams = imageSpacer.getLayoutParams();
|
||||
params.height = finalHeight;
|
||||
spacerParams.height = finalHeight;
|
||||
image.setLayoutParams(params);
|
||||
imageSpacer.setLayoutParams(spacerParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue