mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Merge branch 'v4.2.0-release'
This commit is contained in:
		
						commit
						1490710a51
					
				
					 137 changed files with 456 additions and 449 deletions
				
			
		|  | @ -41,8 +41,9 @@ import fr.free.nrw.commons.R; | |||
| import fr.free.nrw.commons.Utils; | ||||
| import fr.free.nrw.commons.auth.SessionManager; | ||||
| import fr.free.nrw.commons.di.CommonsDaggerSupportFragment; | ||||
| import fr.free.nrw.commons.utils.DialogUtil; | ||||
| import fr.free.nrw.commons.media.MediaClient; | ||||
| import fr.free.nrw.commons.profile.ProfileActivity; | ||||
| import fr.free.nrw.commons.utils.DialogUtil; | ||||
| import fr.free.nrw.commons.utils.SystemThemeUtils; | ||||
| import fr.free.nrw.commons.utils.ViewUtil; | ||||
| import java.util.Locale; | ||||
|  | @ -52,7 +53,6 @@ import javax.inject.Inject; | |||
| import javax.inject.Named; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.wikipedia.dataclient.WikiSite; | ||||
| import fr.free.nrw.commons.profile.ProfileActivity; | ||||
| 
 | ||||
| 
 | ||||
| /** | ||||
|  | @ -112,7 +112,8 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl | |||
| 
 | ||||
|     private ContributionsListAdapter adapter; | ||||
| 
 | ||||
|     @Nullable private Callback callback; | ||||
|     @Nullable | ||||
|     private Callback callback; | ||||
| 
 | ||||
|     private final int SPAN_COUNT_LANDSCAPE = 3; | ||||
|     private final int SPAN_COUNT_PORTRAIT = 1; | ||||
|  | @ -142,7 +143,8 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl | |||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public void onCreate(@Nullable @org.jetbrains.annotations.Nullable final Bundle savedInstanceState) { | ||||
|     public void onCreate( | ||||
|         @Nullable @org.jetbrains.annotations.Nullable final Bundle savedInstanceState) { | ||||
|         super.onCreate(savedInstanceState); | ||||
|         //Now that we are allowing this fragment to be started for | ||||
|         // any userName- we expect it to be passed as an argument | ||||
|  | @ -336,7 +338,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl | |||
|      * Launch Custom Selector. | ||||
|      */ | ||||
|     @OnClick(R.id.fab_custom_gallery) | ||||
|     void launchCustomSelector(){ | ||||
|     void launchCustomSelector() { | ||||
|         controller.initiateCustomGalleryPickWithPermission(getActivity()); | ||||
|         animateFAB(isFabOpen); | ||||
|     } | ||||
|  | @ -348,24 +350,24 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment impl | |||
|     private void animateFAB(final boolean isFabOpen) { | ||||
|         this.isFabOpen = !isFabOpen; | ||||
|         if (fabPlus.isShown()) { | ||||
|         if (isFabOpen) { | ||||
|             fabPlus.startAnimation(rotate_backward); | ||||
|             fabCamera.startAnimation(fab_close); | ||||
|             fabGallery.startAnimation(fab_close); | ||||
|             fabCustomGallery.startAnimation(fab_close); | ||||
|             fabCamera.hide(); | ||||
|             fabGallery.hide(); | ||||
|             fabCustomGallery.hide(); | ||||
|         } else { | ||||
|             fabPlus.startAnimation(rotate_forward); | ||||
|             fabCamera.startAnimation(fab_open); | ||||
|             fabGallery.startAnimation(fab_open); | ||||
|             fabCustomGallery.startAnimation(fab_open); | ||||
|             fabCamera.show(); | ||||
|             fabGallery.show(); | ||||
|             fabCustomGallery.show(); | ||||
|         } | ||||
|         this.isFabOpen = !isFabOpen; | ||||
|             if (isFabOpen) { | ||||
|                 fabPlus.startAnimation(rotate_backward); | ||||
|                 fabCamera.startAnimation(fab_close); | ||||
|                 fabGallery.startAnimation(fab_close); | ||||
|                 fabCustomGallery.startAnimation(fab_close); | ||||
|                 fabCamera.hide(); | ||||
|                 fabGallery.hide(); | ||||
|                 fabCustomGallery.hide(); | ||||
|             } else { | ||||
|                 fabPlus.startAnimation(rotate_forward); | ||||
|                 fabCamera.startAnimation(fab_open); | ||||
|                 fabGallery.startAnimation(fab_open); | ||||
|                 fabCustomGallery.startAnimation(fab_open); | ||||
|                 fabCamera.show(); | ||||
|                 fabGallery.show(); | ||||
|                 fabCustomGallery.show(); | ||||
|             } | ||||
|             this.isFabOpen = !isFabOpen; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,5 +1,7 @@ | |||
| package fr.free.nrw.commons.filepicker; | ||||
| 
 | ||||
| import static fr.free.nrw.commons.filepicker.PickedFiles.singleFileList; | ||||
| 
 | ||||
| import android.app.Activity; | ||||
| import android.content.ClipData; | ||||
| import android.content.Context; | ||||
|  | @ -8,13 +10,11 @@ import android.content.SharedPreferences; | |||
| import android.content.pm.PackageManager; | ||||
| import android.content.pm.ResolveInfo; | ||||
| import android.net.Uri; | ||||
| import androidx.preference.PreferenceManager; | ||||
| import android.provider.MediaStore; | ||||
| import android.text.TextUtils; | ||||
| 
 | ||||
| import androidx.annotation.NonNull; | ||||
| import androidx.annotation.Nullable; | ||||
| 
 | ||||
| import androidx.preference.PreferenceManager; | ||||
| import fr.free.nrw.commons.customselector.model.Image; | ||||
| import fr.free.nrw.commons.customselector.ui.selector.CustomSelectorActivity; | ||||
| import java.io.File; | ||||
|  | @ -23,8 +23,6 @@ import java.net.URISyntaxException; | |||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import static fr.free.nrw.commons.filepicker.PickedFiles.singleFileList; | ||||
| 
 | ||||
| public class FilePicker implements Constants { | ||||
| 
 | ||||
|     private static final String KEY_PHOTO_URI = "photo_uri"; | ||||
|  |  | |||
|  | @ -5,6 +5,7 @@ import android.app.PendingIntent; | |||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| 
 | ||||
| import android.os.Build; | ||||
| import androidx.core.app.NotificationCompat; | ||||
| 
 | ||||
| import javax.inject.Inject; | ||||
|  | @ -49,21 +50,29 @@ public class NotificationHelper { | |||
|      * @param intent the intent to be fired when the notification is clicked | ||||
|      */ | ||||
|     public void showNotification(Context context, | ||||
|                                  String notificationTitle, | ||||
|                                  String notificationMessage, | ||||
|                                  int notificationId, | ||||
|                                  Intent intent) { | ||||
|         String notificationTitle, | ||||
|         String notificationMessage, | ||||
|         int notificationId, | ||||
|         Intent intent) { | ||||
| 
 | ||||
|         notificationBuilder.setDefaults(DEFAULT_ALL) | ||||
|                 .setContentTitle(notificationTitle) | ||||
|                 .setStyle(new NotificationCompat.BigTextStyle() | ||||
|                         .bigText(notificationMessage)) | ||||
|                 .setSmallIcon(R.drawable.ic_launcher) | ||||
|                 .setProgress(0, 0, false) | ||||
|                 .setOngoing(false) | ||||
|                 .setPriority(PRIORITY_HIGH); | ||||
|             .setContentTitle(notificationTitle) | ||||
|             .setStyle(new NotificationCompat.BigTextStyle() | ||||
|                 .bigText(notificationMessage)) | ||||
|             .setSmallIcon(R.drawable.ic_launcher) | ||||
|             .setProgress(0, 0, false) | ||||
|             .setOngoing(false) | ||||
|             .setPriority(PRIORITY_HIGH); | ||||
| 
 | ||||
|         PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT); | ||||
|         int flags = PendingIntent.FLAG_UPDATE_CURRENT; | ||||
| 
 | ||||
|         // Check if the API level is 31 or higher to modify the flag | ||||
|         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { | ||||
|             // For API level 31 or above, PendingIntent requires either FLAG_IMMUTABLE or FLAG_MUTABLE to be set | ||||
|             flags |= PendingIntent.FLAG_IMMUTABLE; | ||||
|         } | ||||
| 
 | ||||
|         PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, intent, flags); | ||||
|         notificationBuilder.setContentIntent(pendingIntent); | ||||
|         notificationManager.notify(notificationId, notificationBuilder.build()); | ||||
|     } | ||||
|  |  | |||
|  | @ -225,7 +225,6 @@ class DepictsPresenter @Inject constructor( | |||
|                             ) | ||||
|                         } | ||||
|                 ) | ||||
| 
 | ||||
|             } | ||||
|         } else { | ||||
|             repository.cleanup() | ||||
|  |  | |||
|  | @ -7,16 +7,13 @@ import android.content.pm.PackageManager; | |||
| import android.net.Uri; | ||||
| import android.os.Build; | ||||
| import android.provider.Settings; | ||||
| 
 | ||||
| import androidx.annotation.StringRes; | ||||
| import androidx.core.content.ContextCompat; | ||||
| 
 | ||||
| import com.karumi.dexter.Dexter; | ||||
| import com.karumi.dexter.MultiplePermissionsReport; | ||||
| import com.karumi.dexter.PermissionToken; | ||||
| import com.karumi.dexter.listener.PermissionRequest; | ||||
| import com.karumi.dexter.listener.multi.MultiplePermissionsListener; | ||||
| 
 | ||||
| import fr.free.nrw.commons.CommonsApplication; | ||||
| import fr.free.nrw.commons.R; | ||||
| import java.util.List; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nicolas Raoul
						Nicolas Raoul