Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit e1889696 authored by Sebastiano Barezzi's avatar Sebastiano Barezzi
Browse files

Recorder: Reformat code

Change-Id: If279e887e5b862541e2b9fbdef0d149c919ffb92
parent 2418712a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ class ListActivity : AppCompatActivity(), RecordingListCallbacks {
            promptDeleteAllRecordings()
            true
        }

        else -> false
    }

+3 −1
Original line number Diff line number Diff line
@@ -27,10 +27,12 @@ class ListActionModeCallback(
            deleteSelected.run()
            true
        }

        R.id.action_share_selected -> {
            shareSelected.run()
            true
        }

        else -> false
    }

+3 −0
Original line number Diff line number Diff line
@@ -83,14 +83,17 @@ class RecordingItemViewHolder(
                callbacks.onRename(adapterPosition, it, titleTextView.text.toString())
                true
            }

            R.id.action_share -> {
                callbacks.onShare(it)
                true
            }

            R.id.action_delete -> {
                callbacks.onDelete(adapterPosition, it)
                true
            }

            else -> false
        }
    } ?: false
+8 −7
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ class SoundRecorderService : Service() {
                MSG_UNREGISTER_CLIENT -> synchronized(lock) {
                    unregisterClientLocked(msg.replyTo.binder)
                }

                else -> super.handleMessage(msg)
            }
        }
@@ -125,13 +126,13 @@ class SoundRecorderService : Service() {
    }

    override fun onStartCommand(intent: Intent, flags: Int, startId: Int) = when (intent.action) {
        ACTION_START -> if (intent.getStringExtra(EXTRA_FILE_NAME)?.let {
            startRecording(it)
        } == true) {
        ACTION_START -> intent.getStringExtra(EXTRA_FILE_NAME)?.let {
            if (startRecording(it)) {
                START_STICKY
            } else {
                START_NOT_STICKY
            }
        } ?: START_NOT_STICKY

        ACTION_STOP -> if (stopRecording()) START_STICKY else START_NOT_STICKY

+3 −2
Original line number Diff line number Diff line
@@ -130,7 +130,8 @@ class WaveFormView @JvmOverloads constructor(
    }

    fun setAmplitude(amplitude: Int) {
        synchronized(ampLock) { this.amplitude =
        synchronized(ampLock) {
            this.amplitude =
                (amplitude / maxAudioValue).coerceAtMost(idleAmplitude)
        }
    }
Loading