Skip to content

Commit 28d40ba

Browse files
committed
#153: #155: merged 2 incomplete disabled feature branches ao10 and rename-multible
2 parents 42225e8 + 5066b95 commit 28d40ba

File tree

77 files changed

+3728
-1404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3728
-1404
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Go to '...'
13+
2. Click on '....'
14+
3. Scroll down to '....'
15+
4. See error
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Smartphone (please complete the following information):**
21+
- Android version [e.g. Android-7.1] :
22+
- [A Photo Manager Version](https://github.com/k3b/APhotoManager/releases) (i.e. 0.4.6.160304) :
23+
24+
**Additional context**
25+
Add any other context about the problem here.
26+
27+
**Crash Report**
28+
If you report an app crash: Can you add the crash logfile to this ticket?
29+
30+
When APhotoManager crashes it tries to write a crash log file in the [**Error Log Folder**](https://github.com/k3b/APhotoManager/wiki/settings#logfolder).
31+
32+
* [ExternalStorageDirectory]/copy/log/androFotofinder.logcat-2017....txt
33+
* i.e. /storage/sdcard0/copy/log/androFotofinder.logcat-20170728-135704.txt
34+
* crash data from 2017-07-28 13:57
35+
36+
For more details on Error Loging see [diagnostic settings](https://github.com/k3b/APhotoManager/wiki/settings#Diagnostics).
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.
18+
19+
* Affected Module:
20+
* [ ] [Gallery-View](https://github.com/k3b/APhotoManager/wiki/Gallery-View)
21+
* [ ] [Geographic-Map](https://github.com/k3b/APhotoManager/wiki/geographic-map)
22+
* [ ] [Image-View](https://github.com/k3b/APhotoManager/wiki/Image-View)
23+
* [ ] [Filtering](https://github.com/k3b/APhotoManager/wiki/Filter-View)
24+
* [ ] [Folder-Picker](https://github.com/k3b/APhotoManager/wiki/Folder-Picker)
25+
* [ ] [Settings](https://github.com/k3b/APhotoManager/wiki/settings)
26+
* [ ] [Intent API](https://github.com/k3b/APhotoManager/wiki/intentapi)

.github/old_ISSUE_TEMPLATE.md renamed to .github/feature_request.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
### Expected behavior
1+
**Is your feature request related to a problem? Please describe.**
2+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
23

3-
...
4+
**Describe the solution you'd like**
5+
A clear and concise description of what you want to happen.
46

5-
### Actual behavior
7+
**Describe alternatives you've considered**
8+
A clear and concise description of any alternative solutions or features you've considered.
69

7-
...
10+
**Additional context**
11+
Add any other context or screenshots about the feature request here.
812

9-
### Environment
10-
11-
* Android Version (i.e. 5.1):
12-
* ...
13-
* [A Photo Manager Version](https://github.com/k3b/APhotoManager/releases) (i.e. 0.4.6.160304) :
14-
* ...
1513
* Affected Module:
1614
* [ ] [Gallery-View](https://github.com/k3b/APhotoManager/wiki/Gallery-View)
1715
* [ ] [Geographic-Map](https://github.com/k3b/APhotoManager/wiki/geographic-map)

FAQs

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Q. What is APhotoManager?
2+
3+
A. APhotoManager is an opensource mobile gallery app that can manage your local photos.
4+
5+
Q. What is geotagging?
6+
7+
A. Geotagging is the act of assigning geographical location to a photographs or videos.
8+
9+
Q. How do I add geotags to my photos using APhotoManager?
10+
11+
A. Highlight the photos(s), click the option button and select "set geo" option, then you can decide to pick a location from map or from an existing photo.
12+
13+
Q. What is exif data?
14+
15+
A. Exif stands for Exchangeable image file format. It allows you to store certain information within your photos.This information is known as "metadata" and can include things like the date and time the shot was taken, camera settings like shutter speed and focal length, and copyright information.
16+
17+
Q. How do I add, remove or edit exif data on my photo using APhotoManager?
18+
19+
A. Highlight the photo(s), click the option button and select "set geo" option, then you can decide to pick a location from map or from an existing photo.
20+
21+
22+
Q. Can I select a folder to view pictures?
23+
24+
A. Yes, by clicking the folder icon on the top, you are shown all the folders that contain pictures on your deivce, selecting any folder and clicking ok allows you to view only pictures contained in that folder.
25+
26+
Q. How do I find pictures on APhotoManager?
27+
28+
A. Specific photos can be found on APhotoManager using the filter option by providing some information of the photo which may include the filename, path, tags etc. Providing any of those information will open up results relating to information provided.
29+
30+
Q. Can I sort my photos on APhotoManager?
31+
32+
A. Yes the sorting feature is available on APhotoManager. Photos can be sorted by name, date, place, rating, last modified, width, size and file path length, all in ascending order.
33+
34+
Q. Can I share photos from APhotoManager?
35+
36+
A. You can share photos from APhotoManager to any other location that is supported for such operation. To share photo(s), from APhotomanager you can highlight the picture(s) and the share button will be visible at the top, clicking it will pop-up several locations where the picture(s) can be shared to. The share button is automatically visible when a picture is viewed.
37+
38+
39+
Q. Which photo management options are available on APhotoManager?
40+
41+
A. File management options like, rename, copy and move are available on APhotoManager.
42+
43+
Q. Are my photos uploaded to third party apps?
44+
45+
A. No, photos are stored locally on the device, there's no upload to third party applications.
46+
47+
Q. Does APhotoManager contain ads?
48+
49+
A. APhotoManager does not contain ads, no usertracking, it is absolutely free and open source.
50+
51+
52+
Thank you for using APhotoManager, if you like the app and wish to make contributions to the project, contact the developer via [github](https://github.com/k3b/APhotoManager)

app/build.gradle

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ android {
1414
defaultConfig {
1515
// fdroid-release 'de.k3b.android.androFotoFinder'
1616
// main-develop-branch 'de.k3b.android.androFotoFinder.dev'
17-
applicationId 'de.k3b.android.androFotoFinder.dev'
18-
17+
// applicationId 'de.k3b.android.androFotoFinder'
18+
applicationId 'de.k3b.android.androFotoFinder'
19+
1920
minSdkVersion 14 // Android 4.0 Ice Cream Sandwich (API 14); Android 4.4 KitKat (API 19); Android 5.0 Lollipop (API 21);
2021
// Android 6.0 Marshmallow (API 23); Android 7.0 Nougat (API 24)
22+
maxSdkVersion 28 // #155: android-10=api29
23+
2124
targetSdkVersion 21
2225

2326
// non-fdroid release

app/src/main/java/de/k3b/android/androFotoFinder/AdapterArrayHelper.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
import java.util.ArrayList;
2727

2828
import de.k3b.android.androFotoFinder.queries.FotoSql;
29+
import de.k3b.io.FileUtils;
2930
import de.k3b.io.VISIBILITY;
3031
import de.k3b.io.collections.SelectedItems;
31-
import de.k3b.io.FileUtils;
3232
import de.k3b.media.PhotoPropertiesUtil;
3333

3434
/**
@@ -47,7 +47,7 @@ public AdapterArrayHelper(Activity context, String fullPhotoPath, String debugCo
4747

4848
if (Global.mustRemoveNOMEDIAfromDB && (mRootDir != null) && (mFullPhotoPaths != null)) {
4949
String parentDirString = mRootDir.getAbsolutePath();
50-
FotoSql.execDeleteByPath(debugContext + " AdapterArrayHelper mustRemoveNOMEDIAfromDB ", context, parentDirString, VISIBILITY.PRIVATE_PUBLIC);
50+
FotoSql.execDeleteByPath(debugContext + " AdapterArrayHelper mustRemoveNOMEDIAfromDB ", parentDirString, VISIBILITY.PRIVATE_PUBLIC);
5151
}
5252
}
5353

app/src/main/java/de/k3b/android/androFotoFinder/AffUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public static SelectedFiles querySelectedFiles(Context context, SelectedItems it
122122
List<String> paths = new ArrayList<String>();
123123
List<Date> datesPhotoTaken = new ArrayList<Date>();
124124

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

app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java

+64-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2019 by k3b.
2+
* Copyright (c) 2015-2020 by k3b.
33
*
44
* This file is part of AndroFotoFinder / #APhotoManager.
55
*
@@ -19,8 +19,10 @@
1919

2020
package de.k3b.android.androFotoFinder;
2121

22+
import android.app.Activity;
2223
import android.app.Application;
2324
import android.content.Context;
25+
import android.database.sqlite.SQLiteDatabase;
2426
import android.support.annotation.NonNull;
2527
import android.util.Log;
2628
import android.widget.Toast;
@@ -36,11 +38,21 @@
3638
import de.k3b.LibGlobal;
3739
import de.k3b.android.GuiUtil;
3840
import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader;
41+
import de.k3b.android.androFotoFinder.queries.DatabaseHelper;
3942
import de.k3b.android.androFotoFinder.queries.FotoSql;
4043
import de.k3b.android.androFotoFinder.queries.FotoSqlBase;
44+
import de.k3b.android.androFotoFinder.queries.GlobalMediaContentObserver;
45+
import de.k3b.android.androFotoFinder.queries.IMediaRepositoryApi;
46+
import de.k3b.android.androFotoFinder.queries.MediaContent2DBUpdateService;
47+
import de.k3b.android.androFotoFinder.queries.MediaContentproviderRepository;
48+
import de.k3b.android.androFotoFinder.queries.MediaContentproviderRepositoryImpl;
49+
import de.k3b.android.androFotoFinder.queries.MediaDBRepository;
50+
import de.k3b.android.androFotoFinder.queries.MergedMediaRepository;
4151
import de.k3b.android.osmdroid.forge.MapsForgeSupport;
4252
import de.k3b.android.util.LogCat;
53+
import de.k3b.android.util.PhotoChangeNotifyer;
4354
import de.k3b.android.widget.ActivityWithCallContext;
55+
import de.k3b.android.widget.LocalizedActivity;
4456
import de.k3b.database.QueryParameter;
4557
import de.k3b.io.PhotoAutoprocessingDto;
4658
import de.k3b.media.ExifInterface;
@@ -58,6 +70,10 @@
5870
public class AndroFotoFinderApp extends Application {
5971
private static String fileNamePrefix = "androFotofinder.logcat-";
6072

73+
public static MediaContent2DBUpdateService getMediaContent2DbUpdateService() {
74+
return MediaContent2DBUpdateService.instance;
75+
}
76+
6177
private LogCat mCrashSaveToFile = null;
6278

6379

@@ -76,6 +92,43 @@ public static String getGetTeaserText(Context context, String linkUrlForDetails)
7692
return result;
7793
}
7894

95+
public static void setMediaImageDbReplacement(Context context, boolean useMediaImageDbReplacement) {
96+
final IMediaRepositoryApi oldMediaDBApi = FotoSql.getMediaDBApi();
97+
if ((oldMediaDBApi == null) || (Global.useAo10MediaImageDbReplacement != useMediaImageDbReplacement)) {
98+
99+
// menu must be recreated
100+
LocalizedActivity.setMustRecreate();
101+
102+
Global.useAo10MediaImageDbReplacement = useMediaImageDbReplacement;
103+
104+
final MediaContentproviderRepository mediaContentproviderRepository = new MediaContentproviderRepository(context);
105+
106+
if (Global.useAo10MediaImageDbReplacement) {
107+
final SQLiteDatabase writableDatabase = DatabaseHelper.getWritableDatabase(context);
108+
final MediaDBRepository mediaDBRepository = new MediaDBRepository(writableDatabase);
109+
FotoSql.setMediaDBApi(new MergedMediaRepository(mediaDBRepository, mediaContentproviderRepository));
110+
111+
MediaContent2DBUpdateService.instance = new MediaContent2DBUpdateService(context, writableDatabase);
112+
113+
if (FotoSql.getCount(new QueryParameter().addWhere("1 = 1")) == 0) {
114+
// database is empty; reload from Contentprovider
115+
MediaContent2DBUpdateService.instance.rebuild(context, null);
116+
}
117+
118+
PhotoChangeNotifyer.registerContentObserver(context, GlobalMediaContentObserver.getInstance(context));
119+
120+
} else {
121+
PhotoChangeNotifyer.unregisterContentObserver(context, GlobalMediaContentObserver.getInstance(context));
122+
if ((oldMediaDBApi != null) && (MediaContent2DBUpdateService.instance != null)) {
123+
// switching from mediaImageDbReplacement to Contentprovider
124+
MediaContent2DBUpdateService.instance.clearMediaCopy();
125+
}
126+
FotoSql.setMediaDBApi(mediaContentproviderRepository);
127+
MediaContent2DBUpdateService.instance = null;
128+
}
129+
}
130+
}
131+
79132
/*
80133
private RefWatcher refWatcher;
81134
@@ -114,7 +167,10 @@ public static RefWatcher getRefWatcher(Context context) {
114167
mCrashSaveToFile = new LogCat(Global.LOG_CONTEXT, HugeImageLoader.LOG_TAG,
115168
PhotoViewAttacher.LOG_TAG, CupcakeGestureDetector.LOG_TAG,
116169
LibGlobal.LOG_TAG, ThumbNailUtils.LOG_TAG, IMapView.LOGTAG,
117-
ExifInterface.LOG_TAG, PhotoPropertiesImageReader.LOG_TAG) {
170+
ExifInterface.LOG_TAG, PhotoPropertiesImageReader.LOG_TAG,
171+
FotoSql.LOG_TAG,
172+
MediaDBRepository.LOG_TAG,
173+
MediaContentproviderRepositoryImpl.LOG_TAG) {
118174

119175
@Override
120176
public void uncaughtException(Thread thread, Throwable ex) {
@@ -124,13 +180,14 @@ public void uncaughtException(Thread thread, Throwable ex) {
124180
super.uncaughtException(thread, ex);
125181
}
126182

127-
public void saveToFile() {
183+
public void saveToFile(Activity activity) {
128184
final File logFile = getOutpuFile();
129185
String message = (logFile != null)
130186
? "saving errorlog ('LocCat') to " + logFile.getAbsolutePath()
131187
: "Saving errorlog ('LocCat') is disabled. See Settings 'Diagnostics' for details";
132188
Log.e(Global.LOG_CONTEXT, message);
133-
Toast.makeText(AndroFotoFinderApp.this , message, Toast.LENGTH_LONG).show();
189+
final Context context = (activity != null) ? activity : AndroFotoFinderApp.this;
190+
Toast.makeText(context, message, Toast.LENGTH_LONG).show();
134191

135192
saveLogCat(logFile, null, mTags);
136193
}
@@ -165,7 +222,7 @@ private File getOutpuFile() {
165222
// #60: configure some of the mapsforge settings first
166223
MapsForgeSupport.createInstance(this);
167224

168-
FotoSql.deleteMediaWithNullPath(this);
225+
FotoSql.deleteMediaWithNullPath();
169226

170227
Log.i(Global.LOG_CONTEXT, getAppId() + " created");
171228
}
@@ -185,9 +242,9 @@ public void onTerminate() {
185242
super.onTerminate();
186243
}
187244

188-
public void saveToFile() {
245+
public void saveToFile(Activity activity) {
189246
if (mCrashSaveToFile != null) {
190-
mCrashSaveToFile.saveToFile();
247+
mCrashSaveToFile.saveToFile(activity);
191248
}
192249
}
193250
public void clear() {

app/src/main/java/de/k3b/android/androFotoFinder/AndroidTransactionLogger.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017 by k3b.
2+
* Copyright (c) 2017-2020 by k3b.
33
*
44
* This file is part of AndroFotoFinder / #APhotoManager.
55
*
@@ -19,8 +19,6 @@
1919

2020
package de.k3b.android.androFotoFinder;
2121

22-
import android.app.Activity;
23-
2422
import java.io.Closeable;
2523
import java.io.IOException;
2624

@@ -37,7 +35,7 @@
3735
public class AndroidTransactionLogger extends TransactionLoggerBase implements Closeable {
3836
private AndroidFileCommands execLog;
3937

40-
public AndroidTransactionLogger(Activity ctx, long now, AndroidFileCommands execLog) {
38+
public AndroidTransactionLogger(AndroidFileCommands execLog, long now) {
4139
super(execLog, now);
4240

4341
this.execLog = execLog;

app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2018 by k3b.
2+
* Copyright (c) 2015-2020 by k3b.
33
*
44
* This file is part of AndroFotoFinder / #APhotoManager.
55
*
@@ -44,8 +44,8 @@
4444
import de.k3b.android.widget.AboutDialogPreference;
4545
import de.k3b.android.widget.BaseQueryActivity;
4646
import de.k3b.database.QueryParameter;
47-
import de.k3b.io.collections.SelectedItems;
4847
import de.k3b.io.IDirectory;
48+
import de.k3b.io.collections.SelectedItems;
4949

5050
/**
5151
* Gallery: Show zeoro or more images in a grid optionally filtered by a
@@ -167,6 +167,11 @@ public boolean onCreateOptionsMenu(Menu menu) {
167167

168168
inflater.inflate(R.menu.menu_gallery_non_selected_only, menu);
169169
inflater.inflate(R.menu.menu_gallery_non_multiselect, menu);
170+
171+
if (Global.useAo10MediaImageDbReplacement) {
172+
inflater.inflate(R.menu.menu_ao10, menu);
173+
}
174+
170175
/*
171176
getActionBar().setListNavigationCallbacks();
172177
MenuItem sorter = menu.getItem(R.id.cmd_sort);
@@ -202,6 +207,9 @@ public boolean onOptionsItemSelected(MenuItem item) {
202207
case R.id.cmd_about:
203208
AboutDialogPreference.createAboutDialog(this).show();
204209
return true;
210+
case R.id.cmd_db_reload:
211+
AndroFotoFinderApp.getMediaContent2DbUpdateService().rebuild(this, null);
212+
return true;
205213
case R.id.cmd_more:
206214
new Handler().postDelayed(new Runnable() {
207215
public void run() {

0 commit comments

Comments
 (0)