Browse Source

removed log calls and dupes comments

yattoz 5 years ago
parent
commit
4769b2f0bf

+ 4 - 4
app/src/main/java/fr/forum_thalie/tsumugi/Async.kt View File

13
             execute()
13
             execute()
14
         } catch (e: Exception)
14
         } catch (e: Exception)
15
         {
15
         {
16
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag,e.toString())
16
+            //[REMOVE LOG CALLS]Log.d(tag,e.toString())
17
         }
17
         }
18
     }
18
     }
19
 
19
 
46
         }
46
         }
47
 
47
 
48
 
48
 
49
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "fallback for no network. Store reset : $storeReset")
49
+        //[REMOVE LOG CALLS]Log.d(tag, "fallback for no network. Store reset : $storeReset")
50
     }
50
     }
51
 
51
 
52
     override fun doInBackground(vararg params: Any?): Any? {
52
     override fun doInBackground(vararg params: Any?): Any? {
53
         try {
53
         try {
54
             return handler(parameters)
54
             return handler(parameters)
55
         } catch (e: Exception) {
55
         } catch (e: Exception) {
56
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag,e.toString())
56
+            //[REMOVE LOG CALLS]Log.d(tag,e.toString())
57
             onException(e)
57
             onException(e)
58
         }
58
         }
59
         return null
59
         return null
63
         try {
63
         try {
64
             post(result)
64
             post(result)
65
         } catch (e: Exception) {
65
         } catch (e: Exception) {
66
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag,e.toString())
66
+            //[REMOVE LOG CALLS]Log.d(tag,e.toString())
67
             onException(e)
67
             onException(e)
68
         }
68
         }
69
     }
69
     }

+ 3 - 3
app/src/main/java/fr/forum_thalie/tsumugi/BaseActivity.kt View File

21
         val height =  ((rootLayout?.height ?: 0))
21
         val height =  ((rootLayout?.height ?: 0))
22
         val width =  ((rootLayout?.width ?: 0))
22
         val width =  ((rootLayout?.width ?: 0))
23
 
23
 
24
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$viewWidth, $viewHeight, $width, $height, ${viewHeight.toDouble()/viewWidth.toDouble()}, ${height.toDouble()/width.toDouble()}")
24
+        //[REMOVE LOG CALLS]Log.d(tag, "$viewWidth, $viewHeight, $width, $height, ${viewHeight.toDouble()/viewWidth.toDouble()}, ${height.toDouble()/width.toDouble()}")
25
 
25
 
26
         val broadcastManager = LocalBroadcastManager.getInstance(this@BaseActivity)
26
         val broadcastManager = LocalBroadcastManager.getInstance(this@BaseActivity)
27
         if(height <= viewHeight * 2 / 3 /*height.toDouble()/width.toDouble() < 1.20 */){
27
         if(height <= viewHeight * 2 / 3 /*height.toDouble()/width.toDouble() < 1.20 */){
49
         // do things when keyboard is shown
49
         // do things when keyboard is shown
50
         val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav)
50
         val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav)
51
         bottomNavigationView.visibility = View.GONE
51
         bottomNavigationView.visibility = View.GONE
52
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to GONE (height $keyboardHeight)")
52
+        //[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to GONE (height $keyboardHeight)")
53
     }
53
     }
54
 
54
 
55
      private fun onHideKeyboard() {
55
      private fun onHideKeyboard() {
56
         // do things when keyboard is hidden
56
         // do things when keyboard is hidden
57
         val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav)
57
         val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav)
58
         bottomNavigationView.visibility = View.VISIBLE
58
         bottomNavigationView.visibility = View.VISIBLE
59
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to VISIBLE")
59
+        //[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to VISIBLE")
60
     }
60
     }
61
 
61
 
