removed log calls and dupes comments

remotes/origin/devel
yattoz 2020-01-12 02:22:29 +01:00
parent f133bea0ac
commit 4769b2f0bf
15 changed files with 51 additions and 51 deletions

View File

@ -13,7 +13,7 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
execute() execute()
} catch (e: Exception) } catch (e: Exception)
{ {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag,e.toString()) //[REMOVE LOG CALLS]Log.d(tag,e.toString())
} }
} }
@ -46,14 +46,14 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
} }
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "fallback for no network. Store reset : $storeReset") //[REMOVE LOG CALLS]Log.d(tag, "fallback for no network. Store reset : $storeReset")
} }
override fun doInBackground(vararg params: Any?): Any? { override fun doInBackground(vararg params: Any?): Any? {
try { try {
return handler(parameters) return handler(parameters)
} catch (e: Exception) { } catch (e: Exception) {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag,e.toString()) //[REMOVE LOG CALLS]Log.d(tag,e.toString())
onException(e) onException(e)
} }
return null return null
@ -63,7 +63,7 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
try { try {
post(result) post(result)
} catch (e: Exception) { } catch (e: Exception) {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag,e.toString()) //[REMOVE LOG CALLS]Log.d(tag,e.toString())
onException(e) onException(e)
} }
} }

View File

