mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge branch '2.12-release'
This commit is contained in:
commit
0068820ac2
8 changed files with 39 additions and 9 deletions
|
|
@ -1,7 +1,10 @@
|
|||
# Wikimedia Commons for Android
|
||||
|
||||
## v2.12.3
|
||||
- Fixed issue with EXIF data, including coords, being removed from uploads
|
||||
|
||||
## v2.12.2
|
||||
- Fixed crash on startup (hopefully, could not reproduce it)
|
||||
- Fixed crash on startup
|
||||
|
||||
## v2.12.1
|
||||
- Fixed issue with Nearby loading in wrong location
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
applicationId 'fr.free.nrw.commons'
|
||||
versionCode 549
|
||||
versionName '2.12.2'
|
||||
versionCode 561
|
||||
versionName '2.12.3'
|
||||
setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName())
|
||||
|
||||
minSdkVersion 19
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ import org.wikipedia.AppAdapter;
|
|||
import org.wikipedia.language.AppLanguageLookUpTable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
|
@ -47,6 +49,7 @@ import fr.free.nrw.commons.di.ApplicationlessInjection;
|
|||
import fr.free.nrw.commons.kvstore.JsonKvStore;
|
||||
import fr.free.nrw.commons.logging.FileLoggingTree;
|
||||
import fr.free.nrw.commons.logging.LogUtils;
|
||||
import fr.free.nrw.commons.settings.Prefs;
|
||||
import fr.free.nrw.commons.upload.FileUtils;
|
||||
import fr.free.nrw.commons.utils.ConfigUtils;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
|
@ -141,6 +144,16 @@ public class CommonsApplication extends Application {
|
|||
|
||||
initTimber();
|
||||
|
||||
|
||||
if (!defaultPrefs.getBoolean("has_user_manually_removed_location")) {
|
||||
Set<String> defaultExifTagsSet = defaultPrefs.getStringSet(Prefs.MANAGED_EXIF_TAGS);
|
||||
if (null == defaultExifTagsSet) {
|
||||
defaultExifTagsSet = new HashSet<>();
|
||||
}
|
||||
defaultExifTagsSet.add(getString(R.string.exif_tag_location));
|
||||
defaultPrefs.putStringSet(Prefs.MANAGED_EXIF_TAGS, defaultExifTagsSet);
|
||||
}
|
||||
|
||||
// Set DownsampleEnabled to True to downsample the image in case it's heavy
|
||||
ImagePipelineConfig.Builder imagePipelineConfigBuilder = ImagePipelineConfig.newBuilder(this)
|
||||
.setDownsampleEnabled(true);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import android.content.SharedPreferences;
|
|||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -204,4 +205,11 @@ public class BasicKvStore implements KeyValueStore {
|
|||
_store.unregisterOnSharedPreferenceChangeListener(l);
|
||||
}
|
||||
|
||||
public Set<String> getStringSet(String key){
|
||||
return _store.getStringSet(key, new HashSet<>());
|
||||
}
|
||||
|
||||
public void putStringSet(String key,Set<String> value){
|
||||
_store.edit().putStringSet(key,value).apply();
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ public class Prefs {
|
|||
public static final String DEFAULT_LICENSE = "defaultLicense";
|
||||
public static final String UPLOADS_SHOWING = "uploadsshowing";
|
||||
public static final String IS_CONTRIBUTION_COUNT_CHANGED = "ccontributionCountChanged";
|
||||
public static final String MANAGED_EXIF_TAGS = "managedExifTags";
|
||||
public static final String MANAGED_EXIF_TAGS = "managed_exif_tags";
|
||||
public static final String KEY_LANGUAGE_VALUE = "languageDescription";
|
||||
|
||||
public static class Licenses {
|
||||
|
|
|
|||
|
|
@ -12,14 +12,18 @@ import android.preference.SwitchPreference;
|
|||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.karumi.dexter.Dexter;
|
||||
import com.karumi.dexter.listener.PermissionGrantedResponse;
|
||||
import com.karumi.dexter.listener.single.BasePermissionListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
|
@ -68,10 +72,12 @@ public class SettingsFragment extends PreferenceFragment {
|
|||
return true;
|
||||
});
|
||||
|
||||
MultiSelectListPreference multiSelectListPref = (MultiSelectListPreference) findPreference("manageExifTags");
|
||||
MultiSelectListPreference multiSelectListPref = (MultiSelectListPreference) findPreference(Prefs.MANAGED_EXIF_TAGS);
|
||||
if (multiSelectListPref != null) {
|
||||
multiSelectListPref.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
defaultKvStore.putJson(Prefs.MANAGED_EXIF_TAGS, newValue);
|
||||
if (newValue instanceof HashSet && !((HashSet) newValue).contains(getString(R.string.exif_tag_location))) {
|
||||
defaultKvStore.putBoolean("has_user_manually_removed_location", true);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ public class FileProcessor implements Callback {
|
|||
*/
|
||||
private Set<String> getExifTagsToRedact(Context context) {
|
||||
Type setType = new TypeToken<Set<String>>() {}.getType();
|
||||
Set<String> prefManageEXIFTags = defaultKvStore.getJson(Prefs.MANAGED_EXIF_TAGS, setType);
|
||||
Set<String> prefManageEXIFTags = defaultKvStore.getStringSet(Prefs.MANAGED_EXIF_TAGS);
|
||||
|
||||
Set<String> redactTags = new HashSet<>(Arrays.asList(
|
||||
context.getResources().getStringArray(R.array.pref_exifTag_values)));
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
<fr.free.nrw.commons.ui.LongTitlePreferences.LongTitleMultiSelectListPreference
|
||||
android:entries="@array/pref_exifTag_entries"
|
||||
android:entryValues="@array/pref_exifTag_values"
|
||||
android:key="manageExifTags"
|
||||
android:key="managed_exif_tags"
|
||||
android:title="@string/manage_exif_tags"
|
||||
android:summary="@string/manage_exif_tags_summary"/>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue