mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-01-30 15:04:49 +01:00
commit
c8e4f411a4
@ -38,6 +38,10 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
get() = prefs.getBoolean(VOLUME_BUTTONS_AS_SHUTTER, false)
|
||||
set(volumeButtonsAsShutter) = prefs.edit().putBoolean(VOLUME_BUTTONS_AS_SHUTTER, volumeButtonsAsShutter).apply()
|
||||
|
||||
var turnFlashOffAtStartup: Boolean
|
||||
get() = prefs.getBoolean(TURN_FLASH_OFF_AT_STARTUP, false)
|
||||
set(turnFlashOffAtStartup) = prefs.edit().putBoolean(TURN_FLASH_OFF_AT_STARTUP, turnFlashOffAtStartup).apply()
|
||||
|
||||
var lastUsedCamera: Int
|
||||
get() = prefs.getInt(LAST_USED_CAMERA, Camera.CameraInfo.CAMERA_FACING_BACK)
|
||||
set(cameraId) = prefs.edit().putInt(LAST_USED_CAMERA, cameraId).apply()
|
||||
|
@ -10,6 +10,7 @@ val SHOW_PREVIEW = "show_preview"
|
||||
val SOUND = "sound"
|
||||
val FOCUS_BEFORE_CAPTURE = "focus_before_capture"
|
||||
val VOLUME_BUTTONS_AS_SHUTTER = "volume_buttons_as_shutter"
|
||||
val TURN_FLASH_OFF_AT_STARTUP = "turn_flash_off_at_startup"
|
||||
val LAST_USED_CAMERA = "last_used_camera"
|
||||
val FLASHLIGHT_STATE = "flashlight_state"
|
||||
val BACK_PHOTO_RESOLUTION_INDEX = "back_photo_resolution_index"
|
||||
|
@ -155,7 +155,7 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
||||
mIsInPhotoMode = true
|
||||
mTimerHandler = Handler()
|
||||
mFadeHandler = Handler()
|
||||
mFlashlightState = config.flashlightState
|
||||
mFlashlightState = if (config.turnFlashOffAtStartup) FLASH_OFF else config.flashlightState
|
||||
setupPreviewImage(true)
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
setupSound()
|
||||
setupFocusBeforeCapture()
|
||||
setupVolumeButtonsAsShutter()
|
||||
setupTurnFlashOffAtStartup()
|
||||
updateTextColors(settings_holder)
|
||||
}
|
||||
|
||||
@ -99,4 +100,12 @@ class SettingsActivity : SimpleActivity() {
|
||||
config.volumeButtonsAsShutter = settings_volume_buttons_as_shutter.isChecked
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupTurnFlashOffAtStartup() {
|
||||
settings_turn_flash_off_at_startup.isChecked = config.turnFlashOffAtStartup
|
||||
settings_turn_flash_off_at_startup_holder.setOnClickListener {
|
||||
settings_turn_flash_off_at_startup.toggle()
|
||||
config.turnFlashOffAtStartup = settings_turn_flash_off_at_startup.isChecked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -144,5 +144,25 @@
|
||||
android:text="@string/volume_buttons_as_shutter"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_turn_flash_off_at_startup_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_turn_flash_off_at_startup"
|
||||
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/turn_flash_off_at_startup"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Video</string>
|
||||
<string name="focus_before_capture">Vor der Aufnahme fokussieren</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Vídeo</string>
|
||||
<string name="focus_before_capture">Enfocar antes de la captura</string>
|
||||
<string name="volume_buttons_as_shutter">Utilizar los botones de volumen como obturador</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Video</string>
|
||||
<string name="focus_before_capture">Focus before capture</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Video</string>
|
||||
<string name="focus_before_capture">Messa a fuoco prima della cattura</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Video</string>
|
||||
<string name="focus_before_capture">キャプチャ前に再度焦点を合わせる</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Video</string>
|
||||
<string name="focus_before_capture">Focus before capture</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -28,6 +28,7 @@
|
||||
<string name="video">Video</string>
|
||||
<string name="focus_before_capture">Focus before capture</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Vídeo</string>
|
||||
<string name="focus_before_capture">Focus before capture</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Vídeo</string>
|
||||
<string name="focus_before_capture">Focar antes de capturar</string>
|
||||
<string name="volume_buttons_as_shutter">Usar botões de volume como obturador</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Видео</string>
|
||||
<string name="focus_before_capture">Перефокусировка перед захватом</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Выключать вспышку при запуске</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Video</string>
|
||||
<string name="focus_before_capture">Fokusera om innan bildtagning</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
@ -27,6 +27,7 @@
|
||||
<string name="video">Video</string>
|
||||
<string name="focus_before_capture">Focus before capture</string>
|
||||
<string name="volume_buttons_as_shutter">Use volume buttons as shutter</string>
|
||||
<string name="turn_flash_off_at_startup">Turn flash off at startup</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- Short description has to have less than 80 chars -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user