62
     protected fun attachKeyboardListeners() {
62
     protected fun attachKeyboardListeners() {

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/BootBroadcastReceiver.kt View File

12
 class BootBroadcastReceiver : BroadcastReceiver(){
12
 class BootBroadcastReceiver : BroadcastReceiver(){
13
 
13
 
14
     override fun onReceive(context: Context, arg1: Intent) {
14
     override fun onReceive(context: Context, arg1: Intent) {
15
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "Broadcast Receiver received $arg1")
15
+        //[REMOVE LOG CALLS]Log.d(tag, "Broadcast Receiver received $arg1")
16
         // define preferenceStore for places of the program that needs to access Preferences without a context
16
         // define preferenceStore for places of the program that needs to access Preferences without a context
17
         preferenceStore = PreferenceManager.getDefaultSharedPreferences(context)
17
         preferenceStore = PreferenceManager.getDefaultSharedPreferences(context)
18
 
18
 

+ 6 - 6
app/src/main/java/fr/forum_thalie/tsumugi/MainActivity.kt View File

138
         // Post-UI Launch
138
         // Post-UI Launch
139
         if (PlayerStore.instance.isInitialized)
139
         if (PlayerStore.instance.isInitialized)
140
         {
140
         {
141
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "skipped initialization")
141
+            //[REMOVE LOG CALLS]Log.d(tag, "skipped initialization")
142
         } else {
142
         } else {
143
             // if the service is not started, start it in STOP mode.
143
             // if the service is not started, start it in STOP mode.
144
             // It's not a dummy action : with STOP mode, the player does not buffer audio (and does not use data connection without the user's consent).
144
             // It's not a dummy action : with STOP mode, the player does not buffer audio (and does not use data connection without the user's consent).
196
             val i = Intent(this, RadioService::class.java)
196
             val i = Intent(this, RadioService::class.java)
197
             i.putExtra("action", a.name)
197
             i.putExtra("action", a.name)
198
             i.putExtra("value", v)
198
             i.putExtra("value", v)
199
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "Sending intent ${a.name}")
199
+            //[REMOVE LOG CALLS]Log.d(tag, "Sending intent ${a.name}")
200
             startService(i)
200
             startService(i)
201
     }
201
     }
202
 
202
 
241
                 // File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/MyPersonalAppFolder")
241
                 // File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/MyPersonalAppFolder")
242
                 val logDirectory = File("$appDirectory/log")
242
                 val logDirectory = File("$appDirectory/log")
243
                 val logFile = File(logDirectory, "logcat" + System.currentTimeMillis() + ".txt")
243
                 val logFile = File(logDirectory, "logcat" + System.currentTimeMillis() + ".txt")
244
-                //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(
244
+                //[REMOVE LOG CALLS]Log.d(
245
                     tag,
245
                     tag,
246
                     "appDirectory : $appDirectory, logDirectory : $logDirectory, logFile : $logFile"
246
                     "appDirectory : $appDirectory, logDirectory : $logDirectory, logFile : $logFile"
247
                 )
247
                 )
249
                 // create app folder
249
                 // create app folder
250
                 if (!appDirectory.exists()) {
250
                 if (!appDirectory.exists()) {
251
                     appDirectory.mkdir()
251
                     appDirectory.mkdir()
252
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$appDirectory created")
252
+                    //[REMOVE LOG CALLS]Log.d(tag, "$appDirectory created")
253
                 }
253
                 }
254
 
254
 
255
                 // create log folder
255
                 // create log folder
256
                 if (!logDirectory.exists()) {
256
                 if (!logDirectory.exists()) {
257
                     logDirectory.mkdir()
257
                     logDirectory.mkdir()
258
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$logDirectory created")
258
+                    //[REMOVE LOG CALLS]Log.d(tag, "$logDirectory created")
259
                 }
259
                 }
260
 
260
 
261
                 // clear the previous logcat and then write the new one to the file
261
                 // clear the previous logcat and then write the new one to the file
262
                 try {
262
                 try {
263
                     Runtime.getRuntime().exec("logcat -c")
263
                     Runtime.getRuntime().exec("logcat -c")
264
                     Runtime.getRuntime().exec("logcat -v time -f $logFile *:E $tag:V ")
264
                     Runtime.getRuntime().exec("logcat -v time -f $logFile *:E $tag:V ")
265
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "logcat started")
265
+                    //[REMOVE LOG CALLS]Log.d(tag, "logcat started")
266
                 } catch (e: IOException) {
266
                 } catch (e: IOException) {
267
                     e.printStackTrace()
267
                     e.printStackTrace()
268
                 }
268
                 }

