mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Add CommonPlaceClickActions Unit Tests (#4674)
This commit is contained in:
		
							parent
							
								
									0269894c64
								
							
						
					
					
						commit
						d1bf6d0e1d
					
				
					 2 changed files with 115 additions and 9 deletions
				
			
		|  | @ -74,7 +74,7 @@ class CommonPlaceClickActions @Inject constructor( | |||
| 
 | ||||
|     private fun openWebView(link: Uri): Boolean { | ||||
|         Utils.handleWebUrl(activity, link) | ||||
|         return true; | ||||
|         return true | ||||
|     } | ||||
| 
 | ||||
|     private fun PopupMenu.enableBy(menuId: Int, hasLink: Boolean) { | ||||
|  | @ -85,15 +85,19 @@ class CommonPlaceClickActions @Inject constructor( | |||
|         AlertDialog.Builder(activity) | ||||
|             .setMessage(R.string.login_alert_message) | ||||
|             .setPositiveButton(R.string.login) { dialog, which -> | ||||
|                 ActivityUtils.startActivityWithFlags( | ||||
|                     activity, | ||||
|                     LoginActivity::class.java, | ||||
|                     Intent.FLAG_ACTIVITY_CLEAR_TOP, | ||||
|                     Intent.FLAG_ACTIVITY_SINGLE_TOP | ||||
|                 ) | ||||
|                 applicationKvStore.putBoolean("login_skipped", false) | ||||
|                 activity.finish() | ||||
|                 setPositiveButton() | ||||
|             } | ||||
|             .show() | ||||
|     } | ||||
| 
 | ||||
|     private fun setPositiveButton() { | ||||
|         ActivityUtils.startActivityWithFlags( | ||||
|             activity, | ||||
|             LoginActivity::class.java, | ||||
|             Intent.FLAG_ACTIVITY_CLEAR_TOP, | ||||
|             Intent.FLAG_ACTIVITY_SINGLE_TOP | ||||
|         ) | ||||
|         applicationKvStore.putBoolean("login_skipped", false) | ||||
|         activity.finish() | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Madhur Gupta
						Madhur Gupta