@ -21,7 +21,7 @@ abstract class BaseActivity : AppCompatActivity() {
val height = ((rootLayout?.height ?: 0)) val height = ((rootLayout?.height ?: 0))
val width = ((rootLayout?.width ?: 0)) val width = ((rootLayout?.width ?: 0))
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$viewWidth, $viewHeight, $width, $height, ${viewHeight.toDouble()/viewWidth.toDouble()}, ${height.toDouble()/width.toDouble()}") //[REMOVE LOG CALLS]Log.d(tag, "$viewWidth, $viewHeight, $width, $height, ${viewHeight.toDouble()/viewWidth.toDouble()}, ${height.toDouble()/width.toDouble()}")
val broadcastManager = LocalBroadcastManager.getInstance(this@BaseActivity) val broadcastManager = LocalBroadcastManager.getInstance(this@BaseActivity)
if(height <= viewHeight * 2 / 3 /*height.toDouble()/width.toDouble() < 1.20 */){ if(height <= viewHeight * 2 / 3 /*height.toDouble()/width.toDouble() < 1.20 */){
@ -49,14 +49,14 @@ abstract class BaseActivity : AppCompatActivity() {
// do things when keyboard is shown // do things when keyboard is shown
val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav) val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav)
bottomNavigationView.visibility = View.GONE bottomNavigationView.visibility = View.GONE
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to GONE (height $keyboardHeight)") //[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to GONE (height $keyboardHeight)")
} }
private fun onHideKeyboard() { private fun onHideKeyboard() {
// do things when keyboard is hidden // do things when keyboard is hidden
val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav) val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav)
bottomNavigationView.visibility = View.VISIBLE bottomNavigationView.visibility = View.VISIBLE
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to VISIBLE") //[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to VISIBLE")
} }
protected fun attachKeyboardListeners() { protected fun attachKeyboardListeners() {

View File

@ -12,7 +12,7 @@ import fr.forum_thalie.tsumugi.playerstore.PlayerStore
class BootBroadcastReceiver : BroadcastReceiver(){ class BootBroadcastReceiver : BroadcastReceiver(){
override fun onReceive(context: Context, arg1: Intent) { override fun onReceive(context: Context, arg1: Intent) {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "Broadcast Receiver received $arg1") //[REMOVE LOG CALLS]Log.d(tag, "Broadcast Receiver received $arg1")
// define preferenceStore for places of the program that needs to access Preferences without a context // define preferenceStore for places of the program that needs to access Preferences without a context
preferenceStore = PreferenceManager.getDefaultSharedPreferences(context) preferenceStore = PreferenceManager.getDefaultSharedPreferences(context)

View File

@ -138,7 +138,7 @@ class MainActivity : BaseActivity() {
// Post-UI Launch // Post-UI Launch
if (PlayerStore.instance.isInitialized) if (PlayerStore.instance.isInitialized)
{ {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "skipped initialization") //[REMOVE LOG CALLS]Log.d(tag, "skipped initialization")
} else { } else {
// if the service is not started, start it in STOP mode. // if the service is not started, start it in STOP mode.
// 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). // 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,7 +196,7 @@ class MainActivity : BaseActivity() {
val i = Intent(this, RadioService::class.java) val i = Intent(this, RadioService::class.java)
i.putExtra("action", a.name) i.putExtra("action", a.name)
i.putExtra("value", v) i.putExtra("value", v)
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "Sending intent ${a.name}") //[REMOVE LOG CALLS]Log.d(tag, "Sending intent ${a.name}")
startService(i) startService(i)
} }
@ -241,7 +241,7 @@ class MainActivity : BaseActivity() {
// File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/MyPersonalAppFolder") // File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/MyPersonalAppFolder")
val logDirectory = File("$appDirectory/log") val logDirectory = File("$appDirectory/log")
val logFile = File(logDirectory, "logcat" + System.currentTimeMillis() + ".txt") val logFile = File(logDirectory, "logcat" + System.currentTimeMillis() + ".txt")
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d( //[REMOVE LOG CALLS]Log.d(
tag, tag,
"appDirectory : $appDirectory, logDirectory : $logDirectory, logFile : $logFile" "appDirectory : $appDirectory, logDirectory : $logDirectory, logFile : $logFile"
) )
@ -249,20 +249,20 @@ class MainActivity : BaseActivity() {
// create app folder // create app folder
if (!appDirectory.exists()) { if (!appDirectory.exists()) {
appDirectory.mkdir() appDirectory.mkdir()
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$appDirectory created") //[REMOVE LOG CALLS]Log.d(tag, "$appDirectory created")
} }
// create log folder // create log folder
if (!logDirectory.exists()) { if (!logDirectory.exists()) {
logDirectory.mkdir() logDirectory.mkdir()
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$logDirectory created") //[REMOVE LOG CALLS]Log.d(tag, "$logDirectory created")
} }
// clear the previous logcat and then write the new one to the file // clear the previous logcat and then write the new one to the file
try { try {
Runtime.getRuntime().exec("logcat -c") Runtime.getRuntime().exec("logcat -c")
Runtime.getRuntime().exec("logcat -v time -f $logFile *:E $tag:V ") Runtime.getRuntime().exec("logcat -v time -f $logFile *:E $tag:V ")
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "logcat started") //[REMOVE LOG CALLS]Log.d(tag, "logcat started")
} catch (e: IOException) { } catch (e: IOException) {
e.printStackTrace() e.printStackTrace()
} }

View File

@ -68,14 +68,14 @@ class RadioService : MediaBrowserServiceCompat() {
// This *should* work in any case... // This *should* work in any case...
when (intent.getIntExtra("state", -1)) { when (intent.getIntExtra("state", -1)) {
0 -> { 0 -> {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is unplugged") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is unplugged")
} }
1 -> { 1 -> {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is plugged") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is plugged")
headsetPluggedIn = true headsetPluggedIn = true
} }
else -> { else -> {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "I have no idea what the headset state is") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "I have no idea what the headset state is")
} }
} }
/* /*
@ -91,7 +91,7 @@ class RadioService : MediaBrowserServiceCompat() {
} }
else else
{ {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Can't get state?") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Can't get state?")
} }
*/ */
@ -127,7 +127,7 @@ class RadioService : MediaBrowserServiceCompat() {
if (PlayerStore.instance.playbackState.value == PlaybackStateCompat.STATE_PLAYING) if (PlayerStore.instance.playbackState.value == PlaybackStateCompat.STATE_PLAYING)
{ {
Log.d(tag, radioTag + "SONG CHANGED AND PLAYING") //[REMOVE LOG CALLS]Log.d((tag, radioTag + "SONG CHANGED AND PLAYING")
// we activate latency compensation only if it's been at least 2 songs... // we activate latency compensation only if it's been at least 2 songs...
when { when {
PlayerStore.instance.isStreamDown -> { PlayerStore.instance.isStreamDown -> {
@ -233,7 +233,7 @@ class RadioService : MediaBrowserServiceCompat() {
startForeground(radioServiceId, nowPlayingNotification.notification) startForeground(radioServiceId, nowPlayingNotification.notification)
PlayerStore.instance.isServiceStarted.value = true PlayerStore.instance.isServiceStarted.value = true
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "created") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "created")
} }
private val handler = Handler() private val handler = Handler()
@ -274,7 +274,7 @@ class RadioService : MediaBrowserServiceCompat() {
Actions.CANCEL_FADE_OUT.name -> { handler.removeCallbacks(lowerVolumeRunnable) } Actions.CANCEL_FADE_OUT.name -> { handler.removeCallbacks(lowerVolumeRunnable) }
Actions.SNOOZE.name -> { RadioAlarm.instance.snooze(this) } Actions.SNOOZE.name -> { RadioAlarm.instance.snooze(this) }
} }
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action")) //[REMOVE LOG CALLS]Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action"))
super.onStartCommand(intent, flags, startId) super.onStartCommand(intent, flags, startId)
// 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. // 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.
return START_STICKY return START_STICKY
@ -286,7 +286,7 @@ class RadioService : MediaBrowserServiceCompat() {
stopSelf() stopSelf()
} }
super.onTaskRemoved(rootIntent) super.onTaskRemoved(rootIntent)
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "task removed") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "task removed")
} }
override fun onDestroy() { override fun onDestroy() {
@ -318,7 +318,7 @@ class RadioService : MediaBrowserServiceCompat() {
} }
apiTicker.cancel() // stops the timer. apiTicker.cancel() // stops the timer.
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "destroyed") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "destroyed")
// if the service is destroyed, the application had become useless. // if the service is destroyed, the application had become useless.
exitProcess(0) exitProcess(0)
} }
@ -389,10 +389,10 @@ class RadioService : MediaBrowserServiceCompat() {
for (i in 0 until it.length()) { for (i in 0 until it.length()) {
val entry = it.get(i) val entry = it.get(i)
if (entry is IcyHeaders) { if (entry is IcyHeaders) {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
} }
if (entry is IcyInfo) { if (entry is IcyInfo) {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
// Note : Kotlin supports UTF-8 by default. // Note : Kotlin supports UTF-8 by default.
numberOfSongs++ numberOfSongs++
val data = entry.title!! val data = entry.title!!
@ -467,7 +467,7 @@ class RadioService : MediaBrowserServiceCompat() {
{ {
Thread.sleep(1000) Thread.sleep(1000)
i++ i++
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped") //[REMOVE LOG CALLS]Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
} }
} }
val post: (Any?) -> Unit = { val post: (Any?) -> Unit = {
@ -540,7 +540,7 @@ class RadioService : MediaBrowserServiceCompat() {
SystemClock.elapsedRealtime() SystemClock.elapsedRealtime()
) )
mediaSession.setPlaybackState(playbackStateBuilder.build()) mediaSession.setPlaybackState(playbackStateBuilder.build())
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
} }
private fun pausePlaying() private fun pausePlaying()
@ -569,7 +569,7 @@ class RadioService : MediaBrowserServiceCompat() {
1.0f, 1.0f,
SystemClock.elapsedRealtime() SystemClock.elapsedRealtime()
) )
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "stopped") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "stopped")
mediaSession.setPlaybackState(playbackStateBuilder.build()) mediaSession.setPlaybackState(playbackStateBuilder.build())
} }
@ -657,7 +657,7 @@ class RadioService : MediaBrowserServiceCompat() {
Player.STATE_ENDED -> state = "Player.STATE_ENDED" Player.STATE_ENDED -> state = "Player.STATE_ENDED"
Player.STATE_READY -> state = "Player.STATE_READY" Player.STATE_READY -> state = "Player.STATE_READY"
} }
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.")
} }
} }

