Skip to content

Commit

Permalink
Merge branch 'release/3.0.2' into latest
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudsftp committed Nov 3, 2023
2 parents 6e78462 + c974bb7 commit 3584484
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 37 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bad Radio Android ![version](https://img.shields.io/badge/v3.0.1-blue.svg)
# Bad Radio Android ![version](https://img.shields.io/badge/v3.0.2-blue.svg)

[![website](https://img.shields.io/badge/Website-grey.svg)](https://badradio.nz/)
[![Build Develop](https://github.com/cloudsftp/BadRadioAndroid/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/cloudsftp/BadRadioAndroid/actions/workflows/build.yml)
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
minSdkVersion 23
compileSdk 34
targetSdkVersion 34
versionCode 317
versionName "3.0.1"
versionCode 318
versionName "3.0.2"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
signingConfigs {
Expand Down Expand Up @@ -52,8 +52,8 @@ dependencies {

implementation 'com.google.android.material:material:1.10.0'

implementation 'com.google.android.exoplayer:exoplayer:2.19.1'
implementation 'com.google.android.exoplayer:extension-okhttp:2.19.1'
implementation 'androidx.media3:media3-exoplayer:1.1.1'
implementation 'androidx.media3:media3-datasource-okhttp:1.1.1'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package nz.badradio.badradio.model.metadata

import java.io.IOException

class SongMetadata(
var title: String,
var artist: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package nz.badradio.badradio.model.metadata

import nz.badradio.badradio.utilities.moshi
import com.squareup.moshi.JsonAdapter
import nz.badradio.badradio.utilities.moshi

data class StationStatus(
val status: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package nz.badradio.badradio.model.metadata.art

import android.graphics.Bitmap
import android.util.Log
import nz.badradio.badradio.model.metadata.SongMetadata
import com.squareup.picasso.Picasso
import nz.badradio.badradio.model.metadata.SongMetadata
import java.io.IOException
import kotlin.Exception

class StreamingServiceCrawler : IStreamingServiceDataObserver {
private val crawlers = listOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package nz.badradio.badradio.model.radio

import android.os.IBinder
import android.content.*
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.Build
import android.os.IBinder
import android.support.v4.media.session.MediaSessionCompat
import nz.badradio.badradio.utilities.generateFunExecuteIf
import nz.badradio.badradio.utilities.generateFunExecuteWhen
import nz.badradio.badradio.view.notification.MediaNotificationManager
import nz.badradio.badradio.viewmodel.RadioVM
import nz.badradio.badradio.viewmodel.UserInputVMObserver
import nz.badradio.badradio.utilities.generateFunExecuteIf
import nz.badradio.badradio.utilities.generateFunExecuteWhen
import java.util.concurrent.atomic.AtomicBoolean

object RadioManager: UserInputVMObserver {
Expand Down
26 changes: 17 additions & 9 deletions app/src/main/java/nz/badradio/badradio/model/radio/RadioService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,27 @@ package nz.badradio.badradio.model.radio
import android.app.Service
import android.content.Intent
import android.net.Uri
import android.os.*
import nz.badradio.badradio.utilities.client
import com.google.android.exoplayer2.*
import com.google.android.exoplayer2.audio.AudioAttributes
import com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource
import com.google.android.exoplayer2.source.ProgressiveMediaSource
import nz.badradio.badradio.viewmodel.RadioVM
import nz.badradio.badradio.viewmodel.UserInputVMObserver
import android.os.Binder
import android.os.Handler
import android.os.IBinder
import android.os.Looper
import androidx.media3.common.AudioAttributes
import androidx.media3.common.C
import androidx.media3.common.MediaItem
import androidx.media3.common.Player
import androidx.media3.common.util.UnstableApi
import androidx.media3.datasource.okhttp.OkHttpDataSource
import androidx.media3.exoplayer.DefaultLoadControl
import androidx.media3.exoplayer.ExoPlayer
import androidx.media3.exoplayer.source.ProgressiveMediaSource
import nz.badradio.badradio.model.station.StationInfo
import nz.badradio.badradio.model.station.getStationInfo
import nz.badradio.badradio.utilities.client
import nz.badradio.badradio.utilities.generateFunExecuteWhen
import nz.badradio.badradio.viewmodel.RadioVM
import nz.badradio.badradio.viewmodel.UserInputVMObserver

class RadioService : Service(), UserInputVMObserver {
@UnstableApi class RadioService : Service(), UserInputVMObserver {
private lateinit var mediaPlayer: ExoPlayer

private val audioAttributes = AudioAttributes.Builder().apply {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package nz.badradio.badradio.model.station

import android.util.Log
import com.squareup.moshi.JsonAdapter
import nz.badradio.badradio.Config
import nz.badradio.badradio.utilities.client
import nz.badradio.badradio.utilities.moshi
import com.squareup.moshi.JsonAdapter
import okhttp3.Call
import okhttp3.Callback
import okhttp3.Request
import okhttp3.Response
import java.io.IOException
import kotlin.jvm.Throws

fun getStationInfo(callback: (StationInfo) -> Unit) {
val stationInfoListRequest = Request.Builder().url(Config.STATION_DATA_URL).build()
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/nz/badradio/badradio/view/PlayerActivity.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package nz.badradio.badradio.view

import android.Manifest
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import nz.badradio.badradio.R
import nz.badradio.badradio.databinding.ActivityPlayerBinding
import nz.badradio.badradio.viewmodel.RadioVM
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package nz.badradio.badradio.view.notification

import android.Manifest
import android.annotation.SuppressLint
import android.app.PendingIntent
import android.app.TaskStackBuilder
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.support.v4.media.session.MediaSessionCompat
import androidx.core.app.ActivityCompat
import androidx.core.app.NotificationChannelCompat
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.media.app.NotificationCompat.MediaStyle
import nz.badradio.badradio.R
import nz.badradio.badradio.view.PlayerActivity
import nz.badradio.badradio.model.radio.RadioService
import nz.badradio.badradio.view.PlayerActivity
import nz.badradio.badradio.viewmodel.RadioVMObserver
import nz.badradio.badradio.viewmodel.RadioVMState

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package nz.badradio.badradio.view.notification

import android.content.Context
import android.graphics.Bitmap
import android.os.Build
import android.os.Bundle
import android.support.v4.media.MediaMetadataCompat
import android.support.v4.media.session.MediaSessionCompat
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/nz/badradio/badradio/viewmodel/RadioVM.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import android.support.v4.media.MediaBrowserCompat
import android.support.v4.media.MediaBrowserCompat.MediaItem.FLAG_PLAYABLE
import android.support.v4.media.MediaDescriptionCompat
import androidx.media.MediaBrowserServiceCompat
import com.google.android.exoplayer2.MediaMetadata
import com.google.android.exoplayer2.PlaybackException
import com.google.android.exoplayer2.Player
import androidx.media3.common.MediaMetadata
import androidx.media3.common.Player
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
Expand Down

0 comments on commit 3584484

Please sign in to comment.