+ 15 - 15
app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt View File

68
                 // This *should* work in any case...
68
                 // This *should* work in any case...
69
                 when (intent.getIntExtra("state", -1)) {
69
                 when (intent.getIntExtra("state", -1)) {
70
                 0 -> {
70
                 0 -> {
71
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is unplugged")
71
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is unplugged")
72
                 }
72
                 }
73
                 1 -> {
73
                 1 -> {
74
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is plugged")
74
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is plugged")
75
                     headsetPluggedIn = true
75
                     headsetPluggedIn = true
76
                 }
76
                 }
77
                 else -> {
77
                 else -> {
78
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "I have no idea what the headset state is")
78
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "I have no idea what the headset state is")
79
                 }
79
                 }
80
                 }
80
                 }
81
                 /*
81
                 /*
91
                 }
91
                 }
92
                 else
92
                 else
93
                 {
93
                 {
94
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Can't get state?")
94
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Can't get state?")
95
                 }
95
                 }
96
 
96
 
97
                  */
97
                  */
127
 
127
 
128
         if (PlayerStore.instance.playbackState.value == PlaybackStateCompat.STATE_PLAYING)
128
         if (PlayerStore.instance.playbackState.value == PlaybackStateCompat.STATE_PLAYING)
129
         {
129
         {
130
-            Log.d(tag, radioTag + "SONG CHANGED AND PLAYING")
130
+            //[REMOVE LOG CALLS]Log.d((tag, radioTag + "SONG CHANGED AND PLAYING")
131
             // we activate latency compensation only if it's been at least 2 songs...
131
             // we activate latency compensation only if it's been at least 2 songs...
132
             when {
132
             when {
133
                 PlayerStore.instance.isStreamDown -> {
133
                 PlayerStore.instance.isStreamDown -> {
233
         startForeground(radioServiceId, nowPlayingNotification.notification)
233
         startForeground(radioServiceId, nowPlayingNotification.notification)
234
 
234
 
235
         PlayerStore.instance.isServiceStarted.value = true
235
         PlayerStore.instance.isServiceStarted.value = true
236
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "created")
236
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "created")
237
     }
237
     }
238
 
238
 
239
     private val handler = Handler()
239
     private val handler = Handler()
274
             Actions.CANCEL_FADE_OUT.name -> { handler.removeCallbacks(lowerVolumeRunnable) }
274
             Actions.CANCEL_FADE_OUT.name -> { handler.removeCallbacks(lowerVolumeRunnable) }
275
             Actions.SNOOZE.name -> { RadioAlarm.instance.snooze(this) }
275
             Actions.SNOOZE.name -> { RadioAlarm.instance.snooze(this) }
276
         }
276
         }
277
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action"))
277
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action"))
278
         super.onStartCommand(intent, flags, startId)
278
         super.onStartCommand(intent, flags, startId)
279
         // The service must be re-created if it is destroyed by the system. This allows the user to keep actions like Bluetooth and headphones plug available.
279
         // The service must be re-created if it is destroyed by the system. This allows the user to keep actions like Bluetooth and headphones plug available.
280
         return START_STICKY
280
         return START_STICKY
286
             stopSelf()
286
             stopSelf()
287
         }
287
         }
288
         super.onTaskRemoved(rootIntent)
