mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +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
296 lines
No EOL
14 KiB
XML
296 lines
No EOL
14 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
android:orientation="vertical"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="?attr/mainBackground"
|
|
>
|
|
|
|
<ImageView
|
|
android:id="@+id/mediaDetailImageFailed"
|
|
android:layout_height="wrap_content"
|
|
android:layout_width="wrap_content"
|
|
android:layout_gravity="center"
|
|
android:src="@android:drawable/ic_menu_close_clear_cancel"
|
|
android:visibility="gone"
|
|
android:contentDescription="@string/mediaimage_failed"
|
|
/>
|
|
|
|
<com.facebook.drawee.view.SimpleDraweeView
|
|
android:id="@+id/mediaDetailImageView"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="@dimen/dimen_250"
|
|
app:actualImageScaleType="none" />
|
|
|
|
<ScrollView
|
|
android:id="@+id/mediaDetailScrollView"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:background="@android:color/transparent"
|
|
android:cacheColorHint="@android:color/transparent"
|
|
android:fillViewport="true">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical">
|
|
|
|
<!-- Placeholder. Height gets set at runtime based on container size; the initial value is a hack to keep
|
|
the detail info offscreen until it's placed properly. May be a better way to do this. -->
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="@dimen/dimen_250"
|
|
android:orientation="vertical"
|
|
android:background="@android:color/transparent"
|
|
android:id="@+id/mediaDetailImageViewSpacer"
|
|
/>
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:background="?attr/mainBackground"
|
|
android:orientation="vertical">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:background="@color/primaryDarkColor"
|
|
android:orientation="horizontal"
|
|
android:padding="@dimen/quarter_standard_height">
|
|
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextLabelTitle"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:text="@string/media_detail_title" />
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextBody"
|
|
android:id="@+id/mediaDetailTitle"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:textColor="@android:color/white"
|
|
android:layout_height="match_parent"
|
|
tools:text="Title of the media" />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
style="@style/MediaDetailContainer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:id="@+id/authorLinearLayout"
|
|
android:orientation="horizontal">
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextLabelGeneric"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:text="@string/media_detail_author" />
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextBody"
|
|
android:id="@+id/mediaDetailAuthor"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
tools:text="Media author user name goes here." />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
style="@style/MediaDetailContainer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal">
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextLabelGeneric"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:text="@string/media_detail_description" />
|
|
|
|
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
|
android:id="@+id/mediaDetailDesc"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:layout_weight="70"
|
|
android:layout_gravity="start"
|
|
android:padding="@dimen/small_gap"
|
|
android:textColor="?attr/mediaDetailsText"
|
|
android:textSize="@dimen/description_text_size"
|
|
tools:text="Description of the media goes here. This can potentially be fairly long, and will need to wrap across multiple lines. We hope it looks nice though." />
|
|
</LinearLayout>
|
|
|
|
<View
|
|
android:background="?attr/mediaDetailSpacerColor"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="@dimen/tiny_gap"/>
|
|
|
|
<LinearLayout
|
|
style="@style/MediaDetailContainer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal">
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextLabelGeneric"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:text="@string/media_detail_license" />
|
|
|
|
<fr.free.nrw.commons.ui.widget.CompatTextView
|
|
android:id="@+id/mediaDetailLicense"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:layout_weight="70"
|
|
android:layout_gravity="start"
|
|
android:foreground="?attr/selectableItemBackground"
|
|
android:gravity="center_vertical"
|
|
android:padding="@dimen/small_gap"
|
|
android:textColor="?attr/mediaDetailsText"
|
|
android:textSize="@dimen/description_text_size"
|
|
app:drawablePadding="@dimen/tiny_gap"
|
|
app:drawableStart="?attr/iconInfo24"
|
|
tools:text="License link" />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
style="@style/MediaDetailContainer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal">
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextLabelGeneric"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:text="@string/media_detail_coordinates" />
|
|
|
|
<fr.free.nrw.commons.ui.widget.CompatTextView
|
|
android:id="@+id/mediaDetailCoordinates"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:layout_weight="70"
|
|
android:layout_gravity="start"
|
|
android:foreground="?attr/selectableItemBackground"
|
|
android:gravity="center_vertical"
|
|
android:padding="@dimen/small_gap"
|
|
android:textColor="?attr/mediaDetailsText"
|
|
android:textSize="@dimen/description_text_size"
|
|
app:drawablePadding="@dimen/tiny_gap"
|
|
app:drawableStart="?attr/iconMap24"
|
|
tools:text="Coordinates link" />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
style="@style/MediaDetailContainer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:textStyle="bold">
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextLabelGeneric"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:text="@string/detail_panel_cats_label" />
|
|
|
|
<LinearLayout
|
|
android:id="@+id/mediaDetailCategoryContainer"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:layout_weight="70"
|
|
android:orientation="vertical" />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
style="@style/MediaDetailContainer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal">
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextLabelGeneric"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:text="@string/media_detail_uploaded_date" />
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextBody"
|
|
android:id="@+id/mediaDetailuploadeddate"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
tools:text="Uploaded date" />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/nominatedDeletionBanner"
|
|
android:background="?attr/mediaDetailNominationBackground"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:padding="@dimen/quarter_standard_height"
|
|
android:visibility="gone">
|
|
|
|
<TextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center"
|
|
android:text="@string/nominated_for_deletion"
|
|
android:textColor="@color/primaryTextColor"
|
|
android:textSize="@dimen/normal_text"
|
|
android:textStyle="bold"/>
|
|
|
|
<TextView
|
|
android:id="@+id/seeMore"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center"
|
|
android:paddingTop="@dimen/standard_gap"
|
|
android:textColor="@color/primaryTextColor"
|
|
android:textSize="@dimen/normal_text"
|
|
android:textStyle="bold"/>
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
style="@style/MediaDetailContainer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal">
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextLabelGeneric"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent"
|
|
android:text="@string/media_detail_discussion" />
|
|
|
|
<TextView
|
|
style="@style/MediaDetailTextBody"
|
|
android:id="@+id/mediaDetailDisc"
|
|
android:layout_width="@dimen/widget_margin"
|
|
android:layout_height="match_parent" />
|
|
</LinearLayout>
|
|
|
|
<Button
|
|
android:id="@+id/copyWikicode"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_margin="@dimen/standard_gap"
|
|
android:background="@drawable/bg_copy_wikitext_button"
|
|
android:text="@string/copy_wikicode"
|
|
android:textColor="@color/primaryTextColor" />
|
|
|
|
<Button
|
|
android:id="@+id/nominateDeletion"
|
|
android:background="@drawable/bg_delete_button"
|
|
android:textColor="@color/primaryTextColor"
|
|
android:layout_margin="@dimen/standard_gap"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/nominate_deletion"/>
|
|
</LinearLayout>
|
|
</LinearLayout>
|
|
</ScrollView>
|
|
|
|
</FrameLayout> |