Skip to content

Commit

Permalink
Large version update
Browse files Browse the repository at this point in the history
- Java to 21
- AGP
- Android compile to 35
- Update (most) library versions
- Fixed some deprecation warnings
- Ran code cleanup
  • Loading branch information
Iliano101 committed Nov 2, 2024
1 parent 4df799b commit 5245284
Show file tree
Hide file tree
Showing 28 changed files with 446 additions and 786 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/beta-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
java-version: "21"
cache: "gradle"

- name: Change wrapper permissions
Expand All @@ -55,7 +55,7 @@ jobs:
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
# override default build-tools version (33.0.0) -- optional
BUILD_TOOLS_VERSION: "34.0.0"
BUILD_TOOLS_VERSION: "35.0.0"

- name: Rename APK file
run: sudo mv ${{steps.sign_app.outputs.signedReleaseFile}} /${{env.apk_file_name}}.apk
Expand Down
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions .idea/gradle.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

329 changes: 0 additions & 329 deletions .idea/other.xml

This file was deleted.

8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {

android {
namespace = "com.maxrave.simpmusic"
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = "com.maxrave.simpmusic"
Expand Down Expand Up @@ -71,11 +71,11 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
jvmToolchain(21)
}
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-Xcontext-receivers"
jvmTarget = "17"
jvmTarget = "21"
}
// enable view binding
buildFeatures {
Expand Down Expand Up @@ -171,7 +171,7 @@ android {
"META-INF/*.kotlin_module",
)
}

}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SeeArtistOfNowPlayingAdapter(private val listArtist: List<Artist>): Recycl

override fun getItemCount(): Int = listArtist.size

override fun onBindViewHolder(holder: SeeArtistOfNowPlayingAdapter.ViewHolder, position: Int) {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val artist = listArtist[position]
with(holder.binding) {
tvSeeArtists.text = artist.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class SearchItemAdapter(private var searchResultList: ArrayList<Any>, var contex
placeholder(R.drawable.holder_video)
}
tvVideoTitle.text = video.title
val tempArtist = mutableListOf<String>()
mutableListOf<String>()
if (video.artists != null) {
tvAuthor.text = video.artists.toListName().connectArtists()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ class LocalPlaylistManager(
?.continuation
}.onFailure { continueParam = null }
}
if (listContent.isEmpty()) {
if (listContent.isEmpty) {
emit(LocalResource.Error("Can't get setVideoId"))
}
val parsed = parseSetVideoId(ytPlaylistId, listContent)
if (parsed.isEmpty()) {
if (parsed.isEmpty) {
emit(LocalResource.Error("Can't get setVideoId"))
}
parsed.forEach { setVideoId ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ fun parseSong(data: MusicTwoRowItemRenderer, context: Context): Content {
var name = ""
var id = ""
var view = ""
var radioString = ""
""
val listArtist: MutableList<Artist> = mutableListOf()
val listAlbum: MutableList<Album> = mutableListOf()
Log.d("parse_runs", runs.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fun parseGenreObject(data: BrowseResponse?): GenreObject? {
val songName = content.musicResponsiveListItemRenderer?.flexColumns?.get(0)?.musicResponsiveListItemFlexColumnRenderer?.text?.runs?.get(0)?.text
val songArtist = content.musicResponsiveListItemRenderer?.flexColumns?.get(1)?.musicResponsiveListItemFlexColumnRenderer?.text?.runs?.get(0)?.text
val videoId = content.musicResponsiveListItemRenderer?.flexColumns?.get(0)?.musicResponsiveListItemFlexColumnRenderer?.text?.runs?.get(0)?.navigationEndpoint?.watchEndpoint?.videoId
val thumbnails = content.musicResponsiveListItemRenderer?.thumbnail?.musicThumbnailRenderer?.thumbnail?.thumbnails?.toListThumbnail()
content.musicResponsiveListItemRenderer?.thumbnail?.musicThumbnailRenderer?.thumbnail?.thumbnails?.toListThumbnail()
listItemsSong.add(
ItemsSong(
title = songName ?: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun parseRelated(data: List<PlaylistPanelRenderer.Content>?): ArrayList<Track>?
}
}
}
if (artist.isEmpty()) {
if (artist.isEmpty) {
val artistName = longByTextRuns[0].text
val artistId = longByTextRuns[0].navigationEndpoint?.browseEndpoint?.browseId
artist.add(Artist(artistId ?: "", artistName))
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/maxrave/simpmusic/extension/AllExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fun SongsResult.toTrack(): Track {
this.duration ?: "",
this.durationSeconds ?: 0,
true,
this.isExplicit ?: false,
this.isExplicit == true,
"",
this.thumbnails,
this.title ?: "",
Expand Down Expand Up @@ -374,7 +374,7 @@ fun Track.toMediaItem(): MediaItem {
if (thumbUrl.contains("w120")) {
thumbUrl = Regex("([wh])120").replace(thumbUrl, "$1544")
}
val artistName: String = this.artists.toListName().connectArtists()
this.artists.toListName().connectArtists()
val isSong = (this.thumbnails?.last()?.height != 0 && this.thumbnails?.last()?.height == this.thumbnails?.last()?.width
&& this.thumbnails?.last()?.height != null) && (!thumbUrl.contains("hq720") && !thumbUrl.contains("maxresdefault"))
return MediaItem.Builder()
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/maxrave/simpmusic/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ class MainActivity : AppCompatActivity() {
}

private fun isNetworkAvailable(context: Context?): Boolean {
val connectivityManager = context?.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val connectivityManager = context?.getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager
// Returns a Network object corresponding to
// the currently active default data network.
val network = connectivityManager.activeNetwork ?: return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fun HomeItem(
navController: NavController,
data: HomeItem
) {
val coroutineScope = rememberCoroutineScope()
rememberCoroutineScope()
var bottomSheetShow by remember { mutableStateOf(false) }

val lazyListState = rememberLazyListState()
Expand Down
Loading

0 comments on commit 5245284

Please sign in to comment.