Skip to content

Commit

Permalink
Remove debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cliambrown committed Dec 5, 2021
1 parent 926c891 commit b41a199
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions app/src/main/java/com/cliambrown/easynoise/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
private val connection = object : ServiceConnection {

override fun onServiceConnected(className: ComponentName, service: IBinder) {
Log.i("clb-info", "onServiceConnected")
// We've bound to PlayerService, cast the IBinder and get PlayerService instance
val binder = service as PlayerService.LocalBinder
playerService = binder.getService()
Expand All @@ -54,20 +53,16 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
}

override fun onServiceDisconnected(arg0: ComponentName) {
Log.i("clb-info", "onServiceDisconnected")
serviceIsBound = false
}
}

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
Log.i("clb-info", "onCreateOptionsMenu")
getMenuInflater().inflate(R.menu.main_toolbar, menu)
Log.i("clb-info", "test")
return true
}

override fun onCreate(savedInstanceState: Bundle?) {
Log.i("clb-info", "onCreate")
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setSupportActionBar(findViewById(R.id.my_toolbar))
Expand Down Expand Up @@ -125,7 +120,6 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
}

override fun onStart() {
Log.i("clb-info", "onStart")
super.onStart()
// Bind to LocalService
Intent(this, PlayerService::class.java).also { intent ->
Expand All @@ -134,7 +128,6 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
}

override fun onStop() {
Log.i("clb-info", "onStop")
super.onStop()
unbindService(connection)
serviceIsBound = false
Expand Down Expand Up @@ -162,7 +155,6 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
}

fun updateHasPhonePermission(animate: Boolean = false) {
Log.i("clb-info", "updateHasPhonePermission")
val readPhoneState =
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)
val granted = (readPhoneState == PackageManager.PERMISSION_GRANTED)
Expand Down Expand Up @@ -238,7 +230,6 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
}

fun requestPhonePermission(@Suppress("UNUSED_PARAMETER")view: View) {
Log.i("clb-info", "requestPhonePermission")
val readPhoneState =
ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE)
if (readPhoneState != PackageManager.PERMISSION_GRANTED) {
Expand Down Expand Up @@ -279,7 +270,6 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
}

override fun updateClient(action: String) {
Log.i("clb-info", "updateClient")
when (action) {
PLAY -> setButtonsVisibility(true)
PAUSE -> setButtonsVisibility(false)
Expand All @@ -289,7 +279,6 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
}

fun setButtonsVisibility(isPlaying: Boolean) {
Log.i("clb-info", "setButtonsVisibility")
if (isPlaying) {
pauseButton.setVisibility(View.VISIBLE)
playButton.setVisibility(View.GONE)
Expand All @@ -300,7 +289,6 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
}

fun volumeChanged() {
Log.i("clb-info", "volumeChanged")
val volume = prefs.getInt("volume", 50)
volumeBar.setProgress(volume)
}
Expand All @@ -309,18 +297,15 @@ class MainActivity : AppCompatActivity(), PlayerService.Callbacks, SeekBar.OnSee
seekBar: SeekBar?, progress: Int,
fromUser: Boolean,
) {
Log.i("clb-info", "onProgressChanged")
prefs.edit().putInt("volume", progress).apply()
if (serviceIsBound) playerService.updateVolume()
}

override fun onStartTrackingTouch(seekBar: SeekBar?) {
Log.i("clb-info", "onStartTrackingTouch")
// Needed for some reason
}

override fun onStopTrackingTouch(seekBar: SeekBar?) {
Log.i("clb-info", "onProgressChanged")
// Needed for some reason
}

Expand Down

0 comments on commit b41a199

Please sign in to comment.