Skip to content

Commit 6fab2c2

Browse files
authored
fix: remove hide notification preference (#151)
* fix: remove hide notification feature from settings * docs: update changelog
1 parent ce91c20 commit 6fab2c2

7 files changed

Lines changed: 10 additions & 50 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Moved recording-related preferences to a new "Recording" section ([#147])
1818
- Updated translations
1919

20+
### Removed
21+
22+
- Removed outdated option for hiding notification ([#150])
23+
2024
## [1.2.0] - 2025-05-20
2125

2226
### Added
@@ -102,3 +106,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
102106
[#106]: https://github.com/FossifyOrg/Voice-Recorder/issues/106
103107
[#141]: https://github.com/FossifyOrg/Voice-Recorder/issues/141
104108
[#147]: https://github.com/FossifyOrg/Voice-Recorder/issues/147
109+
[#150]: https://github.com/FossifyOrg/Voice-Recorder/issues/150

app/src/main/kotlin/org/fossify/voicerecorder/activities/SettingsActivity.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ class SettingsActivity : SimpleActivity() {
7676
setupUseEnglish()
7777
setupLanguage()
7878
setupChangeDateTimeFormat()
79-
setupHideNotification()
8079
setupSaveRecordingsFolder()
8180
setupExtension()
8281
setupBitrate()
@@ -152,14 +151,6 @@ class SettingsActivity : SimpleActivity() {
152151
}
153152
}
154153

155-
private fun setupHideNotification() {
156-
binding.settingsHideNotification.isChecked = config.hideNotification
157-
binding.settingsHideNotificationHolder.setOnClickListener {
158-
binding.settingsHideNotification.toggle()
159-
config.hideNotification = binding.settingsHideNotification.isChecked
160-
}
161-
}
162-
163154
private fun setupSaveRecordingsFolder() {
164155
binding.settingsSaveRecordingsLabel.text =
165156
addLockedLabelIfNeeded(R.string.save_recordings_in)

app/src/main/kotlin/org/fossify/voicerecorder/helpers/Config.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ class Config(context: Context) : BaseConfig(context) {
1212
fun newInstance(context: Context) = Config(context)
1313
}
1414

15-
var hideNotification: Boolean
16-
get() = prefs.getBoolean(HIDE_NOTIFICATION, false)
17-
set(hideNotification) = prefs.edit().putBoolean(HIDE_NOTIFICATION, hideNotification).apply()
18-
1915
var saveRecordingsFolder: String
2016
get() = prefs.getString(SAVE_RECORDINGS, context.getDefaultRecordingsFolder())!!
2117
set(saveRecordingsFolder) = prefs.edit().putString(SAVE_RECORDINGS, saveRecordingsFolder)

app/src/main/kotlin/org/fossify/voicerecorder/helpers/Constants.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const val IS_RECORDING = "is_recording"
9090
const val TOGGLE_WIDGET_UI = "toggle_widget_ui"
9191

9292
// shared preferences
93-
const val HIDE_NOTIFICATION = "hide_notification"
9493
const val SAVE_RECORDINGS = "save_recordings"
9594
const val EXTENSION = "extension"
9695
const val AUDIO_SOURCE = "audio_source"

app/src/main/kotlin/org/fossify/voicerecorder/services/RecorderService.kt

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -267,45 +267,30 @@ class RecorderService : Service() {
267267
}
268268

269269
private fun showNotification(): Notification {
270-
val hideNotification = config.hideNotification
271270
val channelId = "simple_recorder"
272271
val label = getString(R.string.app_name)
273272
val notificationManager =
274273
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
275-
val importance = if (hideNotification) {
276-
NotificationManager.IMPORTANCE_MIN
277-
} else {
278-
NotificationManager.IMPORTANCE_DEFAULT
279-
}
280274

281-
NotificationChannel(channelId, label, importance).apply {
275+
NotificationChannel(channelId, label, NotificationManager.IMPORTANCE_DEFAULT).apply {
282276
setSound(null, null)
283277
notificationManager.createNotificationChannel(this)
284278
}
285279

286-
var priority = NotificationManager.IMPORTANCE_DEFAULT
287-
var icon = R.drawable.ic_graphic_eq_vector
288-
var title = label
289-
var visibility = NotificationCompat.VISIBILITY_PUBLIC
280+
val icon = R.drawable.ic_graphic_eq_vector
281+
val title = label
282+
val visibility = NotificationCompat.VISIBILITY_PUBLIC
290283
var text = getString(R.string.recording)
291284
if (status == RECORDING_PAUSED) {
292285
text += " (${getString(R.string.paused)})"
293286
}
294287

295-
if (hideNotification) {
296-
priority = NotificationManager.IMPORTANCE_MIN
297-
icon = R.drawable.ic_empty
298-
title = ""
299-
text = ""
300-
visibility = NotificationCompat.VISIBILITY_SECRET
301-
}
302-
303288
val builder = NotificationCompat.Builder(this, channelId)
304289
.setContentTitle(title)
305290
.setContentText(text)
306291
.setSmallIcon(icon)
307292
.setContentIntent(getOpenAppIntent())
308-
.setPriority(priority)
293+
.setPriority(NotificationManager.IMPORTANCE_DEFAULT)
309294
.setVisibility(visibility)
310295
.setSound(null)
311296
.setOngoing(true)

app/src/main/res/layout/activity_settings.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -148,21 +148,6 @@
148148

149149
</RelativeLayout>
150150

151-
<RelativeLayout
152-
android:id="@+id/settings_hide_notification_holder"
153-
style="@style/SettingsHolderSwitchStyle"
154-
android:layout_width="match_parent"
155-
android:layout_height="wrap_content">
156-
157-
<org.fossify.commons.views.MyMaterialSwitch
158-
android:id="@+id/settings_hide_notification"
159-
style="@style/SettingsSwitchStyle"
160-
android:layout_width="match_parent"
161-
android:layout_height="wrap_content"
162-
android:text="@string/try_hiding_notification" />
163-
164-
</RelativeLayout>
165-
166151
<include
167152
android:id="@+id/settings_general_settings_divider"
168153
layout="@layout/divider" />

app/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<item quantity="other">%d recordings</item>
2323
</plurals>
2424
<!-- Settings -->
25-
<string name="try_hiding_notification">Try hiding the recording notification</string>
2625
<string name="save_recordings_in">Save recordings in</string>
2726
<string name="audio_source">Audio source</string>
2827
<string name="bitrate">Bitrate</string>

0 commit comments

Comments
 (0)