mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Merge v3.0.1 into master (#4446)
* Versioning and changelog for v3.0.0 (#4152) * Versioning for v3.0.0 * Update changelog.md * Handled migration 8-9-10 in BookmarksLocationDao (#4154) * #Fixes #4141 - Handled migrations for BookmarkLocationsDao from 8-9-10 * #Fixes #4141 - Handled migrations for BookmarkLocationsDao from 8-9-10 * Fixes #4179 (#4180) * Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked() * Updated >ContributionsFragment#backButtonClicked() to handle back press properly * Fixes #4179 (#4181) * Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed() * Cherrypick for hotfix3.1 (#4205) * Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list. Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list. * fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146) * fixed bug:app crashes on viewing review in Review Fragment #4135 * Fixed the issue with back button in contribution tab. (#4177) Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com> * Fixed the issue with back navigation button on toolbar in explore tab. (#4175) * Fix (#4148) Issues on theme change * fixed themeChange crashes * fixed comments * Overlooked the title bar Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com> Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com> Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com> Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com> * Fixes #4173 (#4396) * Fix #4147 Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390) * Update query to fetch descriptions * Make description added to NearbyResultItem * Make string operations to display description and label in a combined way * Fix reviews, remove long description from list and swap label and description texts * Fix repeated information issue * Fix double information issue * fix style issues * Remove douplicated information * Changes made (#4354) * Remove nonexistent method * Fix #4283 IllegalStateException (#4440) * Fix #4283 IllegalStateException * Fix flickering issue * Versioning for v3.0.1 * Update changelog.md Co-authored-by: Ashish <ashishkumar468@gmail.com> Co-authored-by: neslihanturan <tur.neslihan@gmail.com> Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com> Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com> Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com> Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com> Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com> Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									7823b18db9
								
							
						
					
					
						commit
						ca75f616d2
					
				
					 17 changed files with 115 additions and 71 deletions
				
			
		|  | @ -63,11 +63,27 @@ public class Place implements Parcelable { | |||
|         if(!StringUtils.isBlank(itemClass)) { | ||||
|             classEntityId = itemClass.replace("http://www.wikidata.org/entity/", ""); | ||||
|         } | ||||
|         // Set description when not null and not empty | ||||
|         String description = (item.getDescription().getValue() != null && !item.getDescription().getValue().isEmpty()) ? item.getDescription().getValue() : ""; | ||||
|         // When description is "?" but we have a valid label, just use the label. So replace "?" by "" in description | ||||
|         description = (description.equals("?") | ||||
|             && (item.getLabel().getValue() != null | ||||
|             && !item.getLabel().getValue().isEmpty()) ? "" : description); | ||||
|         /* | ||||
|          * If we have a valid label | ||||
|          *     - If have a valid label add the description at the end of the string with parenthesis | ||||
|          *     - If we don't have a valid label, string will include only the description. So add it without paranthesis | ||||
|          */ | ||||
|         description = ((item.getLabel().getValue() != null && !item.getLabel().getValue().isEmpty()) | ||||
|             ? item.getLabel().getValue() | ||||
|                 + ((description != null && !description.isEmpty()) | ||||
|                 ? " (" + description + ")" : "") | ||||
|             : description); | ||||
|         return new Place( | ||||
|                 item.getLabel().getLanguage(), | ||||
|                 item.getLabel().getValue(), | ||||
|                 Label.fromText(classEntityId), // list | ||||
|                 item.getClassLabel().getValue(), // details | ||||
|                 description, // description and label of Wikidata item | ||||
|                 PlaceUtils.latLngFromPointString(item.getLocation().getValue()), | ||||
|                 item.getCommonsCategory().getValue(), | ||||
|                 new Sitelinks.Builder() | ||||
|  |  | |||
|  | @ -51,7 +51,8 @@ fun placeAdapterDelegate( | |||
|                 tvDesc.setText(R.string.no_description_found) | ||||
|                 tvDesc.visibility = INVISIBLE | ||||
|             } else { | ||||
|                 tvDesc.text = descriptionText | ||||
|                 // Remove the label and display only texts inside pharentheses (description) since too long | ||||
|                 tvDesc.text = descriptionText.substringAfter(tvName.text.toString() + " (").substringBeforeLast(")"); | ||||
|             } | ||||
|             distance.text = item.distance | ||||
|             icon.setImageResource(item.label.icon) | ||||
|  |  | |||
|  | @ -1521,7 +1521,12 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment | |||
| 
 | ||||
|         title.setText(selectedPlace.name); | ||||
|         distance.setText(selectedPlace.distance); | ||||
|         description.setText(selectedPlace.getLongDescription()); | ||||
|         // Remove label since it is double information | ||||
|         String descriptionText = selectedPlace.getLongDescription() | ||||
|             .replace(selectedPlace.getName() + " (",""); | ||||
|         descriptionText = (descriptionText.equals(selectedPlace.getLongDescription()) ? descriptionText : descriptionText.replaceFirst(".$","")); | ||||
|         // Set the short description after we remove place name from long description | ||||
|         description.setText(descriptionText); | ||||
| 
 | ||||
|         fabCamera.setOnClickListener(view -> { | ||||
|             if (fabCamera.isShown()) { | ||||
|  |  | |||
|  | @ -12,6 +12,7 @@ class NearbyResultItem(private val item: ResultTuple?, | |||
|                        @field:SerializedName("commonsCategory") private val commonsCategory: ResultTuple?, | ||||
|                        @field:SerializedName("pic") private val pic: ResultTuple?, | ||||
|                        @field:SerializedName("destroyed") private val destroyed: ResultTuple?, | ||||
|                        @field:SerializedName("description") private val description: ResultTuple?, | ||||
|                        @field:SerializedName("endTime") private val endTime: ResultTuple?) { | ||||
| 
 | ||||
|     fun getItem(): ResultTuple { | ||||
|  | @ -58,6 +59,9 @@ class NearbyResultItem(private val item: ResultTuple?, | |||
|         return destroyed ?: ResultTuple() | ||||
|     } | ||||
| 
 | ||||
|     fun getDescription(): ResultTuple { | ||||
|         return description ?: ResultTuple() | ||||
| 
 | ||||
|     fun getEndTime(): ResultTuple { | ||||
|         return endTime ?: ResultTuple() | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Josephine Lim
						Josephine Lim