Skip to content

Commit df82ce2

Browse files
committed
Migrated GenreListFragment to Compose
Note: This is done on the back of some really great work by rivaldi8
1 parent ce864ff commit df82ce2

File tree

24 files changed

+1303
-471
lines changed

24 files changed

+1303
-471
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: "support/scripts/unit-test"
5656

5757
- name: "Unit Test Results"
58-
uses: actions/upload-artifact@v3
58+
uses: actions/upload-artifact@v4
5959
if: always()
6060
with:
6161
name: test-results

.github/workflows/continuous_deployment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: "support/scripts/unit-test"
4747

4848
- name: "Unit Test Results"
49-
uses: actions/upload-artifact@v3
49+
uses: actions/upload-artifact@v4
5050
if: always()
5151
with:
5252
name: test-results
@@ -61,7 +61,7 @@ jobs:
6161
CONFIGURATION: Release
6262

6363
- name: "Upload App Bundle"
64-
uses: actions/upload-artifact@v3
64+
uses: actions/upload-artifact@v4
6565
with:
6666
name: app-bundle
6767
path: |

.idea/detekt.xml

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/app/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ plugins {
88
id("com.google.firebase.crashlytics")
99
id("com.google.devtools.ksp")
1010
alias(libs.plugins.compose.compiler)
11+
alias(libs.plugins.detekt)
1112
}
1213

1314
android {
@@ -268,6 +269,10 @@ android {
268269
implementation(libs.androidx.work.runtime.ktx)
269270
implementation(libs.androidx.hilt.work)
270271
ksp(libs.androidx.hilt.compiler)
272+
273+
detektPlugins(libs.detekt.formatting)
274+
275+
lintChecks(libs.compose.lint.checks)
271276
}
272277

273278
buildFeatures.buildConfig = true

android/app/src/debug/res/layout/activity_main.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
android:layout_height="match_parent"
77
android:fitsSystemWindows="true">
88

9-
<androidx.drawerlayout.widget.DrawerLayout
10-
android:id="@+id/drawer_layout"
11-
android:layout_width="match_parent"
12-
android:layout_height="match_parent">
9+
<!-- <androidx.drawerlayout.widget.DrawerLayout-->
10+
<!-- android:id="@+id/drawer_layout"-->
11+
<!-- android:layout_width="match_parent"-->
12+
<!-- android:layout_height="match_parent">-->
1313

1414
<androidx.fragment.app.FragmentContainerView
1515
android:id="@+id/onboardingNavHostFragment"
@@ -18,23 +18,23 @@
1818
android:layout_height="match_parent"
1919
app:defaultNavHost="true" />
2020

21-
<com.google.android.material.navigation.NavigationView
22-
android:id="@+id/nav_view"
23-
android:layout_width="match_parent"
24-
android:layout_height="match_parent"
25-
android:layout_gravity="end"
26-
android:background="?android:attr/windowBackground"
27-
android:fitsSystemWindows="true">
21+
<!-- <com.google.android.material.navigation.NavigationView-->
22+
<!-- android:id="@+id/nav_view"-->
23+
<!-- android:layout_width="match_parent"-->
24+
<!-- android:layout_height="match_parent"-->
25+
<!-- android:layout_gravity="end"-->
26+
<!-- android:background="?android:attr/windowBackground"-->
27+
<!-- android:fitsSystemWindows="true">-->
2828

29-
<androidx.fragment.app.FragmentContainerView
30-
android:id="@+id/debugDrawerFragment"
31-
android:name="com.simplecityapps.shuttle.ui.screens.debug.DebugDrawerFragment"
32-
android:layout_width="match_parent"
33-
android:layout_height="match_parent" />
29+
<!-- <androidx.fragment.app.FragmentContainerView-->
30+
<!-- android:id="@+id/debugDrawerFragment"-->
31+
<!-- android:name="com.simplecityapps.shuttle.ui.screens.debug.DebugDrawerFragment"-->
32+
<!-- android:layout_width="match_parent"-->
33+
<!-- android:layout_height="match_parent" />-->
3434

35-
</com.google.android.material.navigation.NavigationView>
35+
<!-- </com.google.android.material.navigation.NavigationView>-->
3636

37-
</androidx.drawerlayout.widget.DrawerLayout>
37+
<!-- </androidx.drawerlayout.widget.DrawerLayout>-->
3838

3939
<com.simplecityapps.shuttle.ui.common.view.SnowfallView
4040
android:id="@+id/snowfallView"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.simplecityapps.shuttle.ui.screens.library.genres
2+
3+
import androidx.compose.material3.DropdownMenu
4+
import androidx.compose.material3.DropdownMenuItem
5+
import androidx.compose.material3.Text
6+
import androidx.compose.runtime.Composable
7+
import androidx.compose.ui.Modifier
8+
import androidx.compose.ui.res.stringResource
9+
import com.simplecityapps.shuttle.R
10+
import com.simplecityapps.shuttle.model.Genre
11+
import com.simplecityapps.shuttle.model.Playlist
12+
import com.simplecityapps.shuttle.ui.screens.playlistmenu.PlaylistData
13+
14+
@Composable
15+
fun AddToPlaylistSubmenu(
16+
modifier: Modifier = Modifier,
17+
genre: Genre,
18+
expanded: Boolean = false,
19+
onDismiss: () -> Unit = {},
20+
playlists: List<Playlist>,
21+
onAddToPlaylist: (playlist: Playlist, playlistData: PlaylistData) -> Unit,
22+
onShowCreatePlaylistDialog: (genre: Genre) -> Unit
23+
) {
24+
val playlistData = PlaylistData.Genres(genre)
25+
26+
DropdownMenu(
27+
modifier = modifier,
28+
expanded = expanded,
29+
onDismissRequest = onDismiss
30+
) {
31+
DropdownMenuItem(
32+
text = { Text(stringResource(id = R.string.playlist_menu_create_playlist)) },
33+
onClick = {
34+
onShowCreatePlaylistDialog(genre)
35+
onDismiss()
36+
}
37+
)
38+
39+
for (playlist in playlists) {
40+
DropdownMenuItem(
41+
text = { Text(playlist.name) },
42+
onClick = {
43+
onAddToPlaylist(playlist, playlistData)
44+
onDismiss()
45+
}
46+
)
47+
}
48+
}
49+
}

0 commit comments

Comments
 (0)