Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved recording-related preferences to a new "Recording" section ([#147])
- Updated translations

### Removed

- Removed outdated option for hiding notification ([#150])

## [1.2.0] - 2025-05-20

### Added
Expand Down Expand Up @@ -102,3 +106,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#106]: https://github.com/FossifyOrg/Voice-Recorder/issues/106
[#141]: https://github.com/FossifyOrg/Voice-Recorder/issues/141
[#147]: https://github.com/FossifyOrg/Voice-Recorder/issues/147
[#150]: https://github.com/FossifyOrg/Voice-Recorder/issues/150
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class SettingsActivity : SimpleActivity() {
setupUseEnglish()
setupLanguage()
setupChangeDateTimeFormat()
setupHideNotification()
setupSaveRecordingsFolder()
setupExtension()
setupBitrate()
Expand Down Expand Up @@ -152,14 +151,6 @@ class SettingsActivity : SimpleActivity() {
}
}

private fun setupHideNotification() {
binding.settingsHideNotification.isChecked = config.hideNotification
binding.settingsHideNotificationHolder.setOnClickListener {
binding.settingsHideNotification.toggle()
config.hideNotification = binding.settingsHideNotification.isChecked
}
}

private fun setupSaveRecordingsFolder() {
binding.settingsSaveRecordingsLabel.text =
addLockedLabelIfNeeded(R.string.save_recordings_in)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ class Config(context: Context) : BaseConfig(context) {
fun newInstance(context: Context) = Config(context)
}

var hideNotification: Boolean
get() = prefs.getBoolean(HIDE_NOTIFICATION, false)
set(hideNotification) = prefs.edit().putBoolean(HIDE_NOTIFICATION, hideNotification).apply()

var saveRecordingsFolder: String
get() = prefs.getString(SAVE_RECORDINGS, context.getDefaultRecordingsFolder())!!
set(saveRecordingsFolder) = prefs.edit().putString(SAVE_RECORDINGS, saveRecordingsFolder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const val IS_RECORDING = "is_recording"
const val TOGGLE_WIDGET_UI = "toggle_widget_ui"

// shared preferences
const val HIDE_NOTIFICATION = "hide_notification"
const val SAVE_RECORDINGS = "save_recordings"
const val EXTENSION = "extension"
const val AUDIO_SOURCE = "audio_source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,45 +267,30 @@ class RecorderService : Service() {
}

private fun showNotification(): Notification {
val hideNotification = config.hideNotification
val channelId = "simple_recorder"
val label = getString(R.string.app_name)
val notificationManager =
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val importance = if (hideNotification) {
NotificationManager.IMPORTANCE_MIN
} else {
NotificationManager.IMPORTANCE_DEFAULT
}

NotificationChannel(channelId, label, importance).apply {
NotificationChannel(channelId, label, NotificationManager.IMPORTANCE_DEFAULT).apply {
setSound(null, null)
notificationManager.createNotificationChannel(this)
}

var priority = NotificationManager.IMPORTANCE_DEFAULT
var icon = R.drawable.ic_graphic_eq_vector
var title = label
var visibility = NotificationCompat.VISIBILITY_PUBLIC
val icon = R.drawable.ic_graphic_eq_vector
val title = label
val visibility = NotificationCompat.VISIBILITY_PUBLIC
var text = getString(R.string.recording)
if (status == RECORDING_PAUSED) {
text += " (${getString(R.string.paused)})"
}

if (hideNotification) {
priority = NotificationManager.IMPORTANCE_MIN
icon = R.drawable.ic_empty
title = ""
text = ""
visibility = NotificationCompat.VISIBILITY_SECRET
}

val builder = NotificationCompat.Builder(this, channelId)
.setContentTitle(title)
.setContentText(text)
.setSmallIcon(icon)
.setContentIntent(getOpenAppIntent())
.setPriority(priority)
.setPriority(NotificationManager.IMPORTANCE_DEFAULT)
.setVisibility(visibility)
.setSound(null)
.setOngoing(true)
Expand Down
15 changes: 0 additions & 15 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,6 @@

</RelativeLayout>

<RelativeLayout
android:id="@+id/settings_hide_notification_holder"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_hide_notification"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/try_hiding_notification" />

</RelativeLayout>

<include
android:id="@+id/settings_general_settings_divider"
layout="@layout/divider" />
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<item quantity="other">%d recordings</item>
</plurals>
<!-- Settings -->
<string name="try_hiding_notification">Try hiding the recording notification</string>
<string name="save_recordings_in">Save recordings in</string>
<string name="audio_source">Audio source</string>
<string name="bitrate">Bitrate</string>
Expand Down
Loading