diff --git a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java index de4bf762b..baf6cac8b 100644 --- a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java @@ -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); } } diff --git a/app/src/main/res/drawable/bg_copy_wikitext_button.xml b/app/src/main/res/drawable/bg_copy_wikitext_button.xml new file mode 100644 index 000000000..a69e1073a --- /dev/null +++ b/app/src/main/res/drawable/bg_copy_wikitext_button.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_delete_button.xml b/app/src/main/res/drawable/bg_delete_button.xml index 819986f5b..2eab78e89 100644 --- a/app/src/main/res/drawable/bg_delete_button.xml +++ b/app/src/main/res/drawable/bg_delete_button.xml @@ -9,12 +9,9 @@ + android:color="?attr/mediaDetailNominationBackground"/> - diff --git a/app/src/main/res/drawable/ic_info_outline_dark_24dp.xml b/app/src/main/res/drawable/ic_info_outline_dark_24dp.xml new file mode 100644 index 000000000..79fc47261 --- /dev/null +++ b/app/src/main/res/drawable/ic_info_outline_dark_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_map_dark_24dp.xml b/app/src/main/res/drawable/ic_map_dark_24dp.xml new file mode 100644 index 000000000..2063dfe95 --- /dev/null +++ b/app/src/main/res/drawable/ic_map_dark_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/detail_category_item.xml b/app/src/main/res/layout/detail_category_item.xml index 02fb6c80f..181fdb1e0 100644 --- a/app/src/main/res/layout/detail_category_item.xml +++ b/app/src/main/res/layout/detail_category_item.xml @@ -10,15 +10,15 @@ android:id="@+id/mediaDetailCategoryItemText" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?attr/subBackground" + android:background="?attr/mainBackground" android:foreground="?attr/selectableItemBackground" android:gravity="center_vertical" android:minHeight="@dimen/overflow_button_dimen" - android:padding="@dimen/quarter_standard_height" - android:textColor="@android:color/white" + android:padding="@dimen/small_gap" + android:textColor="?attr/mediaDetailsText" android:textSize="@dimen/description_text_size" - app:drawablePadding="@dimen/small_gap" - app:drawableStart="@drawable/ic_info_outline_24dp" + app:drawablePadding="@dimen/tiny_gap" + app:drawableStart="?attr/iconInfo24" /> diff --git a/app/src/main/res/layout/fragment_media_detail.xml b/app/src/main/res/layout/fragment_media_detail.xml index 1cdcccaa5..1e238f377 100644 --- a/app/src/main/res/layout/fragment_media_detail.xml +++ b/app/src/main/res/layout/fragment_media_detail.xml @@ -19,11 +19,10 @@ /> + android:layout_height="@dimen/dimen_250" + app:actualImageScaleType="none" /> - + android:orientation="vertical" + android:background="@android:color/transparent" + android:id="@+id/mediaDetailImageViewSpacer" + /> + android:background="?attr/mainBackground" + android:orientation="vertical"> + android:background="@color/primaryDarkColor" + android:orientation="horizontal" + android:padding="@dimen/quarter_standard_height"> + + style="@style/MediaDetailTextLabelTitle" + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" + android:text="@string/media_detail_title" /> - - + android:orientation="horizontal"> + style="@style/MediaDetailTextLabelGeneric" + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" + android:text="@string/media_detail_author" /> - - + android:orientation="horizontal"> + style="@style/MediaDetailTextLabelGeneric" + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" + android:text="@string/media_detail_description" /> - + android:layout_height="@dimen/tiny_gap"/> + android:orientation="horizontal"> + style="@style/MediaDetailTextLabelGeneric" + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" + android:text="@string/media_detail_license" /> - - + android:orientation="horizontal"> + style="@style/MediaDetailTextLabelGeneric" + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" + android:text="@string/media_detail_coordinates" /> - - + style="@style/MediaDetailTextLabelGeneric" + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" + android:text="@string/detail_panel_cats_label" /> - - + android:orientation="horizontal"> + style="@style/MediaDetailTextLabelGeneric" + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" + android:text="@string/media_detail_uploaded_date" /> - - + + - - + android:orientation="horizontal"> + style="@style/MediaDetailTextLabelGeneric" + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" + android:text="@string/media_detail_discussion" /> + android:layout_width="@dimen/widget_margin" + android:layout_height="match_parent" />