View File

@ -97,7 +97,7 @@ class RadioAlarm {
calendar.isLenient = true calendar.isLenient = true
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH) + i, hourOfDay, minute) calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH) + i, hourOfDay, minute)
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, calendar.toString()) //[REMOVE LOG CALLS]Log.d(tag, calendar.toString())
return calendar.timeInMillis return calendar.timeInMillis

View File

@ -61,7 +61,7 @@ class RadioSleeper {
AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, currentMillis + (minutes * 60 * 1000) - (1 * 60 * 1000), fadeOutIntent) AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, currentMillis + (minutes * 60 * 1000) - (1 * 60 * 1000), fadeOutIntent)
sleepAtMillis.value = System.currentTimeMillis() + (minutes * 60 * 1000) - 1 // this -1 allows to round the division for display at the right integer sleepAtMillis.value = System.currentTimeMillis() + (minutes * 60 * 1000) - 1 // this -1 allows to round the division for display at the right integer
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "set sleep to $minutes minutes") //[REMOVE LOG CALLS]Log.d(tag, "set sleep to $minutes minutes")
} }
} }
@ -79,7 +79,7 @@ class RadioSleeper {
c.startService(cancelFadeOutIntent) c.startService(cancelFadeOutIntent)
} }
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "cancelled sleep") //[REMOVE LOG CALLS]Log.d(tag, "cancelled sleep")
sleepAtMillis.value = null sleepAtMillis.value = null
} }
} }

