Skip to content

Commit

Permalink
#153: #155: merged 2 incomplete disabled feature branches ao10 and re…
Browse files Browse the repository at this point in the history
…name-multible
  • Loading branch information
k3b committed Jan 29, 2020
2 parents 42225e8 + 5066b95 commit 28d40ba
Show file tree
Hide file tree
Showing 77 changed files with 3,728 additions and 1,404 deletions.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Smartphone (please complete the following information):**
- Android version [e.g. Android-7.1] :
- [A Photo Manager Version](https://github.com/k3b/APhotoManager/releases) (i.e. 0.4.6.160304) :

**Additional context**
Add any other context about the problem here.

**Crash Report**
If you report an app crash: Can you add the crash logfile to this ticket?

When APhotoManager crashes it tries to write a crash log file in the [**Error Log Folder**](https://github.com/k3b/APhotoManager/wiki/settings#logfolder).

* [ExternalStorageDirectory]/copy/log/androFotofinder.logcat-2017....txt
* i.e. /storage/sdcard0/copy/log/androFotofinder.logcat-20170728-135704.txt
* crash data from 2017-07-28 13:57

For more details on Error Loging see [diagnostic settings](https://github.com/k3b/APhotoManager/wiki/settings#Diagnostics).
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

* Affected Module:
* [ ] [Gallery-View](https://github.com/k3b/APhotoManager/wiki/Gallery-View)
* [ ] [Geographic-Map](https://github.com/k3b/APhotoManager/wiki/geographic-map)
* [ ] [Image-View](https://github.com/k3b/APhotoManager/wiki/Image-View)
* [ ] [Filtering](https://github.com/k3b/APhotoManager/wiki/Filter-View)
* [ ] [Folder-Picker](https://github.com/k3b/APhotoManager/wiki/Folder-Picker)
* [ ] [Settings](https://github.com/k3b/APhotoManager/wiki/settings)
* [ ] [Intent API](https://github.com/k3b/APhotoManager/wiki/intentapi)
18 changes: 8 additions & 10 deletions .github/old_ISSUE_TEMPLATE.md → .github/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
### Expected behavior
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

...
**Describe the solution you'd like**
A clear and concise description of what you want to happen.

### Actual behavior
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

...
**Additional context**
Add any other context or screenshots about the feature request here.

### Environment

* Android Version (i.e. 5.1):
* ...
* [A Photo Manager Version](https://github.com/k3b/APhotoManager/releases) (i.e. 0.4.6.160304) :
* ...
* Affected Module:
* [ ] [Gallery-View](https://github.com/k3b/APhotoManager/wiki/Gallery-View)
* [ ] [Geographic-Map](https://github.com/k3b/APhotoManager/wiki/geographic-map)
Expand Down
52 changes: 52 additions & 0 deletions FAQs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Q. What is APhotoManager?

A. APhotoManager is an opensource mobile gallery app that can manage your local photos.

Q. What is geotagging?

A. Geotagging is the act of assigning geographical location to a photographs or videos.

Q. How do I add geotags to my photos using APhotoManager?

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.

Q. What is exif data?

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.

Q. How do I add, remove or edit exif data on my photo using APhotoManager?

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.


Q. Can I select a folder to view pictures?

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.

Q. How do I find pictures on APhotoManager?

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.

Q. Can I sort my photos on APhotoManager?

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.

Q. Can I share photos from APhotoManager?

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.


Q. Which photo management options are available on APhotoManager?

A. File management options like, rename, copy and move are available on APhotoManager.

Q. Are my photos uploaded to third party apps?

A. No, photos are stored locally on the device, there's no upload to third party applications.

Q. Does APhotoManager contain ads?

A. APhotoManager does not contain ads, no usertracking, it is absolutely free and open source.


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)
7 changes: 5 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ android {
defaultConfig {
// fdroid-release 'de.k3b.android.androFotoFinder'
// main-develop-branch 'de.k3b.android.androFotoFinder.dev'
applicationId 'de.k3b.android.androFotoFinder.dev'

// applicationId 'de.k3b.android.androFotoFinder'
applicationId 'de.k3b.android.androFotoFinder'

minSdkVersion 14 // Android 4.0 Ice Cream Sandwich (API 14); Android 4.4 KitKat (API 19); Android 5.0 Lollipop (API 21);
// Android 6.0 Marshmallow (API 23); Android 7.0 Nougat (API 24)
maxSdkVersion 28 // #155: android-10=api29

targetSdkVersion 21

// non-fdroid release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import java.util.ArrayList;

import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.io.FileUtils;
import de.k3b.io.VISIBILITY;
import de.k3b.io.collections.SelectedItems;
import de.k3b.io.FileUtils;
import de.k3b.media.PhotoPropertiesUtil;

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static SelectedFiles querySelectedFiles(Context context, SelectedItems it
List<String> paths = new ArrayList<String>();
List<Date> datesPhotoTaken = new ArrayList<Date>();

if (FotoSql.getFileNames(context, items, ids, paths, datesPhotoTaken) != null) {
if (FotoSql.getFileNames(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()]));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2019 by k3b.
* Copyright (c) 2015-2020 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
Expand All @@ -19,8 +19,10 @@

package de.k3b.android.androFotoFinder;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.support.annotation.NonNull;
import android.util.Log;
import android.widget.Toast;
Expand All @@ -36,11 +38,21 @@
import de.k3b.LibGlobal;
import de.k3b.android.GuiUtil;
import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader;
import de.k3b.android.androFotoFinder.queries.DatabaseHelper;
import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.android.androFotoFinder.queries.FotoSqlBase;
import de.k3b.android.androFotoFinder.queries.GlobalMediaContentObserver;
import de.k3b.android.androFotoFinder.queries.IMediaRepositoryApi;
import de.k3b.android.androFotoFinder.queries.MediaContent2DBUpdateService;
import de.k3b.android.androFotoFinder.queries.MediaContentproviderRepository;
import de.k3b.android.androFotoFinder.queries.MediaContentproviderRepositoryImpl;
import de.k3b.android.androFotoFinder.queries.MediaDBRepository;
import de.k3b.android.androFotoFinder.queries.MergedMediaRepository;
import de.k3b.android.osmdroid.forge.MapsForgeSupport;
import de.k3b.android.util.LogCat;
import de.k3b.android.util.PhotoChangeNotifyer;
import de.k3b.android.widget.ActivityWithCallContext;
import de.k3b.android.widget.LocalizedActivity;
import de.k3b.database.QueryParameter;
import de.k3b.io.PhotoAutoprocessingDto;
import de.k3b.media.ExifInterface;
Expand All @@ -58,6 +70,10 @@
public class AndroFotoFinderApp extends Application {
private static String fileNamePrefix = "androFotofinder.logcat-";

public static MediaContent2DBUpdateService getMediaContent2DbUpdateService() {
return MediaContent2DBUpdateService.instance;
}

private LogCat mCrashSaveToFile = null;


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

public static void setMediaImageDbReplacement(Context context, boolean useMediaImageDbReplacement) {
final IMediaRepositoryApi oldMediaDBApi = FotoSql.getMediaDBApi();
if ((oldMediaDBApi == null) || (Global.useAo10MediaImageDbReplacement != useMediaImageDbReplacement)) {

// menu must be recreated
LocalizedActivity.setMustRecreate();

Global.useAo10MediaImageDbReplacement = useMediaImageDbReplacement;

final MediaContentproviderRepository mediaContentproviderRepository = new MediaContentproviderRepository(context);

if (Global.useAo10MediaImageDbReplacement) {
final SQLiteDatabase writableDatabase = DatabaseHelper.getWritableDatabase(context);
final MediaDBRepository mediaDBRepository = new MediaDBRepository(writableDatabase);
FotoSql.setMediaDBApi(new MergedMediaRepository(mediaDBRepository, mediaContentproviderRepository));

MediaContent2DBUpdateService.instance = new MediaContent2DBUpdateService(context, writableDatabase);

if (FotoSql.getCount(new QueryParameter().addWhere("1 = 1")) == 0) {
// database is empty; reload from Contentprovider
MediaContent2DBUpdateService.instance.rebuild(context, null);
}

PhotoChangeNotifyer.registerContentObserver(context, GlobalMediaContentObserver.getInstance(context));

} else {
PhotoChangeNotifyer.unregisterContentObserver(context, GlobalMediaContentObserver.getInstance(context));
if ((oldMediaDBApi != null) && (MediaContent2DBUpdateService.instance != null)) {
// switching from mediaImageDbReplacement to Contentprovider
MediaContent2DBUpdateService.instance.clearMediaCopy();
}
FotoSql.setMediaDBApi(mediaContentproviderRepository);
MediaContent2DBUpdateService.instance = null;
}
}
}

/*
private RefWatcher refWatcher;
Expand Down Expand Up @@ -114,7 +167,10 @@ public static RefWatcher getRefWatcher(Context context) {
mCrashSaveToFile = new LogCat(Global.LOG_CONTEXT, HugeImageLoader.LOG_TAG,
PhotoViewAttacher.LOG_TAG, CupcakeGestureDetector.LOG_TAG,
LibGlobal.LOG_TAG, ThumbNailUtils.LOG_TAG, IMapView.LOGTAG,
ExifInterface.LOG_TAG, PhotoPropertiesImageReader.LOG_TAG) {
ExifInterface.LOG_TAG, PhotoPropertiesImageReader.LOG_TAG,
FotoSql.LOG_TAG,
MediaDBRepository.LOG_TAG,
MediaContentproviderRepositoryImpl.LOG_TAG) {

@Override
public void uncaughtException(Thread thread, Throwable ex) {
Expand All @@ -124,13 +180,14 @@ public void uncaughtException(Thread thread, Throwable ex) {
super.uncaughtException(thread, ex);
}

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

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

FotoSql.deleteMediaWithNullPath(this);
FotoSql.deleteMediaWithNullPath();

Log.i(Global.LOG_CONTEXT, getAppId() + " created");
}
Expand All @@ -185,9 +242,9 @@ public void onTerminate() {
super.onTerminate();
}

public void saveToFile() {
public void saveToFile(Activity activity) {
if (mCrashSaveToFile != null) {
mCrashSaveToFile.saveToFile();
mCrashSaveToFile.saveToFile(activity);
}
}
public void clear() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 by k3b.
* Copyright (c) 2017-2020 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
Expand All @@ -19,8 +19,6 @@

package de.k3b.android.androFotoFinder;

import android.app.Activity;

import java.io.Closeable;
import java.io.IOException;

Expand All @@ -37,7 +35,7 @@
public class AndroidTransactionLogger extends TransactionLoggerBase implements Closeable {
private AndroidFileCommands execLog;

public AndroidTransactionLogger(Activity ctx, long now, AndroidFileCommands execLog) {
public AndroidTransactionLogger(AndroidFileCommands execLog, long now) {
super(execLog, now);

this.execLog = execLog;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2018 by k3b.
* Copyright (c) 2015-2020 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
Expand Down Expand Up @@ -44,8 +44,8 @@
import de.k3b.android.widget.AboutDialogPreference;
import de.k3b.android.widget.BaseQueryActivity;
import de.k3b.database.QueryParameter;
import de.k3b.io.collections.SelectedItems;
import de.k3b.io.IDirectory;
import de.k3b.io.collections.SelectedItems;

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

inflater.inflate(R.menu.menu_gallery_non_selected_only, menu);
inflater.inflate(R.menu.menu_gallery_non_multiselect, menu);

if (Global.useAo10MediaImageDbReplacement) {
inflater.inflate(R.menu.menu_ao10, menu);
}

/*
getActionBar().setListNavigationCallbacks();
MenuItem sorter = menu.getItem(R.id.cmd_sort);
Expand Down Expand Up @@ -202,6 +207,9 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.cmd_about:
AboutDialogPreference.createAboutDialog(this).show();
return true;
case R.id.cmd_db_reload:
AndroFotoFinderApp.getMediaContent2DbUpdateService().rebuild(this, null);
return true;
case R.id.cmd_more:
new Handler().postDelayed(new Runnable() {
public void run() {
Expand Down
Loading

0 comments on commit 28d40ba

Please sign in to comment.