Skip to content

Commit

Permalink
Last Tweaks Before Release
Browse files Browse the repository at this point in the history
  • Loading branch information
CraftWorksMC committed Mar 24, 2024
1 parent c86c3d2 commit df82048
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 35 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

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

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ Sorry for the recent lack of updates, school is taking a lot of my time. hopeful
- Synced And Unsynced Lyrics [From lrclib.net]
- Playlists [Navidrome Only]
- Android Auto
## Roadmap
## W.I.P

- Offline Playlists
## Roadmap

- Artist Page
- Jellyfin (Music) Support


## Screenshots
<p align="center">
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId = "com.craftworks.music"
minSdk = 30
targetSdk = 34
versionCode = 160
versionName = "1.16"
versionCode = 170
versionName = "1.17"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
29 changes: 12 additions & 17 deletions app/src/main/java/com/craftworks/music/ui/NowPlaying.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.blur
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.scale
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.BlendMode
Expand Down Expand Up @@ -293,7 +294,9 @@ fun NowPlayingContent(
0f,
label = "Animated Top Offset")

Box(modifier = Modifier.graphicsLayer { translationY = -offsetY }.zIndex(1f)) {
Box(modifier = Modifier
.graphicsLayer { translationY = -offsetY }
.zIndex(1f)) {
NowPlayingMiniPlayer(scaffoldState, isPlaying)
}

Expand Down Expand Up @@ -543,11 +546,15 @@ fun SliderUpdating(isLandscape: Boolean? = false){
}
val sliderHeight = if (isLandscape == true) 24.dp else 12.dp



Slider(
enabled = (transcodingBitrate.value == "No Transcoding" || SongHelper.currentSong.isRadio == false),
modifier = Modifier
.width(sliderWidth)
.height(sliderHeight),
.height(sliderHeight)
.scale(scaleX = 1f, scaleY = 1.25f)
.clip(RoundedCornerShape(12.dp)),
value = animatedSliderValue,
onValueChange = {
SongHelper.isSeeking = true
Expand All @@ -561,24 +568,12 @@ fun SliderUpdating(isLandscape: Boolean? = false){
activeTrackColor = MaterialTheme.colorScheme.onBackground,
inactiveTrackColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.25f),
),
thumb = {},
/*track = { sliderPositions ->
SliderDefaults.Track(
modifier = Modifier
.scale(scaleX = 1f, scaleY = 1.25f)
.clip(RoundedCornerShape(12.dp)),
sliderPositions = sliderPositions,
colors = SliderDefaults.colors(
activeTrackColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f),
inactiveTrackColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.25f),
)
)
},*/
thumb = {}
)
Box (modifier = Modifier.width(if (isLandscape == true) 460.dp else 320.dp)) {
Text(
text = formatMilliseconds(sliderPos.intValue.toFloat()),
fontWeight = FontWeight.Thin,
fontWeight = FontWeight.Light,
textAlign = TextAlign.Start,
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f),
modifier = Modifier
Expand All @@ -589,7 +584,7 @@ fun SliderUpdating(isLandscape: Boolean? = false){

Text(
text = formatMilliseconds(SongHelper.currentSong.duration.toFloat()),
fontWeight = FontWeight.Thin,
fontWeight = FontWeight.Light,
textAlign = TextAlign.End,
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f),
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ fun NowPlayingPortraitCover (){
it.substring(0, 17) + "..." + "" + SongHelper.currentSong.year
else
it + "" + SongHelper.currentSong.year,
fontSize = MaterialTheme.typography.bodyLarge.fontSize,
fontWeight = FontWeight.Light,
fontSize = MaterialTheme.typography.titleMedium.fontSize,
fontWeight = FontWeight.Normal,
color = MaterialTheme.colorScheme.onBackground,
maxLines = 1, overflow = TextOverflow.Ellipsis,
textAlign = TextAlign.Start
Expand All @@ -143,7 +143,7 @@ fun NowPlayingPortraitCover (){
stringResource(R.string.Source_Navidrome)
} ",
style = MaterialTheme.typography.labelLarge,
fontWeight = FontWeight.Thin,
fontWeight = FontWeight.Light,
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f),
maxLines = 1, overflow = TextOverflow.Ellipsis,
textAlign = TextAlign.Start
Expand Down Expand Up @@ -227,7 +227,7 @@ fun NowPlayingLandscape(
else
it + "" + SongHelper.currentSong.year,
fontSize = MaterialTheme.typography.bodyMedium.fontSize,
fontWeight = FontWeight.Light,
fontWeight = FontWeight.Normal,
color = MaterialTheme.colorScheme.onBackground,
maxLines = 1, overflow = TextOverflow.Ellipsis,
textAlign = TextAlign.Start
Expand All @@ -238,7 +238,7 @@ fun NowPlayingLandscape(
Text(
text = format.toString(),
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Thin,
fontWeight = FontWeight.Light,
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f),
maxLines = 1, overflow = TextOverflow.Ellipsis,
textAlign = TextAlign.Start
Expand Down
11 changes: 7 additions & 4 deletions app/src/main/java/com/craftworks/music/ui/screens/HomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -86,11 +87,13 @@ fun HomeScreen(navHostController: NavHostController = rememberNavController()) {
var recentlyPlayedSongsList = songsList.sortedByDescending { song: Song -> song.lastPlayed }.take(10)
var recentSongsList = songsList.sortedByDescending { song: Song -> song.dateAdded }
var mostPlayedList = songsList.sortedByDescending { song: Song -> song.timesPlayed }
var shuffledSongsList = remember { songsList.take(10).shuffled() }
var shuffledSongsList = remember { mutableStateOf(songsList.take(10).shuffled()) }

val state = rememberPullToRefreshState()
if (state.isRefreshing) {
LaunchedEffect(true) {
songsList.clear()

if (useNavidromeServer.value){
getNavidromeSongs(URL("${navidromeServersList[selectedNavidromeServerIndex.intValue].url}/rest/search3.view?query=''&songCount=10000&u=${navidromeServersList[selectedNavidromeServerIndex.intValue].username}&p=${navidromeServersList[selectedNavidromeServerIndex.intValue].password}&v=1.12.0&c=Chora"))
}
Expand All @@ -103,7 +106,7 @@ fun HomeScreen(navHostController: NavHostController = rememberNavController()) {
recentlyPlayedSongsList = songsList.sortedByDescending { song: Song -> song.lastPlayed }.take(10)
recentSongsList = songsList.sortedByDescending { song: Song -> song.dateAdded }
mostPlayedList = songsList.sortedByDescending { song: Song -> song.timesPlayed }
shuffledSongsList = songsList.take(10).shuffled()
shuffledSongsList = mutableStateOf(songsList.take(10).shuffled())

state.endRefresh()
}
Expand Down Expand Up @@ -277,9 +280,9 @@ fun HomeScreen(navHostController: NavHostController = rememberNavController()) {
)

/* SONGS ROW */
SongsRow(songsList = shuffledSongsList, onSongSelected = { song ->
SongsRow(songsList = shuffledSongsList.value, onSongSelected = { song ->
playingSong.selectedSong = song
playingSong.selectedList = shuffledSongsList
playingSong.selectedList = shuffledSongsList.value
//songState = true
song.media?.let { SongHelper.playStream(context = context, url = it) }
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand All @@ -31,6 +31,7 @@ import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
Expand All @@ -40,10 +41,10 @@ import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import coil.compose.AsyncImage
import com.craftworks.music.R
import com.craftworks.music.SongHelper
import com.craftworks.music.data.Screen
import com.craftworks.music.fadingEdge
import com.craftworks.music.playingSong
import com.craftworks.music.songState
import com.craftworks.music.ui.elements.SongsHorizontalColumn

@ExperimentalFoundationApi
Expand Down Expand Up @@ -102,18 +103,20 @@ fun PlaylistDetails(navHostController: NavHostController = rememberNavController
)
}
}
Divider(
HorizontalDivider(
modifier = Modifier.padding(12.dp, 0.dp, 12.dp, 0.dp),
thickness = 2.dp,
color = MaterialTheme.colorScheme.onBackground
)

val context = LocalContext.current
Column(modifier = Modifier.padding(12.dp, top = 0.dp)) {
selectedPlaylist?.songs?.let {
SongsHorizontalColumn(it, onSongSelected = { song ->
playingSong.selectedSong = song
playingSong.selectedList = it
songState = true })
playingSong.selectedList = selectedPlaylist!!.songs
song.media?.let { songUri -> SongHelper.playStream(context = context, url = songUri) }
})
}
}
}
Expand Down

0 comments on commit df82048

Please sign in to comment.