Skip to content

Commit e442f73

Browse files
yuvipandaGerrit Code Review
authored and
Gerrit Code Review
committed
Merge "UI matching in detail view to iOS version"
2 parents 5ad8171 + e46a1fa commit e442f73

File tree

5 files changed

+251
-134
lines changed

5 files changed

+251
-134
lines changed
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

3-
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:layout_width="match_parent"
5-
android:layout_height="wrap_content"
6-
android:minHeight="48dp"
7-
android:padding="8dp"
8-
android:gravity="center_vertical"
9-
android:id="@+id/mediaDetailCategoryItemText"
10-
android:textSize="18sp"
11-
android:background="#AA000000"
12-
/>
3+
<LinearLayout
4+
xmlns:android="http://schemas.android.com/apk/res/android"
5+
android:orientation="vertical"
6+
android:layout_width="match_parent"
7+
android:layout_height="wrap_content">
8+
<TextView
9+
android:layout_width="match_parent"
10+
android:layout_height="wrap_content"
11+
android:minHeight="48dp"
12+
android:padding="12dp"
13+
android:gravity="center_vertical"
14+
android:id="@+id/mediaDetailCategoryItemText"
15+
android:textSize="14sp"
16+
android:textColor="@android:color/white"
17+
android:background="#20ffffff"
18+
/>
19+
<org.wikimedia.commons.media.MediaDetailSpacer
20+
android:layout_width="fill_parent"
21+
android:layout_height="8dp"/>
22+
</LinearLayout>

commons/res/layout/detail_main_panel.xml

Lines changed: 0 additions & 56 deletions
This file was deleted.

commons/res/layout/fragment_media_detail.xml

Lines changed: 128 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,137 @@
2828
android:scaleType="fitCenter"
2929
/>
3030

31-
<ListView
31+
<ScrollView
3232
android:layout_width="fill_parent"
3333
android:layout_height="wrap_content"
34-
android:id="@+id/mediaDetailListView"
35-
android:divider="#00A0A0A0"
34+
android:id="@+id/mediaDetailScrollView"
3635
android:fillViewport="true"
3736
android:background="@android:color/transparent"
38-
android:cacheColorHint="@android:color/transparent"
39-
/>
37+
android:cacheColorHint="@android:color/transparent">
38+
39+
<LinearLayout android:orientation="vertical"
40+
android:layout_width="fill_parent"
41+
android:layout_height="fill_parent">
42+
43+
<!-- Placeholder. Height gets set at runtime based on container size; the initial value is a hack to keep
44+
the detail info offscreen until it's placed properly. May be a better way to do this. -->
45+
<org.wikimedia.commons.media.MediaDetailSpacer
46+
android:layout_width="fill_parent"
47+
android:layout_height="16dp"
48+
android:id="@+id/mediaDetailSpacer"/>
49+
<LinearLayout
50+
android:orientation="vertical"
51+
android:layout_width="fill_parent"
52+
android:layout_height="wrap_content"
53+
android:background="#AA000000"
54+
android:padding="16dp">
55+
<LinearLayout
56+
android:orientation="vertical"
57+
android:layout_width="fill_parent"
58+
android:layout_height="wrap_content"
59+
android:background="#20ffffff"
60+
android:padding="16dp">
61+
<TextView
62+
android:layout_width="match_parent"
63+
android:layout_height="wrap_content"
64+
android:textColor="@android:color/white"
65+
android:text="Title"
66+
android:textSize="16sp"
67+
android:textStyle="bold"
68+
android:paddingBottom="6dp"/>
69+
<TextView
70+
android:layout_width="match_parent"
71+
android:layout_height="wrap_content"
72+
android:text="Title of the media"
73+
android:id="@+id/mediaDetailTitle"
74+
android:layout_gravity="left|start"
75+
android:textColor="@android:color/white"
76+
android:background="#20ffffff"
77+
android:textSize="14sp"
78+
android:padding="12dp"/>
79+
</LinearLayout>
80+
<org.wikimedia.commons.media.MediaDetailSpacer
81+
android:layout_width="fill_parent"
82+
android:layout_height="8dp"/>
83+
<LinearLayout
84+
android:orientation="vertical"
85+
android:layout_width="fill_parent"
86+
android:layout_height="wrap_content"
87+
android:background="#20ffffff"
88+
android:padding="16dp">
89+
<TextView
90+
android:layout_width="match_parent"
91+
android:layout_height="wrap_content"
92+
android:text="Description"
93+
android:textColor="@android:color/white"
94+
android:textSize="16sp"
95+
android:textStyle="bold"
96+
android:paddingBottom="6dp"/>
97+
<TextView
98+
android:layout_width="match_parent"
99+
android:layout_height="wrap_content"
100+
android: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."
101+
android:background="#20ffffff"
102+
android:id="@+id/mediaDetailDesc"
103+
android:textColor="@android:color/white"
104+
android:layout_gravity="left|start"
105+
android:textSize="14sp"
106+
android:padding="12dp"/>
107+
</LinearLayout>
108+
<org.wikimedia.commons.media.MediaDetailSpacer
109+
android:layout_width="fill_parent"
110+
android:layout_height="8dp"/>
111+
<LinearLayout
112+
android:orientation="vertical"
113+
android:layout_width="fill_parent"
114+
android:layout_height="wrap_content"
115+
android:background="#20ffffff"
116+
android:padding="16dp">
117+
<TextView
118+
android:layout_width="match_parent"
119+
android:layout_height="wrap_content"
120+
android:textColor="@android:color/white"
121+
android:text="License"
122+
android:textSize="16sp"
123+
android:textStyle="bold"
124+
android:paddingBottom="6dp"/>
125+
<TextView
126+
android:layout_width="match_parent"
127+
android:layout_height="wrap_content"
128+
android:text="License link"
129+
android:id="@+id/mediaDetailLicense"
130+
android:layout_gravity="left|start"
131+
android:background="#20ffffff"
132+
android:textColor="@android:color/white"
133+
android:textSize="14sp"
134+
android:padding="12dp"/>
135+
</LinearLayout>
136+
<org.wikimedia.commons.media.MediaDetailSpacer
137+
android:layout_width="fill_parent"
138+
android:layout_height="8dp"/>
139+
<LinearLayout
140+
android:orientation="vertical"
141+
android:layout_width="fill_parent"
142+
android:layout_height="wrap_content"
143+
android:background="#20ffffff"
144+
android:padding="16dp"
145+
android:textStyle="bold">
146+
<TextView
147+
android:layout_width="match_parent"
148+
android:layout_height="wrap_content"
149+
android:text="@string/detail_panel_cats_label"
150+
android:textSize="16sp"
151+
android:layout_gravity="left|start"
152+
android:textColor="@android:color/white"
153+
android:paddingBottom="6dp"/>
154+
<LinearLayout
155+
android:orientation="vertical"
156+
android:layout_width="match_parent"
157+
android:layout_height="wrap_content"
158+
android:id="@+id/mediaDetailCategoryContainer"/>
159+
</LinearLayout>
160+
</LinearLayout>
161+
</LinearLayout>
162+
</ScrollView>
40163

41164
</FrameLayout>

commons/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,7 @@
138138
<string name="detail_panel_cats_label">Categories</string>
139139
<string name="detail_panel_cats_loading">Loading...</string>
140140
<string name="detail_panel_cats_none">None selected</string>
141+
<string name="detail_description_empty">No description</string>
142+
<string name="detail_license_empty">Unknown license</string>
141143
<string name="provider_campaigns">Campaigns</string>
142144
</resources>

0 commit comments

Comments
 (0)