288
         super.onTaskRemoved(rootIntent)
289
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "task removed")
289
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "task removed")
290
     }
290
     }
291
 
291
 
292
     override fun onDestroy() {
292
     override fun onDestroy() {
318
         }
318
         }
319
 
319
 
320
         apiTicker.cancel() // stops the timer.
320
         apiTicker.cancel() // stops the timer.
321
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "destroyed")
321
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "destroyed")
322
         // if the service is destroyed, the application had become useless.
322
         // if the service is destroyed, the application had become useless.
323
         exitProcess(0)
323
         exitProcess(0)
324
     }
324
     }
389
             for (i in 0 until it.length()) {
389
             for (i in 0 until it.length()) {
390
                 val entry  = it.get(i)
390
                 val entry  = it.get(i)
391
                 if (entry is IcyHeaders) {
391
                 if (entry is IcyHeaders) {
392
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
392
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
393
                 }
393
                 }
394
                 if (entry is IcyInfo) {
394
                 if (entry is IcyInfo) {
395
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
395
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
396
                     // Note : Kotlin supports UTF-8 by default.
396
                     // Note : Kotlin supports UTF-8 by default.
397
                     numberOfSongs++
397
                     numberOfSongs++
398
                     val data = entry.title!!
398
                     val data = entry.title!!
467
             {
467
             {
468
                 Thread.sleep(1000)
468
                 Thread.sleep(1000)
469
                 i++
469
                 i++
470
-                //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
470
+                //[REMOVE LOG CALLS]Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
471
             }
471
             }
472
         }
472
         }
473
         val post: (Any?) -> Unit = {
473
         val post: (Any?) -> Unit = {
540
             SystemClock.elapsedRealtime()
540
             SystemClock.elapsedRealtime()
541
         )
541
         )
542
         mediaSession.setPlaybackState(playbackStateBuilder.build())
542
         mediaSession.setPlaybackState(playbackStateBuilder.build())
543
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
543
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
544
     }
544
     }
545
 
545
 
546
     private fun pausePlaying()
546
     private fun pausePlaying()
569
             1.0f,
569
             1.0f,
570
             SystemClock.elapsedRealtime()
570
             SystemClock.elapsedRealtime()
571
         )
571
         )
572
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "stopped")
572
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "stopped")
573
 
573
 
574
         mediaSession.setPlaybackState(playbackStateBuilder.build())
574
         mediaSession.setPlaybackState(playbackStateBuilder.build())
575
     }
575
     }
657
                 Player.STATE_ENDED -> state = "Player.STATE_ENDED"
657
                 Player.STATE_ENDED -> state = "Player.STATE_ENDED"
658
                 Player.STATE_READY -> state = "Player.STATE_READY"
658
                 Player.STATE_READY -> state = "Player.STATE_READY"
659
             }
659
             }
660
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.")
660
+            //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.")
661
         }
661
         }
662
     }
662
     }
663
 
663
 

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/alarm/RadioAlarm.kt View File

97
         calendar.isLenient = true
97
         calendar.isLenient = true
98
         calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH) + i, hourOfDay, minute)
98
         calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH) + i, hourOfDay, minute)
99
 
99
 
100
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, calendar.toString())
100
+        //[REMOVE LOG CALLS]Log.d(tag, calendar.toString())
101
 
101
 
102
 
102
 
103
         return calendar.timeInMillis
103
         return calendar.timeInMillis

+ 2 - 2
app/src/main/java/fr/forum_thalie/tsumugi/alarm/RadioSleeper.kt View File

61
 
61
 
62
             AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, currentMillis + (minutes * 60 * 1000) - (1 * 60 * 1000), fadeOutIntent)
62
             AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, currentMillis + (minutes * 60 * 1000) - (1 * 60 * 1000), fadeOutIntent)
63
             sleepAtMillis.value = System.currentTimeMillis() + (minutes * 60 * 1000) - 1 // this -1 allows to round the division for display at the right integer
