mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-27 04:43:54 +01:00 
			
		
		
		
	Media detail page redone as a "slide-up" panel.
Loads and displays default or English description, and categories. No caching of this info yet. Scrollable pane is a ListView, with the title/desc/category label in a 'header' view along with a spacer view. The height of the spacer is set dynamically to the height of the total fragment minus 48dp, giving room for an initially-visible title section and a little spillover so you can see it's scrollable. Clicking on a category in the cats list opens the category page in an external web browser. In the future this should open the category within the app, but we don't have a per-cat view yet. Description and category list are not yet editable. GitHub: https://github.com/wikimedia/apps-android-commons/pull/41 Change-Id: I46d0a77481dbe64a268a72f3efe49ae72168541f
This commit is contained in:
		
							parent
							
								
									a1d435f86e
								
							
						
					
					
						commit
						4df8ec8fa9
					
				
					 13 changed files with 586 additions and 30 deletions
				
			
		
							
								
								
									
										10
									
								
								commons/res/drawable/media_info_shadow.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								commons/res/drawable/media_info_shadow.xml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| 
 | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <gradient | ||||
|             android:startColor="#00000000" | ||||
|             android:endColor="#ff000000" | ||||
|             android:angle="270" | ||||
|             > | ||||
|     </gradient> | ||||
| </shape> | ||||
							
								
								
									
										12
									
								
								commons/res/layout/detail_category_item.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								commons/res/layout/detail_category_item.xml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| 
 | ||||
| <TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|           android:layout_width="match_parent" | ||||
|           android:layout_height="wrap_content" | ||||
|           android:minHeight="48dp" | ||||
|           android:padding="8dp" | ||||
|           android:gravity="center_vertical" | ||||
|           android:id="@+id/mediaDetailCategoryItemText" | ||||
|           android:textSize="18sp" | ||||
|           android:background="#AA000000" | ||||
|           /> | ||||
							
								
								
									
										48
									
								
								commons/res/layout/detail_main_panel.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								commons/res/layout/detail_main_panel.xml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,48 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| 
 | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|               android:orientation="vertical" | ||||
|               android:layout_width="fill_parent" | ||||
|               android:layout_height="fill_parent"> | ||||
| 
 | ||||
|     <!-- 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. --> | ||||
|     <org.wikimedia.commons.media.MediaDetailSpacer | ||||
|             android:layout_width="fill_parent" | ||||
|             android:layout_height="1600dp" | ||||
|             android:id="@+id/mediaDetailSpacer"/> | ||||
|     <LinearLayout | ||||
|             android:orientation="vertical" | ||||
|             android:layout_width="fill_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:background="#AA000000" | ||||
|             android:padding="8dp"> | ||||
|         <TextView | ||||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:text="Title of the media" | ||||
|                 android:id="@+id/mediaDetailTitle" | ||||
|                 android:layout_gravity="left|start" | ||||
|                 android:textColor="@android:color/white" | ||||
|                 android:textSize="18sp" /> <!-- 18sp == MediumText --> | ||||
|         <TextView | ||||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 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." | ||||
|                 android:id="@+id/mediaDetailDesc" | ||||
|                 android:layout_gravity="left|start"/> | ||||
|         <TextView | ||||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:text="@string/detail_panel_cats_label" | ||||
|                 android:textSize="18sp" | ||||
|                 android:layout_gravity="left|start" | ||||
|                 android:paddingTop="24dp" android:textColor="@android:color/white"/> | ||||
|         <LinearLayout | ||||
|                 android:orientation="vertical" | ||||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:id="@+id/mediaDetailCategoryList" | ||||
|                 android:layout_gravity="left|start"/> | ||||
|     </LinearLayout> | ||||
| </LinearLayout> | ||||
|  | @ -28,31 +28,14 @@ | |||
|                android:scaleType="fitCenter" | ||||
|             /> | ||||
| 
 | ||||
|     <RelativeLayout | ||||
|     <ListView | ||||
|             android:layout_width="fill_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_gravity="center|bottom" | ||||
|             android:background="#AA000000" | ||||
|             android:padding="8dp" | ||||
|             > | ||||
| 
 | ||||
|         <EditText | ||||
|                 android:id="@+id/mediaDetailTitle" | ||||
|                 android:layout_width="fill_parent" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:imeOptions="flagNoExtractUi" | ||||
|                 android:inputType="textNoSuggestions" | ||||
|                 android:singleLine="true" | ||||
|                 android:textColor="#FFFFFF"/> | ||||
|        <!-- <TextView | ||||
|                 android:id="@+id/mediaDetailDescription" | ||||
|                 android:layout_width="fill_parent" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:layout_below="@id/mediaDetailTitle" | ||||
|                 android:layout_alignParentBottom="true" | ||||
|                 style="?android:textAppearanceSmall" | ||||
|                 android:textColor="#FFFFFFFF" | ||||
|                 /> --> | ||||
|     </RelativeLayout> | ||||
|             android:id="@+id/mediaDetailListView" | ||||
|             android:divider="#00A0A0A0" | ||||
|             android:fillViewport="true" | ||||
|             android:background="@android:color/transparent" | ||||
|             android:cacheColorHint="@android:color/transparent" | ||||
|             /> | ||||
| 
 | ||||
| </FrameLayout> | ||||
|  | @ -89,4 +89,7 @@ | |||
|   <string name="welcome_final_text">Message asking user if they understand what kinds of images to upload.</string> | ||||
|   <string name="welcome_final_button_text">Button text for confirming the user understands what kinds of images to upload. | ||||
| {{Identical|Yes}}</string> | ||||
|     <string name="detail_panel_cats_label">Label for categories list in media detail panel</string> | ||||
|     <string name="detail_panel_cats_loading">Placeholder for categories list in media detail panel, while loading from network.</string> | ||||
|     <string name="detail_panel_cats_none">Placeholder for categories list in media detail panel, if no categories found.</string> | ||||
| </resources> | ||||
|  |  | |||
|  | @ -102,4 +102,7 @@ | |||
|     <string name="welcome_copyright_subtext">Avoid copyrighted materials you found from the Internet as well as images of posters, book covers, etc.</string> | ||||
|     <string name="welcome_final_text">You think you got it?</string> | ||||
|     <string name="welcome_final_button_text">Yes!</string> | ||||
|     <string name="detail_panel_cats_label">Categories</string> | ||||
|     <string name="detail_panel_cats_loading">Loading...</string> | ||||
|     <string name="detail_panel_cats_none">None selected</string> | ||||
| </resources> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brion Vibber
						Brion Vibber