Skip to content

Commit

Permalink
Merge branch 'master' into FDroid
Browse files Browse the repository at this point in the history
  • Loading branch information
k3b committed Mar 12, 2018
2 parents 6a6d3c5 + ad5ac0a commit a5e9814
Show file tree
Hide file tree
Showing 123 changed files with 1,873 additions and 862 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ build
/ToDo2.txt
/fotolib2/src/test/resources/de/k3b/media/old
/app/build-with-sign.gradle
/todo
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android:

# values in gradle.properties and .travis must be the same
# - build-tools-24.0.2
- build-tools-25.0.2
- build-tools-27.0.1
- android-23

- add-on
Expand Down
13 changes: 9 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ android {
// 0.6.2.171114 (33) Bugfix: non-root android-5 (or newer) direcotry picker not working because of permissions. Necessary for copy/move file commands.
// 0.6.2.171126 (34) Bugfix Crash (NullPointerException) in mediascanner after updating exif
// 0.6.3.180211 (35) Extended Applocking; Autoprocessingmode for copy/move; Private images
// 0.6.4.180314 (36) Fix/Improved Autoprocessingmode, Menu "open in filemanager" & "rename folder"

versionCode = 35
versionName = '0.6.3.180211'
versionCode = 36
versionName = '0.6.4.180314'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
Expand Down Expand Up @@ -128,8 +129,12 @@ dependencies {
// compile 'org.apache.commons:commons-configuration2:2.1.1'

// this is osmdroid
compile 'org.osmdroid:osmdroid-android:5.4:release@aar'
compile ('org.osmdroid:osmdroid-mapsforge:5.4:release@aar')
// compile 'org.osmdroid:osmdroid-android:5.4:release@aar'
// compile ('org.osmdroid:osmdroid-mapsforge:5.4:release@aar')
compile 'org.osmdroid:osmdroid-android:6.0.1'
compile ('org.osmdroid:osmdroid-mapsforge:6.0.1')


//Mapsforge rendering and database support, which is LGPL
compile 'org.mapsforge:mapsforge-map-android:0.6.1'
compile 'org.mapsforge:mapsforge-map:0.6.1'
Expand Down
3 changes: 3 additions & 0 deletions app/src/debug/res/values-de/fdroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Merkmale:
* Photoansicht mit stufenloser Vergrößerung (Zoom), links/rechts wischen für nächstes/vorheriges Bild.
* Eingebaute Dateiverwaltung für Bilder: Suchen, Sorieren, Kopieren, Löschen, Teilen/Senden, ... .
* Exif-Daten bearbeiten: Datum, Titel, Beschreibung, Tags(Suchbegriffe), Geo, Bewerung, ....
* Optional autoprocessing: Photos können beim Kopieren/Verschieben automatisch umbenannt und mit Tags, Geo, Title, ... versehen werden.
* Bilder als "Privat" markieren und so für andere Bild programme unsichtbar machen.
* Im geschützen/fixieren Modus sind potentiell gefährliche Aktionen (Kopieren, Löschen, Verschieben, Bildauswahl ändern, ...) nicht möglich. So kann das Gerät gefahrlos einem dritten übergeben werden.
* Verwaltet große Bildersammlungen (15000+ Bilder in 1000+ Ordnern)
* Funktioniert auch ohne vorherigem media scan (Android native media content-provider).
* Erweiterter Media-Scanner für Bilder: Exif, IPTC, XMP.
Expand Down
31 changes: 16 additions & 15 deletions app/src/debug/res/values-fr/fdroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--Generated by crowdin.com-->
<!--
/*
* Translation to French 2018 by Poussinou.
* Translation to French 2018 by Poussinou; 2018 by Tuuux
*
* These Texts will be shown as programdescription in the fdroid app store
* https://f-droid.org/app/de.k3b.android.androFotoFinder.
Expand All @@ -26,34 +26,35 @@
*/
-->
<resources>
<!-- This becomes .../fastlane/metadata/android/title.txt.
See https://f-droid.org/docs/Build_Metadata_Reference/#Name -->
<string name="title">A Photo Manager</string>
<!-- Optional: This becomes .../fastlane/metadata/android/title.txt.
See https://f-droid.org/docs/Build_Metadata_Reference/#Name
Example: If spanish title="Manejador de fotos" then the App name/title in F-Droid-store becomes "A Photo Manager (Manejador de fotos)" -->
<string name="title">Un gestionnaire de photos (A Photo Manager)</string>
<!-- This becomes .../fastlane/metadata/android/short_description.txt.
See https://f-droid.org/docs/Build_Metadata_Reference/#Summary -->
<string name="short_description">Gérez vos photos locales : Trouvez / Copiez / Éditez les Exif et affichez vos photos dans la Galerie ou sur une Carte.</string>
<string name="short_description">Gérez vos photos locales : Trouvez / Copiez / Éditez les Exif et affichez vos photos dans la Gallerie ou sur une Carte.</string>
<!-- This becomes .../fastlane/metadata/android/full_description.txt.
See https://f-droid.org/docs/Build_Metadata_Reference/#Description -->
<string name="full_description"><![CDATA["
Gérez vos photos locales : Trouvez / Copiez / Éditez les Exif et affichez vos photos dans la Galerie ou sur une Carte.
Gérez vos photos locales : Trouvez / Copiez / Éditez les EXIF et affichez vos photos dans la Gallerie ou une Carte.
Fonctionnalités :
* Trouvez rapidement vos photos par tag(mot-clé), (sous-)dossier, date, géolocalisation, titre...
* Trouvez rapidement vos photos par mot-clé, (sous-)dossier, date, géolocalisation, titre ...
* Affichez les résultats dans la Galerie ou une carte géographique d'OpenStreetMap.
* Les fonctions d'affichage permettent de zoomer, de glisser pour afficher l'image suivante / précédente.
* Les fonctions d'affichage permettent de zoomer, de faire un glisser afin passer aux images suivantes ou précédente.
* Gestionnaire de fichiers intégré pour les photos: trouver, trier, afficher, copier, supprimer, envoyer...
* Éditez les métadonnées exif : date, titre, description, tag(mot-clé), géolocalisation, évaluation...
* Éditez les métadonnées EXIF : date, titre, description, tag(mot-clé), géolocalisation, évaluation...
* Peut manipuler de grandes collections d'images (+ de 20000 images dans + de 1000 dossiers).
* Utilise le fournisseur de contenu d'image d'Android. Aucun scan d'image initial nécessaire.
* Scan étendu d'images pour les formats Exif, IPTC, XMP
* Utilise le gestionnaire d'image natif d'Android. Aucune initialisation nécessaire.
* Scan étendu d'images pour les formats EXIF, IPTC, XMP
Permissions Android nécessaires:
* INTERNET : pour télécharger les données cartographiques à partir du serveur OpenStreetMap
* ACCESS_NETWORK_STATE et ACCESS_WIFI_STATE : pour savoir si le Wi-Fi/internet est activé pour commencer à télécharger des géodonnées
* WRITE_EXTERNAL_STORAGE : pour mettre en cache les données cartographiques téléchargées dans le système de fichiers local et pour faire des opérations de fichiers avec les photos
* READ_LOGS : pour lire et enregistrer des journaux de plantage potentiels dans un fichier texte.
* INTERNET : Pour télécharger les données cartographiques à partir du serveur OpenStreetMap
* ACCESS_NETWORK_STATE et ACCESS_WIFI_STATE : pour savoir si le Wi-Fi/Internet est activé pour commencer à télécharger des données cartographiques.
* WRITE_EXTERNAL_STORAGE : pour mettre en cache les données cartographiques téléchargées dans le système de fichiers local , ceci dans le but d’effectuer certaines opérations plus rapidement.
* READ_LOGS : Afin de lire et d'enregistrer des traces dans un fichier texte en cas de crache potentiels l'application.
.
"]]></string>
</resources>
3 changes: 3 additions & 0 deletions app/src/debug/res/values/fdroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
* Detail view features zooming, swiping for next/previous image.
* Buildin file manager for photos: find, sort, view, copy, delete, send, ... .
* Edit exif metadata: date, title, description, tags(keywords), geo, rating, ....
* Optional Folder-Rule based autoprocessing: Photos are automatically renamed and get tags, geo, title, ... when you copy/move them
* Mark images as "PRIVATE" to hide them from other Gallery-Apps and image pickers.
* In "Protected/Pinned Mode" potetially dangerous app-commands like edit/copy/delete/share/settings/"change image selection" are disabled so you can savley hand over your phone to someone else
* Can handle big image collections (20000+ images in 1000+ folders).
* Uses Android's image content-provider. No initial image scan neccessary.
* Extended photo media scanner for Exif, IPTC, XMP
Expand Down
15 changes: 5 additions & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@
tools:node="remove" means remove permission
see http://stackoverflow.com/questions/37223379/google-play-game-service-adds-an-unwanted-permission-in-my-app-phone-status-and
-->
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"
tools:node="remove" />
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"
tools:node="remove" />

<application
android:name=".AndroFotoFinderApp"
Expand All @@ -82,7 +76,7 @@
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/AppTheme"
tools:replace="android:allowBackup">
>
<activity
android:name=".FotoGalleryActivity"
android:label="@string/app_name">
Expand Down Expand Up @@ -215,15 +209,16 @@
<!-- ImageDetail edit schema=file with mime=image/* -->
<intent-filter>
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- file must have mimeType to match -->
<data android:mimeType="*/*" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:host="*" />
<data android:pathPattern="\\.apm" />
<data android:pathPattern=".*\\.apm" />
</intent-filter>
</activity>

Expand Down Expand Up @@ -403,7 +398,7 @@
android:icon="@drawable/foto_gallery"
android:label="@string/scanner_menu_title">
<action android:name="android.intent.action.VIEW" />
^

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

Expand Down
112 changes: 112 additions & 0 deletions app/src/main/java/de/k3b/android/androFotoFinder/AffUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
* Copyright (c) 2018 by k3b.
*
* This file is part of AndroFotoFinder.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>
*/
package de.k3b.android.androFotoFinder;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.io.collections.SelectedFiles;
import de.k3b.io.collections.SelectedItems;

/**
* App specific helper to query and (De)Serialize between Intent|Bundle and SelectedFiles|SelectedItems.
*
* Created by k3b on 22.02.2018.
*/

public class AffUtils {
/** For SelecedItems or SelectedFotos format: id,id,id,..... */
public static final String EXTRA_SELECTED_ITEM_IDS = "de.k3b.extra.SELECTED_ITEMS";
/** For SelectedFotos format: path,path,path,..... */
public static final String EXTRA_SELECTED_ITEM_PATHS = "de.k3b.extra.SELECTED_ITEMS_PATH";
/** For SelectedFotos format: date.ticks,date.ticks,date.ticks,..... */
public static final String EXTRA_SELECTED_ITEM_DATES = "de.k3b.extra.SELECTED_ITEMS_DATE";

public static SelectedFiles getSelectedFiles(Intent data) {
if (data != null) {
String selectedIDs = data.getStringExtra(EXTRA_SELECTED_ITEM_IDS);
String selectedFiles = data.getStringExtra(EXTRA_SELECTED_ITEM_PATHS);
String selectedDates = data.getStringExtra(EXTRA_SELECTED_ITEM_DATES);

if ((selectedIDs != null) && (selectedFiles != null)) {
return SelectedFiles.create(selectedFiles, selectedIDs, selectedDates);
}
}
return null;
}
public static SelectedFiles getSelectedFiles(Bundle data) {
if (data != null) {
String selectedIDs = (String) data.getSerializable(EXTRA_SELECTED_ITEM_IDS);
String selectedFiles = (String) data.getSerializable(EXTRA_SELECTED_ITEM_PATHS);
String selectedDates = (String) data.getSerializable(EXTRA_SELECTED_ITEM_DATES);

if ((selectedIDs != null) && (selectedFiles != null)) {
return SelectedFiles.create(selectedFiles, selectedIDs, selectedDates);
}
}
return null;
}

public static boolean putSelectedFiles(Intent destination, SelectedFiles selectedFiles) {
if ((destination != null) && (selectedFiles != null) && (selectedFiles.size() > 0)) {
destination.putExtra(EXTRA_SELECTED_ITEM_IDS, selectedFiles.toIdString());
destination.putExtra(EXTRA_SELECTED_ITEM_PATHS, selectedFiles.toString());
final String dateString = selectedFiles.toDateString();
if (dateString != null) destination.putExtra(EXTRA_SELECTED_ITEM_DATES, dateString);
return true;
}
return false;
}

public static boolean putSelectedFiles(Bundle destination, SelectedFiles selectedFiles) {
if ((destination != null) && (selectedFiles != null) && (selectedFiles.size() > 0)) {
destination.putSerializable(EXTRA_SELECTED_ITEM_IDS, selectedFiles.toIdString());
destination.putSerializable(EXTRA_SELECTED_ITEM_PATHS, selectedFiles.toString());
final String dateString = selectedFiles.toDateString();
if (dateString != null) destination.putSerializable(EXTRA_SELECTED_ITEM_DATES, dateString);
return true;
}
return false;
}

/** converts internal ID-list to string array of filenNames via media database. */
public static SelectedFiles querySelectedFiles(Context context, SelectedItems items) {
if ((items != null) && (items.size() > 0)) {
List<Long> ids = new ArrayList<Long>();
List<String> paths = new ArrayList<String>();
List<Date> datesPhotoTaken = new ArrayList<Date>();

if (FotoSql.getFileNames(context, items, ids, paths, datesPhotoTaken) != null) {
return new SelectedFiles(paths.toArray(new String[paths.size()]), ids.toArray(new Long[ids.size()]), datesPhotoTaken.toArray(new Date[datesPhotoTaken.size()]));
}
}
return null;
}

public static SelectedItems getSelectedItems(Intent intent) {
String selectedIDsString = intent.getStringExtra(EXTRA_SELECTED_ITEM_IDS);
return (selectedIDsString != null) ? new SelectedItems().parse(selectedIDsString) : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static RefWatcher getRefWatcher(Context context) {

//https://github.com/osmdroid/osmdroid/issues/366
//super important. Many tile servers, including open street maps, will BAN applications by user
OpenStreetMapTileProviderConstants.setUserAgentValue(getAppId() + " https://github.com/k3b/APhotoManager"); // BuildConfig.APPLICATION_ID);
//??? OpenStreetMapTileProviderConstants.setUserAgentValue(getAppId() + " https://github.com/k3b/APhotoManager"); // BuildConfig.APPLICATION_ID);

// #60: configure some of the mapsforge settings first
MapsForgeSupport.createInstance(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package de.k3b.android.androFotoFinder;

import android.app.Activity;
import android.content.Context;

import java.io.Closeable;
import java.io.IOException;
Expand All @@ -36,12 +35,10 @@
*/

public class AndroidTransactionLogger extends TransactionLoggerBase implements Closeable {
private Context ctx;
private AndroidFileCommands execLog;

public AndroidTransactionLogger(Activity ctx, long now, AndroidFileCommands execLog) {
super(execLog, now);
this.ctx = ctx.getApplicationContext(); // to avoid memory leaks

this.execLog = execLog;
}
Expand All @@ -56,6 +53,5 @@ protected void addChanges(MediaTransactionLogEntryType command, String parameter
public void close() throws IOException {
super.close();
execLog = null;
ctx = null;
}
}
9 changes: 0 additions & 9 deletions app/src/main/java/de/k3b/android/androFotoFinder/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ public interface Common {
*/
static final String EXTRA_FILTER = "de.k3b.extra.FILTER";

/**
* geoEdit,picker
* Format:SelectedItems.toString/parseMultiple: id,id,id,....
* See https://github.com/k3b/AndroFotoFinder/wiki/intentapi#SelectedItems
*/
static final String EXTRA_SELECTED_ITEM_IDS = "de.k3b.extra.SELECTED_ITEMS";

static final String EXTRA_SELECTED_ITEM_PATHS = "de.k3b.extra.SELECTED_ITEMS_PATH";

/** detail,gallery: sql where ... order by ... group by ... */
public static final String EXTRA_QUERY = "de.k3b.extra.SQL";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ public class ExifEditActivity extends ActivityWithAutoCloseDialogs implements Co
*/
public static void showActivity(Activity context, IMetaApi exifDataToEdit, String url,
SelectedFiles selectedFiles, int requestCode) {
Uri initalUri = null;

if (Global.debugEnabled) {
Log.d(Global.LOG_CONTEXT, context.getClass().getSimpleName()
+ " > ExifEditActivity.showActivity");
Expand All @@ -153,10 +151,7 @@ public static void showActivity(Activity context, IMetaApi exifDataToEdit, Strin
intent.setData(Uri.parse(url));
}

if ((selectedFiles != null) && (selectedFiles.size() > 0)) {
intent.putExtra(EXTRA_SELECTED_ITEM_IDS, selectedFiles.toIdString());
intent.putExtra(EXTRA_SELECTED_ITEM_PATHS, selectedFiles.toString());
}
AffUtils.putSelectedFiles(intent, selectedFiles);
}

if (requestCode != 0) {
Expand Down Expand Up @@ -276,14 +271,9 @@ public static IMetaApi getExifParam(Intent intent) {
private static SelectedFiles getSelectedFiles(String dbgContext, Context ctx, Intent intent, boolean mustLoadIDs) {
if (intent == null) return null;

SelectedFiles result = null;
SelectedFiles result = AffUtils.getSelectedFiles(intent);

String selectedIDs = intent.getStringExtra(EXTRA_SELECTED_ITEM_IDS);
String selectedFiles = intent.getStringExtra(EXTRA_SELECTED_ITEM_PATHS);

if ((selectedIDs != null) && (selectedFiles != null)) {
result = new SelectedFiles(selectedFiles, selectedIDs);
} else {
if (result == null) {
String path = IntentUtil.getFilePath(ctx, IntentUtil.getUri(intent));
String fileNames[] = SelectedFiles.getFileNameList(path);
Long[] ids = null;
Expand All @@ -299,7 +289,7 @@ private static SelectedFiles getSelectedFiles(String dbgContext, Context ctx, In
}
}

result = new SelectedFiles(fileNames, ids);
result = new SelectedFiles(fileNames, ids, null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public static void fixMenu(Context context, Menu menu) {
MenuUtils.mov2SubMenu(menu, context.getString(R.string.more_menu_title),
R.id.action_details,
R.id.action_slideshow,
R.id.cmd_filemanager,
R.id.action_view_context_mode,
// R.id.cmd_settings,
R.id.cmd_selection_add_all,
Expand Down
Loading

0 comments on commit a5e9814

Please sign in to comment.