View File

@ -35,7 +35,7 @@ class Programme (val title: String, private val periodicity: Int, private val ho
val isSpanningOverNight = val isSpanningOverNight =
(((0b1000000 shr ((currentDay - 1) % 7) and (periodicity)) != 0) && hourEnd < hourBegin) (((0b1000000 shr ((currentDay - 1) % 7) and (periodicity)) != 0) && hourEnd < hourBegin)
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$title is today: $isToday or spanning $isSpanningOverNight") //[REMOVE LOG CALLS]Log.d(tag, "$title is today: $isToday or spanning $isSpanningOverNight")
// shr = shift-right. It's a binary mask. // shr = shift-right. It's a binary mask.
// if the program started yesterday, and spanned over night, it means that there could be a chance that it's still active. // if the program started yesterday, and spanned over night, it means that there could be a chance that it's still active.
@ -87,6 +87,6 @@ class Programme (val title: String, private val periodicity: Int, private val ho
*/ */
init { init {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, this.toString()) //[REMOVE LOG CALLS]Log.d(tag, this.toString())
} }
} }

View File

@ -97,14 +97,14 @@ class PlayerStore {
if(isCompensatingLatency) if(isCompensatingLatency)
{ {
latencyCompensator = getTimestamp(res.getJSONObject("station").getString("schedulerTime")) - (currentSong.startTime.value ?: getTimestamp(res.getJSONObject("station").getString("schedulerTime"))) latencyCompensator = getTimestamp(res.getJSONObject("station").getString("schedulerTime")) - (currentSong.startTime.value ?: getTimestamp(res.getJSONObject("station").getString("schedulerTime")))
Log.d(tag, "latency compensator set to ${(latencyCompensator).toFloat()/1000} s") //[REMOVE LOG CALLS]Log.d((tag, "latency compensator set to ${(latencyCompensator).toFloat()/1000} s")
} }
currentTime.value = getTimestamp(res.getJSONObject("station").getString("schedulerTime")) - (latencyCompensator) currentTime.value = getTimestamp(res.getJSONObject("station").getString("schedulerTime")) - (latencyCompensator)
/* /*
val listeners = resMain.getInt("listeners") val listeners = resMain.getInt("listeners")
listenersCount.value = listeners listenersCount.value = listeners
Log.d(tag, playerStoreTag + "store updated") //[REMOVE LOG CALLS]Log.d((tag, playerStoreTag + "store updated")
*/ */
} }
@ -165,13 +165,13 @@ class PlayerStore {
fun updateQueue() { fun updateQueue() {
if (queue.isNotEmpty()) { if (queue.isNotEmpty()) {
queue.remove(queue.first()) queue.remove(queue.first())
Log.d(tag, queue.toString()) //[REMOVE LOG CALLS]Log.d((tag, queue.toString())
fetchLastRequest() fetchLastRequest()
isQueueUpdated.value = true isQueueUpdated.value = true
} else if (isInitialized) { } else if (isInitialized) {
fetchLastRequest() fetchLastRequest()
} else { } else {
Log.d(tag, "queue is empty! fetching anyway !!") //[REMOVE LOG CALLS]Log.d((tag, "queue is empty! fetching anyway !!")
fetchLastRequest() fetchLastRequest()
} }
} }
@ -185,7 +185,7 @@ class PlayerStore {
lp.add(0, n) lp.add(0, n)
currentSongBackup.copy(currentSong) currentSongBackup.copy(currentSong)
isLpUpdated.value = true isLpUpdated.value = true
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, playerStoreTag + lp.toString()) //[REMOVE LOG CALLS]Log.d(tag, playerStoreTag + lp.toString())
//} //}
} }
@ -231,11 +231,11 @@ class PlayerStore {
val t = extractSong(queueJSON) val t = extractSong(queueJSON)
if (queue.isNotEmpty() && t == queue.last()) if (queue.isNotEmpty() && t == queue.last())
{ {
Log.d(tag, playerStoreTag + "Song already in there: $t") //[REMOVE LOG CALLS]Log.d((tag, playerStoreTag + "Song already in there: $t")
Async(sleepScrape, post) Async(sleepScrape, post)
} else { } else {
queue.add(queue.size, t) queue.add(queue.size, t)
Log.d(tag, playerStoreTag + "added last queue song: $t") //[REMOVE LOG CALLS]Log.d(tag, playerStoreTag + "added last queue song: $t")
isQueueUpdated.value = true isQueueUpdated.value = true
} }
} }