63
             sleepAtMillis.value = System.currentTimeMillis() + (minutes * 60 * 1000) - 1 // this -1 allows to round the division for display at the right integer
64
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "set sleep to $minutes minutes")
64
+            //[REMOVE LOG CALLS]Log.d(tag, "set sleep to $minutes minutes")
65
         }
65
         }
66
     }
66
     }
67
 
67
 
79
             c.startService(cancelFadeOutIntent)
79
             c.startService(cancelFadeOutIntent)
80
         }
80
         }
81
 
81
 
82
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "cancelled sleep")
82
+        //[REMOVE LOG CALLS]Log.d(tag, "cancelled sleep")
83
         sleepAtMillis.value = null
83
         sleepAtMillis.value = null
84
     }
84
     }
85
 }
85
 }

+ 2 - 2
app/src/main/java/fr/forum_thalie/tsumugi/planning/Programme.kt View File

35
         val isSpanningOverNight =
35
         val isSpanningOverNight =
36
             (((0b1000000 shr ((currentDay - 1) % 7) and (periodicity)) != 0) && hourEnd < hourBegin)
36
             (((0b1000000 shr ((currentDay - 1) % 7) and (periodicity)) != 0) && hourEnd < hourBegin)
37
 
37
 
38
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$title is today: $isToday or spanning $isSpanningOverNight")
38
+        //[REMOVE LOG CALLS]Log.d(tag, "$title is today: $isToday or spanning $isSpanningOverNight")
39
         // shr = shift-right. It's a binary mask.
39
         // shr = shift-right. It's a binary mask.
40
 
40
 
41
         // if the program started yesterday, and spanned over night, it means that there could be a chance that it's still active.
41
         // if the program started yesterday, and spanned over night, it means that there could be a chance that it's still active.
87
      */
87
      */
88
 
88
 
89
     init {
89
     init {
90
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, this.toString())
90
+        //[REMOVE LOG CALLS]Log.d(tag, this.toString())
91
     }
91
     }
92
 }
92
 }

+ 7 - 7
app/src/main/java/fr/forum_thalie/tsumugi/playerstore/PlayerStore.kt View File

97
         if(isCompensatingLatency)
97
         if(isCompensatingLatency)
98
         {
98
         {
99
             latencyCompensator = getTimestamp(res.getJSONObject("station").getString("schedulerTime")) - (currentSong.startTime.value ?: getTimestamp(res.getJSONObject("station").getString("schedulerTime")))
99
             latencyCompensator = getTimestamp(res.getJSONObject("station").getString("schedulerTime")) - (currentSong.startTime.value ?: getTimestamp(res.getJSONObject("station").getString("schedulerTime")))
100
-            Log.d(tag, "latency compensator set to ${(latencyCompensator).toFloat()/1000} s")
100
+            //[REMOVE LOG CALLS]Log.d((tag, "latency compensator set to ${(latencyCompensator).toFloat()/1000} s")
101
         }
101
         }
102
         currentTime.value = getTimestamp(res.getJSONObject("station").getString("schedulerTime")) - (latencyCompensator)
102
         currentTime.value = getTimestamp(res.getJSONObject("station").getString("schedulerTime")) - (latencyCompensator)
103
 
103
 
104
         /*
104
         /*
105
         val listeners = resMain.getInt("listeners")
105
         val listeners = resMain.getInt("listeners")
106
         listenersCount.value = listeners
106
         listenersCount.value = listeners
107
-        Log.d(tag, playerStoreTag +  "store updated")
107
+        //[REMOVE LOG CALLS]Log.d((tag, playerStoreTag +  "store updated")
108
          */
108
          */
109
     }
109
     }
110
 
110
 
