add a toggle for disabling photo exif metadata

This commit is contained in:
tibbi 2017-10-21 23:29:57 +02:00
parent 82d93f56d4
commit c30a161073
19 changed files with 51 additions and 1 deletions

View File

@ -81,4 +81,8 @@ class Config(context: Context) : BaseConfig(context) {
var alwaysOpenBackCamera: Boolean var alwaysOpenBackCamera: Boolean
get() = prefs.getBoolean(ALWAYS_OPEN_BACK_CAMERA, false) get() = prefs.getBoolean(ALWAYS_OPEN_BACK_CAMERA, false)
set(alwaysOpenBackCamera) = prefs.edit().putBoolean(ALWAYS_OPEN_BACK_CAMERA, alwaysOpenBackCamera).apply() set(alwaysOpenBackCamera) = prefs.edit().putBoolean(ALWAYS_OPEN_BACK_CAMERA, alwaysOpenBackCamera).apply()
var savePhotoMetadata: Boolean
get() = prefs.getBoolean(SAVE_PHOTO_METADATA, true)
set(savePhotoMetadata) = prefs.edit().putBoolean(SAVE_PHOTO_METADATA, savePhotoMetadata).apply()
} }

View File

@ -21,6 +21,7 @@ val FRONT_VIDEO_RESOLUTION_INDEX = "front_video_resolution_index"
val PHOTO_PREVIEW_HINT_SHOWN = "photo_preview_hint_shown" val PHOTO_PREVIEW_HINT_SHOWN = "photo_preview_hint_shown"
val KEEP_SETTINGS_VISIBLE = "keep_settings_visible" val KEEP_SETTINGS_VISIBLE = "keep_settings_visible"
val ALWAYS_OPEN_BACK_CAMERA = "always_open_back_camera" val ALWAYS_OPEN_BACK_CAMERA = "always_open_back_camera"
val SAVE_PHOTO_METADATA = "save_photo_metadata"
val FLASH_OFF = 0 val FLASH_OFF = 0
val FLASH_ON = 1 val FLASH_ON = 1

View File

@ -94,7 +94,9 @@ class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId
if (path.startsWith(activity.internalStoragePath)) { if (path.startsWith(activity.internalStoragePath)) {
exifOrientation = getExifOrientation(totalRotation) exifOrientation = getExifOrientation(totalRotation)
} }
if (activity.config.savePhotoMetadata)
tempExif.copyTo(fileExif) tempExif.copyTo(fileExif)
fileExif.setAttribute(ExifInterface.TAG_ORIENTATION, exifOrientation) fileExif.setAttribute(ExifInterface.TAG_ORIENTATION, exifOrientation)
fileExif.saveAttributes() fileExif.saveAttributes()

View File

@ -33,6 +33,7 @@ class SettingsActivity : SimpleActivity() {
setupFlipPhotos() setupFlipPhotos()
setupKeepSettingsVisible() setupKeepSettingsVisible()
setupAlwaysOpenBackCamera() setupAlwaysOpenBackCamera()
setupSavePhotoMetadata()
updateTextColors(settings_holder) updateTextColors(settings_holder)
} }
@ -135,4 +136,12 @@ class SettingsActivity : SimpleActivity() {
config.alwaysOpenBackCamera = settings_always_open_back_camera.isChecked config.alwaysOpenBackCamera = settings_always_open_back_camera.isChecked
} }
} }
private fun setupSavePhotoMetadata() {
settings_save_photo_metadata.isChecked = config.savePhotoMetadata
settings_save_photo_metadata_holder.setOnClickListener {
settings_save_photo_metadata.toggle()
config.savePhotoMetadata = settings_save_photo_metadata.isChecked
}
}
} }

View File

@ -224,5 +224,25 @@
android:text="@string/always_open_back_camera"/> android:text="@string/always_open_back_camera"/>
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/settings_save_photo_metadata_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_save_photo_metadata"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/save_photo_metadata"/>
</RelativeLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Drehe Fotos der Frontkamera horizontal</string> <string name="flip_front_camera_photos_horizontally">Drehe Fotos der Frontkamera horizontal</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -31,6 +31,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Inverter na horizontal as fotos da câmara frontal</string> <string name="flip_front_camera_photos_horizontally">Inverter na horizontal as fotos da câmara frontal</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Preklopiť fotky z prednej kamera vodorovne</string> <string name="flip_front_camera_photos_horizontally">Preklopiť fotky z prednej kamera vodorovne</string>
<string name="keep_settings_visible">Neskrývať tlačidlá nastavení</string> <string name="keep_settings_visible">Neskrývať tlačidlá nastavení</string>
<string name="always_open_back_camera">Stále otvárať aplikáciu s aktívnou zadnou kamerou</string> <string name="always_open_back_camera">Stále otvárať aplikáciu s aktívnou zadnou kamerou</string>
<string name="save_photo_metadata">Ukladať exif metadáta fotografií</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View File

@ -30,6 +30,7 @@
<string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string> <string name="flip_front_camera_photos_horizontally">Flip front camera photos horizontally</string>
<string name="keep_settings_visible">Keep setting buttons visible</string> <string name="keep_settings_visible">Keep setting buttons visible</string>
<string name="always_open_back_camera">Always open the app with the Back camera</string> <string name="always_open_back_camera">Always open the app with the Back camera</string>
<string name="save_photo_metadata">Save photo exif metadata</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->