View File

@ -43,9 +43,9 @@ class NewsFragment : Fragment() {
} }
newsViewModel.isWebViewLoaded = true newsViewModel.isWebViewLoaded = true
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "webview created") //[REMOVE LOG CALLS]Log.d(tag, "webview created")
} else { } else {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "webview already created!?") //[REMOVE LOG CALLS]Log.d(tag, "webview already created!?")
} }
newsViewModel.root.addOnLayoutChangeListener(orientationLayoutListener) newsViewModel.root.addOnLayoutChangeListener(orientationLayoutListener)
@ -101,7 +101,7 @@ class NewsFragment : Fragment() {
ViewModelProviders.of(this).get(NewsViewModel::class.java) ViewModelProviders.of(this).get(NewsViewModel::class.java)
newsViewModel.fetch(c = context!!, isPreloading = true) newsViewModel.fetch(c = context!!, isPreloading = true)
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "news fetched onCreate") //[REMOVE LOG CALLS]Log.d(tag, "news fetched onCreate")
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
} }
} }

View File

@ -43,14 +43,14 @@ class NewsViewModel : ViewModel() {
val maxNumberOfArticles = 5 val maxNumberOfArticles = 5
coroutineScope.launch(Dispatchers.Main) { coroutineScope.launch(Dispatchers.Main) {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "launching coroutine") //[REMOVE LOG CALLS]Log.d(tag, "launching coroutine")
val parser = Parser() val parser = Parser()
try { try {
val articleList = parser.getArticles(urlToScrape) val articleList = parser.getArticles(urlToScrape)
newsArray.clear() newsArray.clear()
for (i in 0 until min(articleList.size, maxNumberOfArticles)) { for (i in 0 until min(articleList.size, maxNumberOfArticles)) {
val item = articleList[i] val item = articleList[i]
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "i = $i / ${articleList.size}") //[REMOVE LOG CALLS]Log.d(tag, "i = $i / ${articleList.size}")
val news = News() val news = News()
news.title = item.title ?: "" news.title = item.title ?: ""
news.link = item.link ?: urlToScrape news.link = item.link ?: urlToScrape
@ -60,7 +60,7 @@ class NewsViewModel : ViewModel() {
val formatter6 = SimpleDateFormat(newsDateTimePattern, Locale.ENGLISH) val formatter6 = SimpleDateFormat(newsDateTimePattern, Locale.ENGLISH)
val dateString = item.pubDate.toString() val dateString = item.pubDate.toString()
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "$news --- $dateString") //[REMOVE LOG CALLS]Log.d(tag, "$news --- $dateString")
news.date = formatter6.parse(dateString) ?: Date(0) news.date = formatter6.parse(dateString) ?: Date(0)

View File

@ -275,7 +275,7 @@ class NowPlayingFragment : Fragment() {
(viewHeight*100)/viewWidth (viewHeight*100)/viewWidth
else else
100 100
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "orientation set") //[REMOVE LOG CALLS]Log.d(tag, "orientation set")
} }
override fun onResume() { override fun onResume() {

View File

@ -41,7 +41,7 @@ class ProgrammeFragment : Fragment() {
val tabLayout : TabLayout = root.findViewById(R.id.dayTabLayout) val tabLayout : TabLayout = root.findViewById(R.id.dayTabLayout)
tabLayout.setupWithViewPager(viewPager) tabLayout.setupWithViewPager(viewPager)
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created") //[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created")
return root return root
} }

View File

@ -39,7 +39,7 @@ class SongsFragment : Fragment() {
val tabLayout : TabLayout = root.findViewById(R.id.tabLayout) val tabLayout : TabLayout = root.findViewById(R.id.tabLayout)
tabLayout.setupWithViewPager(viewPager) tabLayout.setupWithViewPager(viewPager)
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created") //[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created")
return root return root
} }

View File

@ -31,7 +31,7 @@ class LastPlayedFragment : Fragment() {
private val queueObserver = Observer<Boolean> { private val queueObserver = Observer<Boolean> {
//[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, lastPlayedFragmentTag + "queue changed") //[REMOVE LOG CALLS]Log.d(tag, lastPlayedFragmentTag + "queue changed")
viewAdapter.notifyDataSetChanged() viewAdapter.notifyDataSetChanged()
} }