165
     fun updateQueue() {
165
     fun updateQueue() {
166
         if (queue.isNotEmpty()) {
166
         if (queue.isNotEmpty()) {
167
             queue.remove(queue.first())
167
             queue.remove(queue.first())
168
-            Log.d(tag, queue.toString())
168
+            //[REMOVE LOG CALLS]Log.d((tag, queue.toString())
169
             fetchLastRequest()
169
             fetchLastRequest()
170
             isQueueUpdated.value = true
170
             isQueueUpdated.value = true
171
         } else if (isInitialized) {
171
         } else if (isInitialized) {
172
             fetchLastRequest()
172
             fetchLastRequest()
173
         } else {
173
         } else {
174
-            Log.d(tag,  "queue is empty! fetching anyway !!")
174
+            //[REMOVE LOG CALLS]Log.d((tag,  "queue is empty! fetching anyway !!")
175
             fetchLastRequest()
175
             fetchLastRequest()
176
         }
176
         }
177
     }
177
     }
185
                 lp.add(0, n)
185
                 lp.add(0, n)
186
             currentSongBackup.copy(currentSong)
186
             currentSongBackup.copy(currentSong)
187
             isLpUpdated.value = true
187
             isLpUpdated.value = true
188
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, playerStoreTag +  lp.toString())
188
+            //[REMOVE LOG CALLS]Log.d(tag, playerStoreTag +  lp.toString())
189
         //}
189
         //}
190
     }
190
     }
191
 
191
 
231
                     val t = extractSong(queueJSON)
231
                     val t = extractSong(queueJSON)
232
                     if (queue.isNotEmpty() && t == queue.last())
232
                     if (queue.isNotEmpty() && t == queue.last())
233
                     {
233
                     {
234
-                        Log.d(tag, playerStoreTag +  "Song already in there: $t")
234
+                        //[REMOVE LOG CALLS]Log.d((tag, playerStoreTag +  "Song already in there: $t")
235
                         Async(sleepScrape, post)
235
                         Async(sleepScrape, post)
236
                     } else {
236
                     } else {
237
                         queue.add(queue.size, t)
237
                         queue.add(queue.size, t)
238
-                        Log.d(tag, playerStoreTag +  "added last queue song: $t")
238
+                        //[REMOVE LOG CALLS]Log.d(tag, playerStoreTag +  "added last queue song: $t")
239
                         isQueueUpdated.value = true
239
                         isQueueUpdated.value = true
240
                     }
240
                     }
241
                 }
241
                 }

+ 3 - 3
app/src/main/java/fr/forum_thalie/tsumugi/ui/news/NewsFragment.kt View File

43
                 }
43
                 }
44
 
44
 
45
                 newsViewModel.isWebViewLoaded = true
45
                 newsViewModel.isWebViewLoaded = true
46
-                //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "webview created")
46
+                //[REMOVE LOG CALLS]Log.d(tag, "webview created")
47
             } else {
47
             } else {
48
-                //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "webview already created!?")
48
+                //[REMOVE LOG CALLS]Log.d(tag, "webview already created!?")
49
             }
49
             }
50
 
50
 
51
             newsViewModel.root.addOnLayoutChangeListener(orientationLayoutListener)
51
             newsViewModel.root.addOnLayoutChangeListener(orientationLayoutListener)
101
             ViewModelProviders.of(this).get(NewsViewModel::class.java)
101
             ViewModelProviders.of(this).get(NewsViewModel::class.java)
102
 
102
 
103
         newsViewModel.fetch(c = context!!, isPreloading = true)
103
         newsViewModel.fetch(c = context!!, isPreloading = true)
104
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "news fetched onCreate")
104
+        //[REMOVE LOG CALLS]Log.d(tag, "news fetched onCreate")
105
         super.onCreate(savedInstanceState)
105
         super.onCreate(savedInstanceState)
106
     }
106
     }
107
 }
107
 }

+ 3 - 3
app/src/main/java/fr/forum_thalie/tsumugi/ui/news/NewsViewModel.kt View File

43
 
