mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Bump target sdk to API 35 and make the app UI compatible with edge to edge (#6393)
* chore: upgrade target SDK and refactor function signatures to resolve build issues * chore: bump android gradle plugin version * chore(ui): add extension functions for applying edge to edge insets * fix: apply system bar top and bottom insets for edge to edge * fix: force edge to edge for backward compatibility and consistent UI * fix: apply top bar insets as padding and make the status bar color white Since the toolbars have primary color as bg, we should make the status bar white * chore: bump robolectric version for API 35 compatibility * fix: preserve existing margins when adding new insets * feat(customselector): improve RecyclerView edge-to-edge inset handling It allows the last item to sits above the navigation bar while preserving edge-to-edge appearance. * feat(notification): improve RecyclerView edge-to-edge insets handling Also, refactor LocationPicker and DescriptionEdit activities to use extension functions and reduce duplication * fix(quiz): enable and handle edge-to-edge insets and status icon colors * fix: bottom insets not dispatched on all API versions consistently Upgraded core-ktx version installCompatInsetsDispatch wasn't available on current version * fix: return fallback value when versionName is null Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: resolve compilation errors * docs: add KDoc for edge-to-edge insets utility functions * fix(SearchActivity): apply insets for system bars * fix(util): add utility function to handle keyboard insets with animation * fix(upload): handle keyboard insets for upload media detail card view * fix(login): hadle IME insets and make edge-to-edge backward compatible --------- Co-authored-by: Ritika Pahwa <83745993+RitikaPahwa4444@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									b8a558303b
								
							
						
					
					
						commit
						718c466505
					
				
					 35 changed files with 348 additions and 19 deletions
				
			
		|  | @ -38,6 +38,7 @@ import fr.free.nrw.commons.mwapi.UserClient | |||
| import fr.free.nrw.commons.nearby.Place | ||||
| import fr.free.nrw.commons.settings.Prefs | ||||
| import fr.free.nrw.commons.theme.BaseActivity | ||||
| import fr.free.nrw.commons.utils.applyEdgeToEdgeAllInsets | ||||
| import fr.free.nrw.commons.upload.ThumbnailsAdapter.OnThumbnailDeletedListener | ||||
| import fr.free.nrw.commons.upload.categories.UploadCategoriesFragment | ||||
| import fr.free.nrw.commons.upload.depicts.DepictsFragment | ||||
|  | @ -177,6 +178,7 @@ class UploadActivity : BaseActivity(), UploadContract.View, UploadBaseFragment.C | |||
|         presenter?.setupBasicKvStoreFactory { BasicKvStore(this@UploadActivity, it) } | ||||
| 
 | ||||
|         _binding = ActivityUploadBinding.inflate(layoutInflater) | ||||
|         applyEdgeToEdgeAllInsets(_binding!!.root, false) | ||||
|         setContentView(binding.root) | ||||
| 
 | ||||
|         // Overrides the back button to make sure the user is prepared to lose their progress | ||||
|  |  | |||
|  | @ -10,6 +10,7 @@ import fr.free.nrw.commons.ViewPagerAdapter | |||
| import fr.free.nrw.commons.contributions.ContributionDao | ||||
| import fr.free.nrw.commons.databinding.ActivityUploadProgressBinding | ||||
| import fr.free.nrw.commons.theme.BaseActivity | ||||
| import fr.free.nrw.commons.utils.applyEdgeToEdgeAllInsets | ||||
| import javax.inject.Inject | ||||
| 
 | ||||
| /** | ||||
|  | @ -35,6 +36,7 @@ class UploadProgressActivity : BaseActivity() { | |||
|     override fun onCreate(savedInstanceState: Bundle?) { | ||||
|         super.onCreate(savedInstanceState) | ||||
|         binding = ActivityUploadProgressBinding.inflate(layoutInflater) | ||||
|         applyEdgeToEdgeAllInsets(binding.root) | ||||
|         setContentView(binding.root) | ||||
|         viewPagerAdapter = ViewPagerAdapter(this, supportFragmentManager) | ||||
|         binding.uploadProgressViewPager.setAdapter(viewPagerAdapter) | ||||
|  |  | |||
|  | @ -50,6 +50,7 @@ import fr.free.nrw.commons.utils.ImageUtils.IMAGE_OK | |||
| import fr.free.nrw.commons.utils.ImageUtils.getErrorMessageForResult | ||||
| import fr.free.nrw.commons.utils.NetworkUtils.isInternetConnectionEstablished | ||||
| import fr.free.nrw.commons.utils.ViewUtil.showLongToast | ||||
| import fr.free.nrw.commons.utils.handleKeyboardInsets | ||||
| import timber.log.Timber | ||||
| import java.io.File | ||||
| import java.util.ArrayList | ||||
|  | @ -153,6 +154,7 @@ class UploadMediaDetailFragment : UploadBaseFragment(), UploadMediaDetailsContra | |||
|         inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? | ||||
|     ): View { | ||||
|         _binding = FragmentUploadMediaDetailFragmentBinding.inflate(inflater, container, false) | ||||
|         _binding!!.mediaDetailCardView.handleKeyboardInsets() | ||||
|         return binding.root | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Rohit Verma
						Rohit Verma