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 Oct 19, 2019
2 parents a5efcbd + c7f4457 commit e898243
Show file tree
Hide file tree
Showing 71 changed files with 2,139 additions and 759 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Highlights:
* [Virtual Albums](https://github.com/k3b/APhotoManager/wiki/Bookmarks) filesystem-folder indepenant,
* management: on-move automatically [rename photo-files](https://github.com/k3b/AndroFotoFinder/wiki/AutoProcessing) and/or [add metadata](https://github.com/k3b/AndroFotoFinder/wiki/AutoProcessing),
* find, sort, view, copy, delete, set gps exif data, set [tags(keywords)](https://github.com/k3b/APhotoManager/wiki/Tags), send, ... .
* [Incremental Backup of Photos to a Zip File](https://github.com/k3b/APhotoManager/wiki/Backup-to-zip) (new in 0.8.0)
* available in [many languages](https://github.com/k3b/APhotoManager/issues/21)

Privacy:
Expand All @@ -27,7 +28,7 @@ Privacy:
* Geotagging: Shows photos in a [geographic map](https://github.com/k3b/APhotoManager/wiki/geographic-map) from [openstreetmap](http://www.openstreetmap.org)
* Buildin file manager for photos: find, sort, view, copy, delete, Show in map, set gps exif data, send, edit exif, ... .
* Fast [find](https://github.com/k3b/APhotoManager/wiki/Filter-View) local photos by (sub-)folder, date, [geographic map](https://github.com/k3b/APhotoManager/wiki/geographic-map)or [tags (keywords)](https://github.com/k3b/APhotoManager/wiki/Tags).
* [Translations](https://crowdin.com/project/AndroFotoFinder): &nbsp;ar,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/de-home">de</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/home" >en</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/it-home">it</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/fr-home">fr</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/ja-home">ja</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/nl-Home">nl</a>,&nbsp;pl,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/ro-home">ro</a>,&nbsp;ru&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/tr-home">tr</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/uk-home">uk</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/zh-CN-home">zh-CN</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/zh-TW-home">zh-TW</a>
* [Translations](https://crowdin.com/project/AndroFotoFinder): &nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/ar-home">ar</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/de-home">de</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/home" >en</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/it-home">it</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/fr-home">fr</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/ja-home">ja</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/nl-Home">nl</a>,&nbsp;pl,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/pt-home">pt</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/ro-home">ro</a>,&nbsp;ru&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/tr-home">tr</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/uk-home">uk</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/zh-CN-home">zh-CN</a>,&nbsp;<a href="https://github.com/k3b/APhotoManager/wiki/zh-TW-home">zh-TW</a>
* [![Crowdin](https://d322cqt584bo4o.cloudfront.net/androFotoFinder/localized.svg)](https://crowdin.com/project/androFotoFinder)<a href="https://github.com/k3b/APhotoManager/issues/21">Help us to translate into other languages.</a>

---
Expand Down
9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ android {
// 0.7.3.190424 (41) mapsforge-v5, filter date-last-modified, Fix getContent, exif-TAG_DATETIME, Translation ja, nl, ru, pt-br, uk
// 0.7.4.190801 (42) hotfix to reallow openstreetmap online map download
// 0.7.5.190916 (43) Drill Down Search via Picker context-show-in-new
// 0.8.0.191021 (44) Backup to zip

versionCode = 43
versionName = '0.7.5.190916'
versionCode = 44
versionName = '0.8.0.191021'

// all supported locales
// resConfigs "ar","de","es","fr","hi","in","it","ja","nl","pl","ro","ru","tr","uk","zz","pt-rBR","zh-rCN","zh-rTW"
Expand Down Expand Up @@ -170,8 +171,8 @@ dependencies {
// https://jitpack.io/com/github/k3b/ToGoZip/L2.0.15/build.log
// https://jitpack.io/com/github/k3b/ToGoZip/libK3bZip/L2.0.15/
// implementation('com.github.k3b.ToGoZip:libK3bZip:L2.0.15') { transitive = false; }
implementation('com.github.k3b.ToGoZip:libK3bZip:L2.1.22.3') { transitive = false }
implementation('com.github.k3b.ToGoZip:libK3bAndroidZip:L2.1.22.3') { transitive = false }
implementation('com.github.k3b.ToGoZip:libK3bZip:L2.1.23') { transitive = false }
implementation('com.github.k3b.ToGoZip:libK3bAndroidZip:L2.1.23') { transitive = false }

testImplementation('org.powermock:powermock-api-mockito:1.5.2')
testImplementation('org.powermock:powermock-module-junit4:1.5.2')
Expand Down
4 changes: 2 additions & 2 deletions app/src/debug/res/values-nl/fdroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--Generated by crowdin.com-->
<!--
/*
* Translation to Dutch by Klaas Swart (verydutch) 2018-11-29 ... 2019-04-08.
* Translation to Dutch by Klaas Swart (verydutch) 2018-11 ... 2019-04, T-v-Gerwen 2019-09
*
* These Texts will be shown as programdescription in the fdroid app store
* https://f-droid.org/app/de.k3b.android.androFotoFinder.
Expand All @@ -29,7 +29,7 @@
<!-- 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">Een foto beheerder</string>
<string name="title">Een Foto Beheerder</string>
<!-- This becomes .../fastlane/metadata/android/short_description.txt.
See https://f-droid.org/docs/Build_Metadata_Reference/#Summary -->
<string name="short_description">Lokale foto\'s beheren: zoeken/kopieren/Exif bewerken en weergeven in galerij of op kaart.</string>
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@
<data android:pathPattern=".*\\.apm"/>
</intent-filter>
</activity>

<activity
android:name=".backup.BackupProgressActivity"
android:icon="@drawable/rule"
android:label="@string/backup_title"></activity>
<activity android:name=".backup.BackupActivity"
android:icon="@drawable/rule"
android:label="@string/backup_title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ public class AndroFotoFinderApp extends Application {
private LogCat mCrashSaveToFile = null;


public static final String LINK_URL_SQL = "https://github.com/k3b/APhotoManager/wiki/intentapi#sql";
public static final String LINK_URL_ZIP_CONFIG = "https://github.com/k3b/APhotoManager/wiki/Backup-to-zip#TechnicalDetails";
public static final String LINK_URL_CSV = "https://github.com/k3b/APhotoManager/wiki/Backup-to-zip#csv";
public static final String LINK_URL_AUTOPROCESSING = "https://github.com/k3b/APhotoManager/wiki/AutoProcessing#TechnicalDetails";

public static String getGetTeaserText(Context context, String linkUrlForDetails) {
final String result = context.getString(R.string.bookmark_file_comment_format,
context.getString(R.string.app_name),
GuiUtil.getAppVersionName(context),
new Date().toString());
if (linkUrlForDetails != null)
return result.replace(LINK_URL_SQL, linkUrlForDetails);
return result;
}

/*
private RefWatcher refWatcher;
Expand Down Expand Up @@ -88,9 +103,9 @@ public static RefWatcher getRefWatcher(Context context) {
SettingsActivity.prefs2Global(this);

// create sensible defaults for andorid-independant files from android string resources
QueryParameter.sFileComment = getBookMarkComment(this);
PhotoAutoprocessingDto.sFileComment = getBookMarkComment(this);
ZipConfigRepository.sFileComment = PhotoAutoprocessingDto.sFileComment;
QueryParameter.sFileComment = getGetTeaserText(this, null);
PhotoAutoprocessingDto.sFileComment = getGetTeaserText(this, LINK_URL_AUTOPROCESSING);
ZipConfigRepository.sFileComment = "# " + getGetTeaserText(this, LINK_URL_ZIP_CONFIG);

QueryParameter.sParserDefaultFrom = FotoSql.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE.toString();
QueryParameter.sParserDefaultQueryTypeId = FotoSql.QUERY_TYPE_DEFAULT;
Expand Down Expand Up @@ -155,13 +170,6 @@ private File getOutpuFile() {
Log.i(Global.LOG_CONTEXT, getAppId() + " created");
}

public static String getBookMarkComment(Context context) {
return context.getString(R.string.bookmark_file_comment_format,
context.getString(R.string.app_name),
GuiUtil.getAppVersionName(context),
new Date().toString());
}

@NonNull
private String getAppId() {
return getString(R.string.app_name) + " " + GuiUtil.getAppVersionName(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.Toast;

import java.io.File;
Expand All @@ -46,6 +47,7 @@
import java.util.Locale;

import de.k3b.LibGlobal;
import de.k3b.android.androFotoFinder.backup.BackupActivity;
import de.k3b.android.androFotoFinder.directory.DirectoryLoaderTask;
import de.k3b.android.androFotoFinder.directory.DirectoryPickerFragment;
import de.k3b.android.androFotoFinder.imagedetail.ImageDetailMetaDialogBuilder;
Expand Down Expand Up @@ -288,6 +290,12 @@ public boolean onOptionsItemSelected(MenuItem menuItem) {
this, null, getAsMergedQuery(), null, 0);
return true;
}
case R.id.cmd_backup:
BackupActivity.showActivity(" menu " + menuItem.getTitle(),
this, null, null,
getAsMergedQuery(),
BackupActivity.REQUEST_BACKUP_ID);
return true;
case R.id.action_details:
cmdShowDetails();
return true;
Expand Down Expand Up @@ -401,6 +409,11 @@ protected void onDestroy() {
// refWatcher.watch(this);
}

private void toGui(IGalleryFilter gf) {
mFilterValue.get(gf);
mFilterValue.showAdditionalSqlWhere();
}

/** gui content seen as IGalleryFilter */
private class FilterValue implements IGalleryFilter {
final private java.text.DateFormat isoDateformatter = new SimpleDateFormat(
Expand All @@ -424,6 +437,8 @@ private class FilterValue implements IGalleryFilter {
private EditText mAny ;
private EditText mTagsInclude ;
private EditText mTagsExclude ;
private TextView mAdditionalSqlWhere;

private VISIBILITY mVisibility = VISIBILITY.DEFAULT;

FilterValue() {
Expand All @@ -444,6 +459,7 @@ private class FilterValue implements IGalleryFilter {
this.mRatingBar = (RatingBar ) findViewById(R.id.ratingBar);
this.mPublic = (CheckBox) findViewById(R.id.chk_public);
this.mPrivate = (CheckBox) findViewById(R.id.chk_private);
mAdditionalSqlWhere = (TextView) findViewById(R.id.lbl_additional_sql_where);

mWithNoGeoInfo.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down Expand Up @@ -488,6 +504,19 @@ public void onClick(View v) {
mTagsExclude).setIncludeEmpty(true);
}

protected void showAdditionalSqlWhere() {

if ((mQueryWithoutFilter != null) && (mQueryWithoutFilter.hasWhere())) {
QueryParameter query = mQueryWithoutFilter;
StringBuilder result = new StringBuilder();
query.toParsableWhere(result);
mAdditionalSqlWhere.setText(result);

} else {
mAdditionalSqlWhere.setText("");
}
}

protected void showVisibility(VISIBILITY visibility) {
VISIBILITY actualVisibility = visibility;
if (actualVisibility == VISIBILITY.DEFAULT) {
Expand Down Expand Up @@ -708,10 +737,6 @@ private long convertDate(String string) throws RuntimeException {

}

private void toGui(IGalleryFilter gf) {
mFilterValue.get(gf);
}

private boolean fromGui(IGalleryFilter dest) {
try {
if (dest != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void test(Context context) {
if (Global.debugEnabled && LibGlobal.debugEnabled)
Log.i(Global.LOG_CONTEXT,ListUtils.toString("\n\t"
,"testing some translations with parameters"
,AndroFotoFinderApp.getBookMarkComment(context)
, AndroFotoFinderApp.getGetTeaserText(context, null)
,AndroidFileCommands.getModifyMessage(context, AndroidFileCommands.OP_DELETE, 5, 15)
,context.getString(R.string.folder_hide_images_question_message_format, "param")
,context.getString(R.string.global_err_sql_message_format, "param", "param2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.util.Log;
import android.widget.ImageView;

Expand All @@ -38,7 +37,7 @@
import java.io.IOException;

import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.media.PhotoPropertiesUtil;
import de.k3b.io.StringUtils;

/**
* Service facade hiding com.nostra13.universalimageloader
Expand Down Expand Up @@ -108,44 +107,24 @@ private static DisplayImageOptions createThumbnailOptions() {

public static void getThumb(int iconID, ImageView imageView) {
String uriString = FotoSql.getUriString(iconID);
displayImageImpl(uriString, imageView, "iconID:", iconID);
displayImageImpl(uriString, imageView, "getThumb iconID:", iconID);
}

public static void getThumb(String fullPath, ImageView imageView) {
public static void getThumb(String fullPath, ImageView imageView, Object... dbgContext) {

if ((imageView != null) && (fullPath != null) && (fullPath.length() > 0)) {
String uriString = "file://" + fullPath;
displayImageImpl(uriString, imageView, "fullPath:" , fullPath);
displayImageImpl(uriString, imageView, dbgContext, "getThumb fullPath:", fullPath);
}
}

private static void displayImageImpl(String uriString, ImageView imageView, String debugContext, Object debugParam) {
private static void displayImageImpl(String uriString, ImageView imageView, Object... debugParams) {
if (ThumbNailUtils.DEBUG && Global.debugEnabledViewItem) {
Log.i(ThumbNailUtils.LOG_TAG, "displayImageImpl " + uriString +
" because of " + debugContext + debugParam);
Log.i(ThumbNailUtils.LOG_TAG,
StringUtils.appendMessage(null, "displayImageImpl"
, uriString, "because of", debugParams).toString());
}

ImageLoader.getInstance().displayImage(uriString, imageView, mDisplayImageOptions);
}

/** @param exifOrientationCode either code 0..8 or rotation angle 0, 90, 180, 270 */
public static Bitmap rotateBitmap(Bitmap source, int exifOrientationCode) {
if (exifOrientationCode != 0) {
int angle = PhotoPropertiesUtil.exifOrientationCode2RotationDegrees(exifOrientationCode, exifOrientationCode);

if (ThumbNailUtils.DEBUG && Global.debugEnabledViewItem) {
Log.i(ThumbNailUtils.LOG_TAG, "rotateBitmap code=" + exifOrientationCode +
" ==> " + angle);
}

if (angle != 0) {
Matrix matrix = new Matrix();
matrix.postRotate(angle);
return Bitmap.createBitmap(source, 0, 0, source.getWidth(),
source.getHeight(), matrix, true);
}
}
return source;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ApmZipCompressJob(Context context, ZipLog zipLog, String fileLogInZip) {

/** footer added to text collector. null means no text. */
@Override protected String getTextFooter() {
String result = AndroFotoFinderApp.getBookMarkComment(this.context); // "Collected with ToGoZip version ...";
String result = "# " + AndroFotoFinderApp.getGetTeaserText(this.context, AndroFotoFinderApp.LINK_URL_CSV); // "Collected with ToGoZip version ...";

final String versionName = GuiUtil.getAppVersionName(context);
if (versionName != null) {
Expand Down
Loading

0 comments on commit e898243

Please sign in to comment.