43
 
44
         val maxNumberOfArticles = 5
44
         val maxNumberOfArticles = 5
45
         coroutineScope.launch(Dispatchers.Main) {
45
         coroutineScope.launch(Dispatchers.Main) {
46
-            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "launching coroutine")
46
+            //[REMOVE LOG CALLS]Log.d(tag, "launching coroutine")
47
                 val parser = Parser()
47
                 val parser = Parser()
48
             try {
48
             try {
49
                 val articleList = parser.getArticles(urlToScrape)
49
                 val articleList = parser.getArticles(urlToScrape)
50
                 newsArray.clear()
50
                 newsArray.clear()
51
                 for (i in 0 until min(articleList.size, maxNumberOfArticles)) {
51
                 for (i in 0 until min(articleList.size, maxNumberOfArticles)) {
52
                     val item = articleList[i]
52
                     val item = articleList[i]
53
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "i = $i / ${articleList.size}")
53
+                    //[REMOVE LOG CALLS]Log.d(tag, "i = $i / ${articleList.size}")
54
                     val news = News()
54
                     val news = News()
55
                     news.title = item.title ?: ""
55
                     news.title = item.title ?: ""
56
                     news.link = item.link ?: urlToScrape
56
                     news.link = item.link ?: urlToScrape
60
 
60
 
61
                     val formatter6 = SimpleDateFormat(newsDateTimePattern, Locale.ENGLISH)
61
                     val formatter6 = SimpleDateFormat(newsDateTimePattern, Locale.ENGLISH)
62
                     val dateString = item.pubDate.toString()
62
                     val dateString = item.pubDate.toString()
63
-                    //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$news --- $dateString")
63
+                    //[REMOVE LOG CALLS]Log.d(tag, "$news --- $dateString")
64
 
64
 
65
                     news.date = formatter6.parse(dateString) ?: Date(0)
65
                     news.date = formatter6.parse(dateString) ?: Date(0)
66
 
66
 

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/nowplaying/NowPlayingFragment.kt View File

275
                 (viewHeight*100)/viewWidth
275
                 (viewHeight*100)/viewWidth
276
         else
276
         else
277
             100
277
             100
278
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "orientation set")
278
+        //[REMOVE LOG CALLS]Log.d(tag, "orientation set")
279
     }
279
     }
280
 
280
 
281
     override fun onResume() {
281
     override fun onResume() {

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/programme/ProgrammeFragment.kt View File

41
 
41
 
42
         val tabLayout : TabLayout = root.findViewById(R.id.dayTabLayout)
42
         val tabLayout : TabLayout = root.findViewById(R.id.dayTabLayout)
43
         tabLayout.setupWithViewPager(viewPager)
43
         tabLayout.setupWithViewPager(viewPager)
44
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created")
44
+        //[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created")
45
 
45
 
46
         return root
46
         return root
47
     }
47
     }

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/songs/SongsFragment.kt View File

39
 
39
 
40
         val tabLayout : TabLayout = root.findViewById(R.id.tabLayout)
40
         val tabLayout : TabLayout = root.findViewById(R.id.tabLayout)
41
         tabLayout.setupWithViewPager(viewPager)
41
         tabLayout.setupWithViewPager(viewPager)
42
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created")
42
+        //[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created")
43
 
43
 
44
         return root
44
         return root
45
     }
45
     }

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/songs/queuelp/LastPlayedFragment.kt View File

31
 
31
 
32
 
32
 
33
     private val queueObserver = Observer<Boolean> {
33
     private val queueObserver = Observer<Boolean> {
34
-        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, lastPlayedFragmentTag + "queue changed")
34
+        //[REMOVE LOG CALLS]Log.d(tag, lastPlayedFragmentTag + "queue changed")
35
         viewAdapter.notifyDataSetChanged()
35
         viewAdapter.notifyDataSetChanged()
36
     }
36
     }
37
 
37