Skip to content

Commit c2ec55a

Browse files
committed
Fix build warnings
1 parent 1f112f0 commit c2ec55a

File tree

5 files changed

+18
-23
lines changed

5 files changed

+18
-23
lines changed

android-wave-recorder/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
43
android {
54

65

android-wave-recorder/src/main/java/com/github/squti/androidwaverecorder/WaveHeaderWriter.kt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@ internal class WaveHeaderWriter(private val filePath: String, private val waveCo
6262
channels: Int, byteRate: Long, bitsPerSample: Int
6363
): ByteArray {
6464
val header = ByteArray(44)
65-
header[0] = 'R'.toByte()
66-
header[1] = 'I'.toByte()
67-
header[2] = 'F'.toByte()
68-
header[3] = 'F'.toByte()
65+
header[0] = 'R'.code.toByte()
66+
header[1] = 'I'.code.toByte()
67+
header[2] = 'F'.code.toByte()
68+
header[3] = 'F'.code.toByte()
6969
header[4] = (totalDataLen and 0xff).toByte()
7070
header[5] = (totalDataLen shr 8 and 0xff).toByte()
7171
header[6] = (totalDataLen shr 16 and 0xff).toByte()
7272
header[7] = (totalDataLen shr 24 and 0xff).toByte()
73-
header[8] = 'W'.toByte()
74-
header[9] = 'A'.toByte()
75-
header[10] = 'V'.toByte()
76-
header[11] = 'E'.toByte()
77-
header[12] = 'f'.toByte()
78-
header[13] = 'm'.toByte()
79-
header[14] = 't'.toByte()
80-
header[15] = ' '.toByte()
73+
header[8] = 'W'.code.toByte()
74+
header[9] = 'A'.code.toByte()
75+
header[10] = 'V'.code.toByte()
76+
header[11] = 'E'.code.toByte()
77+
header[12] = 'f'.code.toByte()
78+
header[13] = 'm'.code.toByte()
79+
header[14] = 't'.code.toByte()
80+
header[15] = ' '.code.toByte()
8181
header[16] = 16
8282
header[17] = 0
8383
header[18] = 0
@@ -98,10 +98,10 @@ internal class WaveHeaderWriter(private val filePath: String, private val waveCo
9898
header[33] = 0
9999
header[34] = bitsPerSample.toByte()
100100
header[35] = 0
101-
header[36] = 'd'.toByte()
102-
header[37] = 'a'.toByte()
103-
header[38] = 't'.toByte()
104-
header[39] = 'a'.toByte()
101+
header[36] = 'd'.code.toByte()
102+
header[37] = 'a'.code.toByte()
103+
header[38] = 't'.code.toByte()
104+
header[39] = 'a'.code.toByte()
105105
header[40] = (totalAudioLen and 0xff).toByte()
106106
header[41] = (totalAudioLen shr 8 and 0xff).toByte()
107107
header[42] = (totalAudioLen shr 16 and 0xff).toByte()

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ android.useAndroidX=true
1919
android.enableJetifier=true
2020
# Kotlin code style for this project: "official" or "obsolete":
2121
kotlin.code.style=official
22-
android.defaults.buildfeatures.buildconfig=true
2322
android.nonTransitiveRClass=false
2423
android.nonFinalResIds=false

sample/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ apply plugin: 'com.android.application'
22

33
apply plugin: 'kotlin-android'
44

5-
apply plugin: 'kotlin-android-extensions'
6-
75
android {
86
defaultConfig {
97
compileSdk 33

sample/src/main/java/com/github/squti/androidwaverecordersample/MainActivity.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import androidx.lifecycle.lifecycleScope
3737
import com.github.squti.androidwaverecorder.RecorderState
3838
import com.github.squti.androidwaverecorder.WaveRecorder
3939
import com.github.squti.androidwaverecordersample.databinding.ActivityMainBinding
40-
import kotlinx.android.synthetic.main.activity_main.*
4140
import kotlinx.coroutines.Dispatchers
4241
import kotlinx.coroutines.GlobalScope
4342
import kotlinx.coroutines.launch
@@ -103,7 +102,7 @@ class MainActivity : AppCompatActivity() {
103102
waveRecorder.resumeRecording()
104103
}
105104
}
106-
binding.showAmplitudeSwitch.setOnCheckedChangeListener { buttonView, isChecked ->
105+
binding.showAmplitudeSwitch.setOnCheckedChangeListener { _, isChecked ->
107106
if (isChecked) {
108107
binding.amplitudeTextView.text = "Amplitude : 0"
109108
binding.amplitudeTextView.visibility = View.VISIBLE
@@ -117,7 +116,7 @@ class MainActivity : AppCompatActivity() {
117116
}
118117
}
119118

120-
binding.noiseSuppressorSwitch.setOnCheckedChangeListener { buttonView, isChecked ->
119+
binding.noiseSuppressorSwitch.setOnCheckedChangeListener { _, isChecked ->
121120
waveRecorder.noiseSuppressorActive = isChecked
122121
if (isChecked)
123122
Toast.makeText(this, "Noise Suppressor Activated", Toast.LENGTH_SHORT).show()

0 commit comments

Comments
 (0)